diff --git a/python/api-examples-source/widget.button.py b/python/api-examples-source/widget.button.py index 07d199644..85540b67d 100644 --- a/python/api-examples-source/widget.button.py +++ b/python/api-examples-source/widget.button.py @@ -1,6 +1,7 @@ import streamlit as st -if st.button("Say hello"): - st.write("Why hello there") +st.button('Reset', type='primary') +if st.button('Say hello'): + st.write('Why hello there') else: - st.write("Goodbye") + st.write('Goodbye') diff --git a/python/streamlit.json b/python/streamlit.json index 0423bdfc0..dd73effc4 100644 --- a/python/streamlit.json +++ b/python/streamlit.json @@ -1,14 +1,14 @@ { - "1.26.0": { + "1.11.0": { "streamlit.altair_chart": { "name": "altair_chart", - "signature": "st.altair_chart(altair_chart, use_container_width=False, theme=\"streamlit\")", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(chart_data).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n
\n", - "description": "

Display a chart using the Altair library.

\n", + "signature": "st.altair_chart(altair_chart, use_container_width=False)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n     np.random.randn(200, 3),\n     columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n     x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a chart using the Altair library.", "args": [ { "name": "altair_chart", - "type_name": "altair.Chart", + "type_name": "altair.vegalite.v2.api.Chart", "is_optional": false, "description": "

The Altair chart object to display.

\n", "default": null @@ -19,96 +19,61 @@ "is_optional": false, "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", "default": null - }, - { - "name": "theme", - "type_name": "\"streamlit\" or None", - "is_optional": false, - "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", - "default": "behavior" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L766" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/dataframe_selector.py#L295" }, "streamlit.area_chart": { "name": "area_chart", - "signature": "st.area_chart(data=None, *, x=None, y=None, color=None, width=0, height=0, use_container_width=True)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns = ['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n

You can also choose different columns to use for x and y, as well as set\nthe color dynamically based on a 3rd column (assuming your dataframe is in\nlong format):

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame({\n    'col1' : np.random.randn(20),\n    'col2' : np.random.randn(20),\n    'col3' : np.random.choice(['A', 'B', 'C'], 20)\n})\n\nst.area_chart(\n    chart_data,\n    x = 'col1',\n    y = 'col2',\n    color = 'col3'\n)\n
\n\n \n

Finally, if your dataframe is in wide format, you can group multiple\ncolumns under the y argument to show multiple series with different\ncolors:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['col1', 'col2', 'col3'])\n\nst.area_chart(\n    chart_data,\n    x='col1',\n    y=['col2', 'col3'],\n    color=['#FF0000','#0000FF']  # Optional\n)\n
\n\n \n
\n", + "signature": "st.area_chart(data=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nchart_data = pd.DataFrame(\n     np.random.randn(20, 3),\n     columns=['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", "args": [ { "name": "data", - "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, or dict", "is_optional": false, - "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", - "default": null - }, - { - "name": "x", - "type_name": "str or None", - "is_optional": false, - "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null }, - { - "name": "y", - "type_name": "str, sequence of str, or None", - "is_optional": false, - "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", - "default": null - }, - { - "name": "color", - "type_name": "str, tuple, sequence of str, sequence of tuple, or None", - "is_optional": false, - "description": "

The color to use for different series in this chart. This argument\ncan only be supplied by keyword.

\n

For an area chart with just 1 series, this can be:

\n\n

For an area chart with multiple series, where the dataframe is in\nlong format (that is, y is None or just one column), this can be:

\n\n

For an area chart with multiple series, where the dataframe is in\nwide format (that is, y is a sequence of columns), this can be:

\n\n", - "default": "color." - }, { "name": "width", "type_name": "int", "is_optional": false, - "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "description": "

The chart width in pixels. If 0, selects the width automatically.

\n", "default": null }, { "name": "height", "type_name": "int", "is_optional": false, - "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "description": "

The chart height in pixels. If 0, selects the height automatically.

\n", "default": null }, { "name": "use_container_width", "type_name": "bool", "is_optional": false, - "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L409" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/dataframe_selector.py#L186" }, "streamlit.audio": { "name": "audio", - "signature": "st.audio(data, format=\"audio/wav\", start_time=0, *, sample_rate=None)", - "example": "
\n
\nimport streamlit as st\nimport numpy as np\n\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n\nsample_rate = 44100  # 44100 samples per second\nseconds = 2  # Note duration of 2 seconds\nfrequency_la = 440  # Our played note will be 440 Hz\n# Generate array with seconds*sample_rate steps, ranging between 0 and seconds\nt = np.linspace(0, seconds, seconds * sample_rate, False)\n# Generate a 440 Hz sine wave\nnote_la = np.sin(frequency_la * t * 2 * np.pi)\n\nst.audio(note_la, sample_rate=sample_rate)\n
\n\n \n
\n", - "description": "

Display an audio player.

\n", + "signature": "st.audio(data, format=\"audio/wav\", start_time=0)", + "example": "
\n
\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an audio player.", "args": [ { "name": "data", - "type_name": "str, bytes, BytesIO, numpy.ndarray, or file", - "is_optional": false, - "description": "

Raw audio data, filename, or a URL pointing to the file to load.\nRaw data formats must include all necessary file headers to match the file\nformat specified via format.\nIf data is a numpy array, it must either be a 1D array of the waveform\nor a 2D array of shape (num_channels, num_samples) with waveforms\nfor all channels. See the default channel order at\nhttp://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx

\n", - "default": "channel" - }, - { - "name": "format", - "type_name": "str", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", "is_optional": false, - "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", - "default": "s" + "description": "

io.open().\nRaw audio data, filename, or a URL pointing to the file to load.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "default": null }, { "name": "start_time", @@ -118,88 +83,131 @@ "default": null }, { - "name": "sample_rate", - "type_name": "int or None", + "name": "format", + "type_name": "str", "is_optional": false, - "description": "

The sample rate of the audio data in samples per second. Only required if\ndata is a numpy array.

\n", - "default": null + "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/media.py#L42" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/media.py#L41" }, "streamlit.balloons": { "name": "balloons", "signature": "st.balloons()", - "example": "
\n
\nimport streamlit as st\n\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", - "description": "

Draw celebratory balloons.

\n", + "example": "
\n
\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", + "description": "Draw celebratory balloons.", "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/balloons.py#L25" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/balloons.py#L24" }, "streamlit.bar_chart": { "name": "bar_chart", - "signature": "st.bar_chart(data=None, *, x=None, y=None, color=None, width=0, height=0, use_container_width=True)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n

You can also choose different columns to use for x and y, as well as set\nthe color dynamically based on a 3rd column (assuming your dataframe is in\nlong format):

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame({\n    'col1' : np.random.randn(20),\n    'col2' : np.random.randn(20),\n    'col3' : np.random.choice(['A','B','C'],20)\n})\n\nst.bar_chart(\n    chart_data,\n    x='col1',\n    y='col2',\n    color='col3'\n)\n
\n\n \n

Finally, if your dataframe is in wide format, you can group multiple\ncolumns under the y argument to show multiple series with different\ncolors:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['col1', 'col2', 'col3'])\n\nst.bar_chart(\n    chart_data,\n    x='col1',\n    y=['col2', 'col3'],\n    color=['#FF0000','#0000FF']  # Optional\n)\n
\n\n \n
\n", + "signature": "st.bar_chart(data=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nchart_data = pd.DataFrame(\n     np.random.randn(50, 3),\n     columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", "args": [ { "name": "data", - "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, or dict", "is_optional": false, - "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null }, { - "name": "x", - "type_name": "str or None", + "name": "width", + "type_name": "int", "is_optional": false, - "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "description": "

The chart width in pixels. If 0, selects the width automatically.

\n", "default": null }, { - "name": "y", - "type_name": "str, sequence of str, or None", + "name": "height", + "type_name": "int", "is_optional": false, - "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "description": "

The chart height in pixels. If 0, selects the height automatically.

\n", "default": null }, { - "name": "color", - "type_name": "str, tuple, sequence of str, sequence of tuple, or None", + "name": "use_container_width", + "type_name": "bool", "is_optional": false, - "description": "

The color to use for different series in this chart. This argument\ncan only be supplied by keyword.

\n

For a bar chart with just 1 series, this can be:

\n\n

For a bar chart with multiple series, where the dataframe is in\nlong format (that is, y is None or just one column), this can be:

\n\n

For a bar chart with multiple series, where the dataframe is in\nwide format (that is, y is a sequence of columns), this can be:

\n\n", - "default": "color." - }, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/dataframe_selector.py#L240" + }, + "streamlit.beta_columns": { + "name": "beta_columns", + "signature": "st.beta_columns(*args, **kwargs)", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n    st.header("A cat")\n    st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n    st.header("A dog")\n    st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n    st.header("An owl")\n    st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put columns inside another column.

\n
\n", + "args": [ { - "name": "width", - "type_name": "int", + "name": "spec", + "type_name": "int or list of numbers", "is_optional": false, - "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", "default": null }, { - "name": "height", - "type_name": "int", + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", "is_optional": false, - "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/beta_util.py#L43" + }, + "streamlit.beta_container": { + "name": "beta_container", + "signature": "st.beta_container(*args, **kwargs)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.container():\n    st.write("This is inside the container")\n\n    # You can call any Streamlit command, including custom components:\n    st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/beta_util.py#L43" + }, + "streamlit.beta_expander": { + "name": "beta_expander", + "signature": "st.beta_expander(*args, **kwargs)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n     st.write("""\n         The chart above shows some numbers I picked for you.\n         I rolled actual dice for these, so they're *guaranteed* to\n         be random.\n     """)\n     st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write("""\n     The chart above shows some numbers I picked for you.\n     I rolled actual dice for these, so they're *guaranteed* to\n     be random.\n """)\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander.

\n", "default": null }, { - "name": "use_container_width", + "name": "expanded", "type_name": "bool", "is_optional": false, - "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", - "default": null + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L587" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/beta_util.py#L43" }, "streamlit.bokeh_chart": { "name": "bokeh_chart", "signature": "st.bokeh_chart(figure, use_container_width=False)", - "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n
\n", + "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n     title='simple line example',\n     x_axis_label='x',\n     y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", "args": [ { @@ -218,19 +226,19 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/bokeh_chart.py#L36" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/bokeh_chart.py#L33" }, "streamlit.button": { "name": "button", - "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", - "example": "
\n
\nimport streamlit as st\n\nst.button("Reset", type="primary")\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n
\n", - "description": "

Display a button widget.

\n", + "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\nif st.button('Say hello'):\n     st.write('Why hello there')\n else:\n     st.write('Goodbye')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a button widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "description": "

A short label explaining to the user what this button is for.

\n", "default": null }, { @@ -268,26 +276,12 @@ "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, - { - "name": "type", - "type_name": "\"secondary\" or \"primary\"", - "is_optional": false, - "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", - "default": "s" - }, { "name": "disabled", "type_name": "bool", "is_optional": false, "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", "default": "False." - }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", - "default": null } ], "returns": [ @@ -298,13 +292,13 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/button.py#L61" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/button.py#L51" }, "streamlit.cache": { "name": "cache", "signature": "st.cache(func=None, persist=False, allow_output_mutation=False, show_spinner=True, suppress_st_warning=False, hash_funcs=None, max_entries=None, ttl=None)", - "example": "
\n
\nimport streamlit as st\n\n@st.cache\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\n@st.cache(persist=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To disable hashing return values, set the allow_output_mutation parameter to True:

\n
\n@st.cache(allow_output_mutation=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. MongoClient) to a hash function (id) like this:

\n
\n@st.cache(hash_funcs={MongoClient: id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "pymongo.mongo_client.MongoClient") to the hash function instead:

\n
\n@st.cache(hash_funcs={"pymongo.mongo_client.MongoClient": id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n
\n", - "description": "

Function decorator to memoize function executions.

\n", + "example": "
\n
\n@st.cache\n def fetch_and_clean_data(url):\n     # Fetch data from URL here, and then clean it up.\n     return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\n@st.cache(persist=True)\n def fetch_and_clean_data(url):\n     # Fetch data from URL here, and then clean it up.\n     return data\n
\n

To disable hashing return values, set the allow_output_mutation parameter to True:

\n
\n@st.cache(allow_output_mutation=True)\n def fetch_and_clean_data(url):\n     # Fetch data from URL here, and then clean it up.\n     return data\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. MongoClient) to a hash function (id) like this:

\n
\n@st.cache(hash_funcs={MongoClient: id})\n def connect_to_database(url):\n     return MongoClient(url)\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "pymongo.mongo_client.MongoClient") to the hash function instead:

\n
\n@st.cache(hash_funcs={"pymongo.mongo_client.MongoClient": id})\n def connect_to_database(url):\n     return MongoClient(url)\n
\n
\n", + "description": "Function decorator to memoize function executions.", "args": [ { "name": "func", @@ -338,7 +332,7 @@ "name": "suppress_st_warning", "type_name": "boolean", "is_optional": false, - "description": "

Suppress warnings about calling Streamlit commands from within\nthe cached function.

\n", + "description": "

Suppress warnings about calling Streamlit functions from within\nthe cached function.

\n", "default": null }, { @@ -364,137 +358,19 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/runtime/legacy_caching/caching.py#L486" - }, - "streamlit.cache_data": { - "name": "cache_data", - "signature": "st.cache_data(func=None, *, ttl, max_entries, show_spinner, persist, experimental_allow_widgets, hash_funcs=None)", - "example": "
\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\nimport streamlit as st\n\n@st.cache_data(persist="disk")\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

By default, all parameters to a cached function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nconnection = make_database_connection()\nd1 = fetch_and_clean_data(connection, num_rows=10)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nanother_connection = make_database_connection()\nd2 = fetch_and_clean_data(another_connection, num_rows=10)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _database_connection parameter was different\n# in both calls.\n
\n

A cached function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nfetch_and_clean_data.clear()\n# Clear all cached entries for this function.\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. datetime.datetime) to a hash\nfunction (lambda dt: dt.isoformat()) like this:

\n
\nimport streamlit as st\nimport datetime\n\n@st.cache_data(hash_funcs={datetime.datetime: lambda dt: dt.isoformat()})\ndef convert_to_utc(dt: datetime.datetime):\n    return dt.astimezone(datetime.timezone.utc)\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "datetime.datetime") to the hash function instead:

\n
\nimport streamlit as st\nimport datetime\n\n@st.cache_data(hash_funcs={"datetime.datetime": lambda dt: dt.isoformat()})\ndef convert_to_utc(dt: datetime.datetime):\n    return dt.astimezone(datetime.timezone.utc)\n
\n
\n", - "description": "

Decorator to cache functions that return data (e.g. dataframe transforms, database queries, ML inference).

\n

Cached objects are stored in "pickled" form, which means that the return\nvalue of a cached function must be pickleable. Each caller of the cached\nfunction gets its own copy of the cached data.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_data.clear().

\n

To cache global resources, use st.cache_resource instead. Learn more\nabout caching at https://docs.streamlit.io/library/advanced-features/caching.

\n", - "args": [ - { - "name": "func", - "type_name": "callable", - "is_optional": false, - "description": "

The function to cache. Streamlit hashes the function's source code.

\n", - "default": null - }, - { - "name": "ttl", - "type_name": "float, timedelta, str, or None", - "is_optional": false, - "description": "

The maximum time to keep an entry in the cache. Can be one of:

\n\n

Note that ttl will be ignored if persist="disk" or persist=True.

\n", - "default": null - }, - { - "name": "max_entries", - "type_name": "int or None", - "is_optional": false, - "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. When a new entry is added to a full cache,\nthe oldest cached entry will be removed. Defaults to None.

\n", - "default": "None." - }, - { - "name": "show_spinner", - "type_name": "boolean or string", - "is_optional": false, - "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached data is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", - "default": "True" - }, - { - "name": "persist", - "type_name": "\"disk\", boolean, or None", - "is_optional": false, - "description": "

Optional location to persist cached data to. Passing "disk" (or True)\nwill persist the cached data to the local disk. None (or False) will disable\npersistence. The default is None.

\n", - "default": "None." - }, - { - "name": "experimental_allow_widgets", - "type_name": "boolean", - "is_optional": false, - "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", - "default": "False." - }, - { - "name": "hash_funcs", - "type_name": "dict or None", - "is_optional": false, - "description": "

Mapping of types or fully qualified names to hash functions.\nThis is used to override the behavior of the hasher inside Streamlit's\ncaching mechanism: when the hasher encounters an object, it will first\ncheck to see if its type matches a key in this dict and, if so, will use\nthe provided function to generate a hash for it. See below for an example\nof how this can be used.

\n", - "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/runtime/caching/cache_data_api.py#L384" - }, - "streamlit.cache_resource": { - "name": "cache_resource", - "signature": "st.cache_resource(func, *, ttl, max_entries, show_spinner, validate, experimental_allow_widgets, hash_funcs=None)", - "example": "
\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(url):\n    # Create a database session object that points to the URL.\n    return session\n\ns1 = get_database_session(SESSION_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(SESSION_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the connection object in s1 is the same as in s2.\n\ns3 = get_database_session(SESSION_URL_2)\n# This is a different URL, so the function executes.\n
\n

By default, all parameters to a cache_resource function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\ns1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _sessionmaker parameter was different\n# in both calls.\n
\n

A cache_resource function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\nget_database_session.clear()\n# Clear all cached entries for this function.\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. Person) to a hash\nfunction (str) like this:

\n
\nimport streamlit as st\nfrom pydantic import BaseModel\n\nclass Person(BaseModel):\n    name: str\n\n@st.cache_resource(hash_funcs={Person: str})\ndef get_person_name(person: Person):\n    return person.name\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "__main__.Person") to the hash function instead:

\n
\nimport streamlit as st\nfrom pydantic import BaseModel\n\nclass Person(BaseModel):\n    name: str\n\n@st.cache_resource(hash_funcs={"__main__.Person": str})\ndef get_person_name(person: Person):\n    return person.name\n
\n
\n", - "description": "

Decorator to cache functions that return global resources (e.g. database connections, ML models).

\n

Cached objects are shared across all users, sessions, and reruns. They\nmust be thread-safe because they can be accessed from multiple threads\nconcurrently. If thread safety is an issue, consider using st.session_state\nto store resources per session instead.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_resource.clear().

\n

To cache data, use st.cache_data instead. Learn more about caching at\nhttps://docs.streamlit.io/library/advanced-features/caching.

\n", - "args": [ - { - "name": "func", - "type_name": "callable", - "is_optional": false, - "description": "

The function that creates the cached resource. Streamlit hashes the\nfunction's source code.

\n", - "default": null - }, - { - "name": "ttl", - "type_name": "float, timedelta, str, or None", - "is_optional": false, - "description": "

The maximum time to keep an entry in the cache. Can be one of:

\n\n

Note that ttl will be ignored if persist="disk" or persist=True.

\n", - "default": null - }, - { - "name": "max_entries", - "type_name": "int or None", - "is_optional": false, - "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. When a new entry is added to a full cache,\nthe oldest cached entry will be removed. Defaults to None.

\n", - "default": "None." - }, - { - "name": "show_spinner", - "type_name": "boolean or string", - "is_optional": false, - "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached resource is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", - "default": "True" - }, - { - "name": "validate", - "type_name": "callable or None", - "is_optional": false, - "description": "

An optional validation function for cached data. validate is called\neach time the cached value is accessed. It receives the cached value as\nits only parameter and it must return a boolean. If validate returns\nFalse, the current cached value is discarded, and the decorated function\nis called to compute a new value. This is useful e.g. to check the\nhealth of database connections.

\n", - "default": null - }, - { - "name": "experimental_allow_widgets", - "type_name": "boolean", - "is_optional": false, - "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", - "default": "False." - }, - { - "name": "hash_funcs", - "type_name": "dict or None", - "is_optional": false, - "description": "

Mapping of types or fully qualified names to hash functions.\nThis is used to override the behavior of the hasher inside Streamlit's\ncaching mechanism: when the hasher encounters an object, it will first\ncheck to see if its type matches a key in this dict and, if so, will use\nthe provided function to generate a hash for it. See below for an example\nof how this can be used.

\n", - "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/runtime/caching/cache_resource_api.py#L264" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/legacy_caching/caching.py#L357" }, "streamlit.camera_input": { "name": "camera_input", - "signature": "st.camera_input(label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", - "description": "

Display a widget that returns pictures from the user's webcam.

\n", + "signature": "st.camera_input(label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n     st.image(picture)\n
\n
\n", + "description": "Display a widget that returns pictures from the user's webcam.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this widget is used for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this widget is used for.

\n", "default": null }, { @@ -538,13 +414,6 @@ "is_optional": false, "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" } ], "returns": [ @@ -555,147 +424,43 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/camera_input.py#L78" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/camera_input.py#L47" }, "streamlit.caption": { "name": "caption", - "signature": "st.caption(body, unsafe_allow_html=False, *, help=None)", - "examples": "
\n
\nimport streamlit as st\n\nst.caption('This is a string that explains something above.')\nst.caption('A caption with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "signature": "st.caption(body, unsafe_allow_html=False)", + "example": "
\n
\nst.caption('This is a string that explains something above.')\n
\n
\n", "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", "args": [ { "name": "body", "type_name": "str", "is_optional": false, - "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n\n", + "description": "

The text to display.

\n", "default": null }, { "name": "unsafe_allow_html", "type_name": "bool", "is_optional": false, - "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", - "default": null - }, - { - "name": "help", - "type_name": "str", - "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the caption.

\n", + "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n

Also note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.

\n

If you decide to turn on HTML anyway, we ask you to please tell us your\nexact use case here:\nhttps://discuss.streamlit.io/t/96 .

\n

This will help us come up with safe APIs that allow you to do what you\nwant.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/markdown.py#L146" - }, - "streamlit.chat_input": { - "name": "chat_input", - "signature": "st.chat_input(placeholder=\"Your message\", *, key=None, max_chars=None, disabled=False, on_submit=None, args=None, kwargs=None)", - "examples": "
\n
\nimport streamlit as st\n\nprompt = st.chat_input("Say something")\nif prompt:\n    st.write(f"User has sent the following prompt: {prompt}")\n
\n\n \n
\n", - "description": "

Display a chat input widget.

\n
\n

Warning

\n

Chat input can only be used once per app page and inside the main area of the app.\nIt cannot be used in the sidebar, columns, expanders, forms or tabs.\nWe plan to support this in the future.

\n
\n", - "args": [ - { - "name": "placeholder", - "type_name": "str", - "is_optional": false, - "description": "

A placeholder text shown when the chat input is empty. Defaults to\n"Your message". For accessibility reasons, you should not use an\nempty string.

\n", - "default": "s" - }, - { - "name": "key", - "type_name": "str or int", - "is_optional": false, - "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget based on\nits content. Multiple widgets of the same type may not share the same key.

\n", - "default": null - }, - { - "name": "max_chars", - "type_name": "int or None", - "is_optional": false, - "description": "

The maximum number of characters that can be entered. If None\n(default), there will be no maximum.

\n", - "default": null - }, - { - "name": "disabled", - "type_name": "bool", - "is_optional": false, - "description": "

Whether the chat input should be disabled. Defaults to False.

\n", - "default": "False." - }, - { - "name": "on_submit", - "type_name": "callable", - "is_optional": false, - "description": "

An optional callback invoked when the chat input's value is submitted.

\n", - "default": null - }, - { - "name": "args", - "type_name": "tuple", - "is_optional": false, - "description": "

An optional tuple of args to pass to the callback.

\n", - "default": null - }, - { - "name": "kwargs", - "type_name": "dict", - "is_optional": false, - "description": "

An optional dict of kwargs to pass to the callback.

\n", - "default": null - } - ], - "returns": [ - { - "type_name": "str or None", - "is_generator": false, - "description": "

The current (non-empty) value of the text input widget on the last\nrun of the app, None otherwise.

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/chat.py#L214" - }, - "streamlit.chat_message": { - "name": "chat_message", - "signature": "st.chat_message(name, *, avatar=None)", - "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\nimport numpy as np\n\nwith st.chat_message("user"):\n    st.write("Hello \ud83d\udc4b")\n    st.line_chart(np.random.randn(30, 3))\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\nmessage = st.chat_message("assistant")\nmessage.write("Hello human")\nmessage.bar_chart(np.random.randn(30, 3))\n
\n\n \n
\n", - "description": "

Insert a chat message container.

\n

To add elements to the returned container, you can use with notation\n(preferred) or just call methods directly on the returned object. See the\nexamples below.

\n", - "args": [ - { - "name": "name", - "type_name": "\"user\", \"assistant\", \"ai\", \"human\", or str", - "is_optional": false, - "description": "

The name of the message author. Can be "human"/"user" or\n"ai"/"assistant" to enable preset styling and avatars.

\n

Currently, the name is not shown in the UI but is only set as an\naccessibility label. For accessibility reasons, you should not use\nan empty string.

\n", - "default": null - }, - { - "name": "avatar", - "type_name": "str, numpy.ndarray, or BytesIO", - "is_optional": false, - "description": "

The avatar shown next to the message. Can be one of:

\n\n

If None (default), uses default icons if name is "user",\n"assistant", "ai", "human" or the first letter of the name value.

\n", - "default": "icons" - } - ], - "returns": [ - { - "type_name": "Container", - "is_generator": false, - "description": "

A single container that can hold multiple elements.

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/chat.py#L121" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/markdown.py#L189" }, "streamlit.checkbox": { "name": "checkbox", - "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n
\n", - "description": "

Display a checkbox widget.

\n", + "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\nagree = st.checkbox('I agree')\n\nif agree:\n     st.write('Great!')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a checkbox widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this checkbox is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this checkbox is for.

\n", "default": null }, { @@ -746,13 +511,6 @@ "is_optional": false, "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" } ], "returns": [ @@ -763,13 +521,13 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/checkbox.py#L53" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/checkbox.py#L36" }, "streamlit.code": { "name": "code", - "signature": "st.code(body, language=\"python\", line_numbers=False)", - "example": "
\n
\nimport streamlit as st\n\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", - "description": "

Display a code block with optional syntax highlighting.

\n", + "signature": "st.code(body, language=\"python\")", + "example": "
\n
\ncode = '''def hello():\n     print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", + "description": "

Display a code block with optional syntax highlighting.

\n

(This is a convenience wrapper around st.markdown())

\n", "args": [ { "name": "body", @@ -780,33 +538,26 @@ }, { "name": "language", - "type_name": "str or None", - "is_optional": false, - "description": "

The language that the code is written in, for syntax highlighting.\nIf None, the code will be unstyled. Defaults to "python".

\n

For a list of available language values, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", - "default": "s" - }, - { - "name": "line_numbers", - "type_name": "bool", + "type_name": "str", "is_optional": false, - "description": "

An optional boolean indicating whether to show line numbers to the\nleft of the code block. Defaults to False.

\n", - "default": "s" + "description": "

The language that the code is written in, for syntax highlighting.\nIf omitted, the code will be unstyled.

\n", + "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/code.py#L27" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/markdown.py#L132" }, "streamlit.color_picker": { "name": "color_picker", - "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n
\n", - "description": "

Display a color picker widget.

\n", + "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a color picker widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this input is for.

\n", "default": null }, { @@ -857,13 +608,6 @@ "is_optional": false, "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" } ], "returns": [ @@ -874,27 +618,27 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/color_picker.py#L53" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/color_picker.py#L35" }, "streamlit.columns": { "name": "columns", "signature": "st.columns(spec, *, gap=\"small\")", - "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n
\n", - "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n    st.header("A cat")\n    st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n    st.header("A dog")\n    st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n    st.header("An owl")\n    st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put columns inside another column.

\n
\n", "args": [ { "name": "spec", - "type_name": "int or iterable of numbers", + "type_name": "int or list of numbers", "is_optional": false, - "description": "

Controls the number and width of columns to insert. Can be one of:

\n\n", + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", "default": null }, { "name": "gap", - "type_name": "\"small\", \"medium\", or \"large\"", + "type_name": "string (\"small\", \"medium\", or \"large\")", "is_optional": false, - "description": "

The size of the gap between the columns. Defaults to "small". This\nargument can only be supplied by keyword.

\n", - "default": "s" + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" } ], "returns": [ @@ -905,227 +649,91 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/layouts.py#L79" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/layouts.py#L72" }, "streamlit.container": { "name": "container", "signature": "st.container()", - "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n
\n", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.container():\n    st.write("This is inside the container")\n\n    # You can call any Streamlit command, including custom components:\n    st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/layouts.py#L31" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/layouts.py#L28" }, - "streamlit.data_editor": { - "name": "data_editor", - "signature": "st.data_editor(data, *, width=None, height=None, use_container_width=False, hide_index=None, column_order=None, column_config=None, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", - "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

Or you can customize the data editor via column_config, hide_index, column_order, or disabled:

\n
\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    [\n        {"command": "st.selectbox", "rating": 4, "is_widget": True},\n        {"command": "st.balloons", "rating": 5, "is_widget": False},\n        {"command": "st.time_input", "rating": 3, "is_widget": True},\n    ]\n)\nedited_df = st.data_editor(\n    df,\n    column_config={\n        "command": "Streamlit Command",\n        "rating": st.column_config.NumberColumn(\n            "Your rating",\n            help="How much do you like this command (1-5)?",\n            min_value=1,\n            max_value=5,\n            step=1,\n            format="%d \u2b50",\n        ),\n        "is_widget": "Widget ?",\n    },\n    disabled=["command", "is_widget"],\n    hide_index=True,\n)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n
\n", - "description": "

Display a data editor widget.

\n

The data editor widget allows you to edit dataframes and many other data structures in a table-like UI.

\n
\n

Warning

\n

When going from st.experimental_data_editor to st.data_editor in\n1.23.0, the data editor's representation in st.session_state was changed.\nThe edited_cells dictionary is now called edited_rows and uses a\ndifferent format ({0: {"column name": "edited value"}} instead of\n{"0:1": "edited value"}). You may need to adjust the code if your app uses\nst.experimental_data_editor in combination with st.session_state."

\n
\n", + "streamlit.dataframe": { + "name": "dataframe", + "signature": "st.dataframe(data=None, width=None, height=None)", + "examples": "
\n
\ndf = pd.DataFrame(\n    np.random.randn(50, 20),\n    columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\nst.dataframe(df, 200, 100)\n
\n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\ndf = pd.DataFrame(\n    np.random.randn(10, 20),\n    columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a dataframe as an interactive table.", "args": [ { "name": "data", - "type_name": "pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", "is_optional": false, - "description": "

The data to edit in the data editor.

\n
\n

Note

\n\n
\n", + "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderyling DataFrame. Streamlit supports custom cell\nvalues and colors. (It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.)\nStyler support is experimental!\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null }, { "name": "width", "type_name": "int or None", "is_optional": false, - "description": "

Desired width of the data editor expressed in pixels. If None, the width will\nbe automatically determined.

\n", - "default": null + "description": "

Desired width of the UI element expressed in pixels. If None, a\ndefault width based on the page width is used.

\n", + "default": "width" }, { "name": "height", "type_name": "int or None", "is_optional": false, - "description": "

Desired height of the data editor expressed in pixels. If None, the height will\nbe automatically determined.

\n", - "default": null - }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "

If True, set the data editor width to the width of the parent container.\nThis takes precedence over the width argument. Defaults to False.

\n", - "default": "False." - }, + "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/dataframe_selector.py#L37" + }, + "streamlit.date_input": { + "name": "date_input", + "signature": "st.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\nd = st.date_input(\n     "When's your birthday",\n     datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a date input widget.", + "args": [ { - "name": "hide_index", - "type_name": "bool or None", + "name": "label", + "type_name": "str", "is_optional": false, - "description": "

Whether to hide the index column(s). If None (default), the visibility of\nindex columns is automatically determined based on the data.

\n", + "description": "

A short label explaining to the user what this date input is for.

\n", "default": null }, { - "name": "column_order", - "type_name": "iterable of str or None", + "name": "value", + "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", "is_optional": false, - "description": "

Specifies the display order of columns. This also affects which columns are\nvisible. For example, column_order=("col2", "col1") will display 'col2'\nfirst, followed by 'col1', and will hide all other non-index columns. If\nNone (default), the order is inherited from the original data structure.

\n", - "default": null + "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", + "default": "today" }, { - "name": "column_config", - "type_name": "dict or None", + "name": "min_value", + "type_name": "datetime.date or datetime.datetime", "is_optional": false, - "description": "

Configures how columns are displayed, e.g. their title, visibility, type, or\nformat, as well as editing properties such as min/max value or step.\nThis needs to be a dictionary where each key is a column name and the value\nis one of:

\n\n

To configure the index column(s), use _index as the column name.

\n", - "default": null + "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", + "default": "value" }, { - "name": "num_rows", - "type_name": "\"fixed\" or \"dynamic\"", + "name": "max_value", + "type_name": "datetime.date or datetime.datetime", "is_optional": false, - "description": "

Specifies if the user can add and delete rows in the data editor.\nIf "fixed", the user cannot add or delete rows. If "dynamic", the user can\nadd and delete rows in the data editor, but column sorting is disabled.\nDefaults to "fixed".

\n", - "default": "s" + "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", + "default": "value" }, { - "name": "disabled", - "type_name": "bool or iterable of str", + "name": "key", + "type_name": "str or int", "is_optional": false, - "description": "

Controls the editing of columns. If True, editing is disabled for all columns.\nIf an iterable of column names is provided (e.g., disabled=("col1", "col2")),\nonly the specified columns will be disabled for editing. If False (default),\nall columns that support editing are editable.

\n", + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", "default": null }, { - "name": "key", - "type_name": "str", - "is_optional": false, - "description": "

An optional string to use as the unique key for this widget. If this\nis omitted, a key will be generated for the widget based on its\ncontent. Multiple widgets of the same type may not share the same\nkey.

\n", - "default": null - }, - { - "name": "on_change", - "type_name": "callable", - "is_optional": false, - "description": "

An optional callback invoked when this data_editor's value changes.

\n", - "default": null - }, - { - "name": "args", - "type_name": "tuple", - "is_optional": false, - "description": "

An optional tuple of args to pass to the callback.

\n", - "default": null - }, - { - "name": "kwargs", - "type_name": "dict", - "is_optional": false, - "description": "

An optional dict of kwargs to pass to the callback.

\n", - "default": null - } - ], - "returns": [ - { - "type_name": "pandas.DataFrame, pandas.Series, pyarrow.Table, numpy.ndarray, list, set, tuple, or dict.", - "is_generator": false, - "description": "

The edited data. The edited data is returned in its original data type if\nit corresponds to any of the supported return types. All other data types\nare returned as a pd.DataFrame.

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/data_editor.py#L529" - }, - "streamlit.dataframe": { - "name": "dataframe", - "signature": "st.dataframe(data=None, width=None, height=None, *, use_container_width=False, hide_index=None, column_order=None, column_config=None)", - "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n

Or you can customize the dataframe via column_config, hide_index, or column_order:

\n
\nimport random\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    {\n        "name": ["Roadmap", "Extras", "Issues"],\n        "url": ["https://roadmap.streamlit.app", "https://extras.streamlit.app", "https://issues.streamlit.app"],\n        "stars": [random.randint(0, 1000) for _ in range(3)],\n        "views_history": [[random.randint(0, 5000) for _ in range(30)] for _ in range(3)],\n    }\n)\nst.dataframe(\n    df,\n    column_config={\n        "name": "App name",\n        "stars": st.column_config.NumberColumn(\n            "Github Stars",\n            help="Number of stars on GitHub",\n            format="%d \u2b50",\n        ),\n        "url": st.column_config.LinkColumn("App URL"),\n        "views_history": st.column_config.LineChartColumn(\n            "Views (past 30 days)", y_min=0, y_max=5000\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Display a dataframe as an interactive table.

\n

This command works with dataframes from Pandas, PyArrow, Snowpark, and PySpark.\nIt can also display several other types that can be converted to dataframes,\ne.g. numpy arrays, lists, sets and dictionaries.

\n", - "args": [ - { - "name": "data", - "type_name": "pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", - "is_optional": false, - "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.

\n", - "default": null - }, - { - "name": "width", - "type_name": "int or None", - "is_optional": false, - "description": "

Desired width of the dataframe expressed in pixels. If None, the width\nwill be automatically calculated based on the column content.

\n", - "default": null - }, - { - "name": "height", - "type_name": "int or None", - "is_optional": false, - "description": "

Desired height of the dataframe expressed in pixels. If None, a\ndefault height is used.

\n", - "default": "height" - }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "

If True, set the dataframe width to the width of the parent container.\nThis takes precedence over the width argument.\nThis argument can only be supplied by keyword.

\n", - "default": null - }, - { - "name": "hide_index", - "type_name": "bool or None", - "is_optional": false, - "description": "

Whether to hide the index column(s). If None (default), the visibility of\nindex columns is automatically determined based on the data.

\n", - "default": null - }, - { - "name": "column_order", - "type_name": "iterable of str or None", - "is_optional": false, - "description": "

Specifies the display order of columns. This also affects which columns are\nvisible. For example, column_order=("col2", "col1") will display 'col2'\nfirst, followed by 'col1', and will hide all other non-index columns. If\nNone (default), the order is inherited from the original data structure.

\n", - "default": null - }, - { - "name": "column_config", - "type_name": "dict or None", - "is_optional": false, - "description": "

Configures how columns are displayed, e.g. their title, visibility, type, or\nformat. This needs to be a dictionary where each key is a column name and\nthe value is one of:

\n\n

To configure the index column(s), use _index as the column name.

\n", - "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L44" - }, - "streamlit.date_input": { - "name": "date_input", - "signature": "st.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, format=\"YYYY/MM/DD\", disabled=False, label_visibility=\"visible\")", - "examples": "
\n
\nimport datetime\nimport streamlit as st\n\nd = st.date_input("When's your birthday", datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n
\nimport datetime\nimport streamlit as st\n\ntoday = datetime.datetime.now()\nnext_year = today.year + 1\njan_1 = datetime.date(next_year, 1, 1)\ndec_31 = datetime.date(next_year, 12, 31)\n\nd = st.date_input(\n    "Select your vacation for next year",\n    (jan_1, datetime.date(next_year, 1, 7)),\n    jan_1,\n    dec_31,\n    format="MM.DD.YYYY",\n)\nd\n
\n\n \n
\n", - "description": "

Display a date input widget.

\n", - "args": [ - { - "name": "label", - "type_name": "str", - "is_optional": false, - "description": "

A short label explaining to the user what this date input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", - "default": null - }, - { - "name": "value", - "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", - "is_optional": false, - "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", - "default": "today" - }, - { - "name": "min_value", - "type_name": "datetime.date or datetime.datetime", - "is_optional": false, - "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", - "default": "value" - }, - { - "name": "max_value", - "type_name": "datetime.date or datetime.datetime", - "is_optional": false, - "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", - "default": "value" - }, - { - "name": "key", - "type_name": "str or int", - "is_optional": false, - "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", - "default": null - }, - { - "name": "help", + "name": "help", "type_name": "str", "is_optional": false, "description": "

An optional tooltip that gets displayed next to the input.

\n", @@ -1152,26 +760,12 @@ "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, - { - "name": "format", - "type_name": "str", - "is_optional": false, - "description": "

A format string controlling how the interface should display dates.\nSupports \u201cYYYY/MM/DD\u201d (default), \u201cDD/MM/YYYY\u201d, or \u201cMM/DD/YYYY\u201d.\nYou may also use a period (.) or hyphen (-) as separators.

\n", - "default": null - }, { "name": "disabled", "type_name": "bool", "is_optional": false, "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" } ], "returns": [ @@ -1182,28 +776,19 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/time_widgets.py#L415" - }, - "streamlit.divider": { - "name": "divider", - "signature": "st.divider()", - "example": "
\n
\nimport streamlit as st\n\nst.divider()\n
\n
\n", - "description": "

Display a horizontal rule.

\n
\n

Note

\n

You can achieve the same effect with st.write("---") or\neven just "---" in your script (via magic).

\n
\n", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/markdown.py#L258" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/time_widgets.py#L305" }, "streamlit.download_button": { "name": "download_button", - "signature": "st.download_button(label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", - "examples": "
\n

Download a large DataFrame as a CSV:

\n
\nimport streamlit as st\n\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\nimport streamlit as st\n\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nimport streamlit as st\n\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nimport streamlit as st\n\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n
\n", + "signature": "st.download_button(label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False)", + "examples": "
\n

Download a large DataFrame as a CSV:

\n
\n@st.cache\n def convert_df(df):\n     # IMPORTANT: Cache the conversion to prevent computation on every rerun\n     return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n     label="Download data as CSV",\n     data=csv,\n     file_name='large_df.csv',\n     mime='text/csv',\n )\n
\n

Download a string as a file:

\n
\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nwith open("flower.png", "rb") as file:\n     btn = st.download_button(\n             label="Download image",\n             data=file,\n             file_name="flower.png",\n             mime="image/png"\n           )\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "description": "

A short label explaining to the user what this button is for.

\n", "default": null }, { @@ -1262,26 +847,12 @@ "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, - { - "name": "type", - "type_name": "\"secondary\" or \"primary\"", - "is_optional": false, - "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", - "default": "s" - }, { "name": "disabled", "type_name": "bool", "is_optional": false, "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", "default": "False." - }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", - "default": null } ], "returns": [ @@ -1292,13 +863,13 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/button.py#L170" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/button.py#L118" }, "streamlit.echo": { "name": "echo", "signature": "st.echo(code_location=\"above\")", - "example": "
\n
\nimport streamlit as st\n\nwith st.echo():\n    st.write('This code will be printed')\n
\n
\n", - "description": "

Use in a with block to draw some code on the app, then execute it.

\n", + "example": "
\n
\nwith st.echo():\n    st.write('This code will be printed')\n
\n
\n", + "description": "Use in a `with` block to draw some code on the app, then execute it.", "args": [ { "name": "code_location", @@ -1309,22 +880,22 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/echo.py#L28" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/echo.py#L25" }, "streamlit.empty": { "name": "empty", "signature": "st.empty()", - "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport streamlit as st\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nimport streamlit as st\n\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", + "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport time\n\nwith st.empty():\n     for seconds in range(60):\n         st.write(f"\u23f3 {seconds} seconds have passed")\n         time.sleep(1)\n     st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n     st.write("This is one element")\n     st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/empty.py#L24" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/empty.py#L24" }, "streamlit.error": { "name": "error", - "signature": "st.error(body, *, icon=None)", - "example": "
\n
\nimport streamlit as st\n\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", - "description": "

Display error message.

\n", + "signature": "st.error(body)", + "example": "
\n
\nst.error('This is an error')\n
\n
\n", + "description": "Display error message.", "args": [ { "name": "body", @@ -1332,23 +903,16 @@ "is_optional": false, "description": "

The error text to display.

\n", "default": null - }, - { - "name": "icon", - "type_name": "str or None", - "is_optional": false, - "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", - "default": "None" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/alert.py#L27" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/alert.py#L26" }, "streamlit.exception": { "name": "exception", "signature": "st.exception(exception)", - "example": "
\n
\nimport streamlit as st\n\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", - "description": "

Display an exception.

\n", + "example": "
\n
\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", + "description": "Display an exception.", "args": [ { "name": "exception", @@ -1359,19 +923,19 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/exception.py#L50" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/exception.py#L46" }, "streamlit.expander": { "name": "expander", "signature": "st.expander(label, expanded=False)", - "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n
\n", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n     st.write("""\n         The chart above shows some numbers I picked for you.\n         I rolled actual dice for these, so they're *guaranteed* to\n         be random.\n     """)\n     st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write("""\n     The chart above shows some numbers I picked for you.\n     I rolled actual dice for these, so they're *guaranteed* to\n     be random.\n """)\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "description": "

A string to use as the header for the expander.

\n", "default": null }, { @@ -1383,173 +947,13 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/layouts.py#L319" - }, - "streamlit.experimental_connection": { - "name": "experimental_connection", - "signature": "st.experimental_connection(name, type=None, max_entries=None, ttl=None, **kwargs)", - "examples": "
\n

The easiest way to create a first-party (SQL or Snowpark) connection is to use their\ndefault names and define corresponding sections in your secrets.toml file.

\n
\nimport streamlit as st\nconn = st.experimental_connection("sql") # Config section defined in [connections.sql] in secrets.toml.\n
\n

Creating a SQLConnection with a custom name requires you to explicitly specify the\ntype. If type is not passed as a kwarg, it must be set in the appropriate section of\nsecrets.toml.

\n
\nimport streamlit as st\nconn1 = st.experimental_connection("my_sql_connection", type="sql") # Config section defined in [connections.my_sql_connection].\nconn2 = st.experimental_connection("my_other_sql_connection") # type must be set in [connections.my_other_sql_connection].\n
\n

Passing the full module path to the connection class that you want to use can be\nuseful, especially when working with a custom connection:

\n
\nimport streamlit as st\nconn = st.experimental_connection("my_sql_connection", type="streamlit.connections.SQLConnection")\n
\n

Finally, you can pass the connection class to use directly to this function. Doing\nso allows static type checking tools such as mypy to infer the exact return\ntype of st.experimental_connection.

\n
\nimport streamlit as st\nfrom streamlit.connections import SQLConnection\nconn = st.experimental_connection("my_sql_connection", type=SQLConnection)\n
\n
\n", - "description": "

Create a new connection to a data store or API, or return an existing one.

\n

Config options, credentials, secrets, etc. for connections are taken from various\nsources:

\n\n", - "args": [ - { - "name": "name", - "type_name": "str", - "is_optional": false, - "description": "

The connection name used for secrets lookup in [connections.<name>].\nType will be inferred from passing "sql" or "snowpark".

\n", - "default": null - }, - { - "name": "type", - "type_name": "str, connection class, or None", - "is_optional": false, - "description": "

The type of connection to create. It can be a keyword ("sql" or "snowpark"),\na path to an importable class, or an imported class reference. All classes\nmust extend st.connections.ExperimentalBaseConnection and implement the\n_connect() method. If the type kwarg is None, a type field must be set\nin the connection's section in secrets.toml.

\n", - "default": null - }, - { - "name": "max_entries", - "type_name": "int or None", - "is_optional": false, - "description": "

The maximum number of connections to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", - "default": "None." - }, - { - "name": "ttl", - "type_name": "float, timedelta, or None", - "is_optional": false, - "description": "

The maximum number of seconds to keep results in the cache, or\nNone if cached results should not expire. The default is None.

\n", - "default": "None." - }, - { - "name": "**kwargs", - "type_name": "any", - "is_optional": false, - "description": "

Additional connection specific kwargs that are passed to the Connection's\n_connect() method. Learn more from the specific Connection's documentation.

\n", - "default": null - } - ], - "returns": [ - { - "type_name": "Connection object", - "is_generator": false, - "description": "

An initialized Connection object of the specified type.

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/runtime/connection_factory.py#L170" - }, - "streamlit.experimental_data_editor": { - "name": "experimental_data_editor", - "signature": "st.experimental_data_editor(data, *, width=None, height=None, use_container_width=False, hide_index=None, column_order=None, column_config=None, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", - "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

Or you can customize the data editor via column_config, hide_index, column_order, or disabled:

\n
\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    [\n        {"command": "st.selectbox", "rating": 4, "is_widget": True},\n        {"command": "st.balloons", "rating": 5, "is_widget": False},\n        {"command": "st.time_input", "rating": 3, "is_widget": True},\n    ]\n)\nedited_df = st.data_editor(\n    df,\n    column_config={\n        "command": "Streamlit Command",\n        "rating": st.column_config.NumberColumn(\n            "Your rating",\n            help="How much do you like this command (1-5)?",\n            min_value=1,\n            max_value=5,\n            step=1,\n            format="%d \u2b50",\n        ),\n        "is_widget": "Widget ?",\n    },\n    disabled=["command", "is_widget"],\n    hide_index=True,\n)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n
\n", - "description": "

Display a data editor widget.

\n

The data editor widget allows you to edit dataframes and many other data structures in a table-like UI.

\n
\n

Warning

\n

When going from st.experimental_data_editor to st.data_editor in\n1.23.0, the data editor's representation in st.session_state was changed.\nThe edited_cells dictionary is now called edited_rows and uses a\ndifferent format ({0: {"column name": "edited value"}} instead of\n{"0:1": "edited value"}). You may need to adjust the code if your app uses\nst.experimental_data_editor in combination with st.session_state."

\n
\n", - "args": [ - { - "name": "data", - "type_name": "pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None", - "is_optional": false, - "description": "

The data to edit in the data editor.

\n
\n

Note

\n\n
\n", - "default": null - }, - { - "name": "width", - "type_name": "int or None", - "is_optional": false, - "description": "

Desired width of the data editor expressed in pixels. If None, the width will\nbe automatically determined.

\n", - "default": null - }, - { - "name": "height", - "type_name": "int or None", - "is_optional": false, - "description": "

Desired height of the data editor expressed in pixels. If None, the height will\nbe automatically determined.

\n", - "default": null - }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "

If True, set the data editor width to the width of the parent container.\nThis takes precedence over the width argument. Defaults to False.

\n", - "default": "False." - }, - { - "name": "hide_index", - "type_name": "bool or None", - "is_optional": false, - "description": "

Whether to hide the index column(s). If None (default), the visibility of\nindex columns is automatically determined based on the data.

\n", - "default": null - }, - { - "name": "column_order", - "type_name": "iterable of str or None", - "is_optional": false, - "description": "

Specifies the display order of columns. This also affects which columns are\nvisible. For example, column_order=("col2", "col1") will display 'col2'\nfirst, followed by 'col1', and will hide all other non-index columns. If\nNone (default), the order is inherited from the original data structure.

\n", - "default": null - }, - { - "name": "column_config", - "type_name": "dict or None", - "is_optional": false, - "description": "

Configures how columns are displayed, e.g. their title, visibility, type, or\nformat, as well as editing properties such as min/max value or step.\nThis needs to be a dictionary where each key is a column name and the value\nis one of:

\n\n

To configure the index column(s), use _index as the column name.

\n", - "default": null - }, - { - "name": "num_rows", - "type_name": "\"fixed\" or \"dynamic\"", - "is_optional": false, - "description": "

Specifies if the user can add and delete rows in the data editor.\nIf "fixed", the user cannot add or delete rows. If "dynamic", the user can\nadd and delete rows in the data editor, but column sorting is disabled.\nDefaults to "fixed".

\n", - "default": "s" - }, - { - "name": "disabled", - "type_name": "bool or iterable of str", - "is_optional": false, - "description": "

Controls the editing of columns. If True, editing is disabled for all columns.\nIf an iterable of column names is provided (e.g., disabled=("col1", "col2")),\nonly the specified columns will be disabled for editing. If False (default),\nall columns that support editing are editable.

\n", - "default": null - }, - { - "name": "key", - "type_name": "str", - "is_optional": false, - "description": "

An optional string to use as the unique key for this widget. If this\nis omitted, a key will be generated for the widget based on its\ncontent. Multiple widgets of the same type may not share the same\nkey.

\n", - "default": null - }, - { - "name": "on_change", - "type_name": "callable", - "is_optional": false, - "description": "

An optional callback invoked when this data_editor's value changes.

\n", - "default": null - }, - { - "name": "args", - "type_name": "tuple", - "is_optional": false, - "description": "

An optional tuple of args to pass to the callback.

\n", - "default": null - }, - { - "name": "kwargs", - "type_name": "dict", - "is_optional": false, - "description": "

An optional dict of kwargs to pass to the callback.

\n", - "default": null - } - ], - "returns": [ - { - "type_name": "pandas.DataFrame, pandas.Series, pyarrow.Table, numpy.ndarray, list, set, tuple, or dict.", - "is_generator": false, - "description": "

The edited data. The edited data is returned in its original data type if\nit corresponds to any of the supported return types. All other data types\nare returned as a pd.DataFrame.

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/data_editor.py#L529" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/layouts.py#L283" }, "streamlit.experimental_get_query_params": { "name": "experimental_get_query_params", "signature": "st.experimental_get_query_params()", - "example": "
\n

Let's say the user's web browser is at\nhttp://localhost:8501/?show_map=True&selected=asia&selected=america.\nThen, you can get the query parameters using the following:

\n
\nimport streamlit as st\n\nst.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\n

Note that the values in the returned dict are always lists. This is\nbecause we internally use Python's urllib.parse.parse_qs(), which behaves\nthis way. And this behavior makes sense when you consider that every item\nin a query string is potentially a 1-element array.

\n
\n", - "description": "

Return the query parameters that is currently showing in the browser's URL bar.

\n", + "example": "
\n

Let's say the user's web browser is at\nhttp://localhost:8501/?show_map=True&selected=asia&selected=america.\nThen, you can get the query parameters using the following:

\n
\nst.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\n

Note that the values in the returned dict are always lists. This is\nbecause we internally use Python's urllib.parse.parse_qs(), which behaves\nthis way. And this behavior makes sense when you consider that every item\nin a query string is potentially a 1-element array.

\n
\n", + "description": "Return the query parameters that is currently showing in the browser's URL bar.", "args": [], "returns": [ { @@ -1559,66 +963,59 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/commands/query_params.py#L29" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/__init__.py#L331" }, "streamlit.experimental_memo": { "name": "experimental_memo", - "signature": "st.experimental_memo(func=None, *, ttl, max_entries, show_spinner, persist, experimental_allow_widgets, hash_funcs=None)", - "example": "
\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\nimport streamlit as st\n\n@st.cache_data(persist="disk")\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

By default, all parameters to a cached function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nconnection = make_database_connection()\nd1 = fetch_and_clean_data(connection, num_rows=10)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nanother_connection = make_database_connection()\nd2 = fetch_and_clean_data(another_connection, num_rows=10)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _database_connection parameter was different\n# in both calls.\n
\n

A cached function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nfetch_and_clean_data.clear()\n# Clear all cached entries for this function.\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. datetime.datetime) to a hash\nfunction (lambda dt: dt.isoformat()) like this:

\n
\nimport streamlit as st\nimport datetime\n\n@st.cache_data(hash_funcs={datetime.datetime: lambda dt: dt.isoformat()})\ndef convert_to_utc(dt: datetime.datetime):\n    return dt.astimezone(datetime.timezone.utc)\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "datetime.datetime") to the hash function instead:

\n
\nimport streamlit as st\nimport datetime\n\n@st.cache_data(hash_funcs={"datetime.datetime": lambda dt: dt.isoformat()})\ndef convert_to_utc(dt: datetime.datetime):\n    return dt.astimezone(datetime.timezone.utc)\n
\n
\n", - "description": "

Decorator to cache functions that return data (e.g. dataframe transforms, database queries, ML inference).

\n

Cached objects are stored in "pickled" form, which means that the return\nvalue of a cached function must be pickleable. Each caller of the cached\nfunction gets its own copy of the cached data.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_data.clear().

\n

To cache global resources, use st.cache_resource instead. Learn more\nabout caching at https://docs.streamlit.io/library/advanced-features/caching.

\n", + "signature": "st.experimental_memo(func=None, *, persist=None, show_spinner=True, suppress_st_warning=False, max_entries=None, ttl=None)", + "example": "
\n
\n@st.experimental_memo\n def fetch_and_clean_data(url):\n     # Fetch data from URL here, and then clean it up.\n     return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\n@st.experimental_memo(persist="disk")\n def fetch_and_clean_data(url):\n     # Fetch data from URL here, and then clean it up.\n     return data\n
\n

By default, all parameters to a memoized function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\n@st.experimental_memo\n def fetch_and_clean_data(_db_connection, num_rows):\n     # Fetch data from _db_connection here, and then clean it up.\n     return data\n\nconnection = make_database_connection()\nd1 = fetch_and_clean_data(connection, num_rows=10)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nanother_connection = make_database_connection()\nd2 = fetch_and_clean_data(another_connection, num_rows=10)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _database_connection parameter was different\n# in both calls.\n
\n

A memoized function's cache can be procedurally cleared:

\n
\n@st.experimental_memo\n def fetch_and_clean_data(_db_connection, num_rows):\n     # Fetch data from _db_connection here, and then clean it up.\n     return data\n\nfetch_and_clean_data.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Function decorator to memoize function executions.

\n

Memoized data is stored in "pickled" form, which means that the return\nvalue of a memoized function must be pickleable.

\n

Each caller of a memoized function gets its own copy of the cached data.

\n

You can clear a memoized function's cache with f.clear().

\n", "args": [ { "name": "func", "type_name": "callable", "is_optional": false, - "description": "

The function to cache. Streamlit hashes the function's source code.

\n", + "description": "

The function to memoize. Streamlit hashes the function's source code.

\n", "default": null }, { - "name": "ttl", - "type_name": "float, timedelta, str, or None", + "name": "persist", + "type_name": "str or None", "is_optional": false, - "description": "

The maximum time to keep an entry in the cache. Can be one of:

\n\n

Note that ttl will be ignored if persist="disk" or persist=True.

\n", + "description": "

Optional location to persist cached data to. Currently, the only\nvalid value is "disk", which will persist to the local disk.

\n", "default": null }, - { - "name": "max_entries", - "type_name": "int or None", - "is_optional": false, - "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. When a new entry is added to a full cache,\nthe oldest cached entry will be removed. Defaults to None.

\n", - "default": "None." - }, { "name": "show_spinner", - "type_name": "boolean or string", + "type_name": "boolean", "is_optional": false, - "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached data is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "description": "

Enable the spinner. Default is True to show a spinner when there is\na cache miss.

\n", "default": "True" }, { - "name": "persist", - "type_name": "\"disk\", boolean, or None", + "name": "suppress_st_warning", + "type_name": "boolean", "is_optional": false, - "description": "

Optional location to persist cached data to. Passing "disk" (or True)\nwill persist the cached data to the local disk. None (or False) will disable\npersistence. The default is None.

\n", - "default": "None." + "description": "

Suppress warnings about calling Streamlit functions from within\nthe cached function.

\n", + "default": null }, { - "name": "experimental_allow_widgets", - "type_name": "boolean", + "name": "max_entries", + "type_name": "int or None", "is_optional": false, - "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", - "default": "False." + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." }, { - "name": "hash_funcs", - "type_name": "dict or None", + "name": "ttl", + "type_name": "float or None", "is_optional": false, - "description": "

Mapping of types or fully qualified names to hash functions.\nThis is used to override the behavior of the hasher inside Streamlit's\ncaching mechanism: when the hasher encounters an object, it will first\ncheck to see if its type matches a key in this dict and, if so, will use\nthe provided function to generate a hash for it. See below for an example\nof how this can be used.

\n", - "default": null + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.

\n", + "default": "None." } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/runtime/caching/cache_data_api.py#L384" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/caching/memo_decorator.py#L218" }, "streamlit.experimental_rerun": { "name": "experimental_rerun", @@ -1626,13 +1023,13 @@ "description": "

Rerun the script immediately.

\n

When st.experimental_rerun() is called, the script is halted - no\nmore statements will be run, and the script will be queued to re-run\nfrom the top.

\n

If this function is called outside of Streamlit, it will raise an\nException.

\n", "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/commands/execution_control.py#L47" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/__init__.py#L512" }, "streamlit.experimental_set_query_params": { "name": "experimental_set_query_params", "signature": "st.experimental_set_query_params(**query_params)", - "example": "
\n

To point the user's web browser to something like\n"http://localhost:8501/?show_map=True&selected=asia&selected=america",\nyou would do the following:

\n
\nimport streamlit as st\n\nst.experimental_set_query_params(\n    show_map=True,\n    selected=["asia", "america"],\n)\n
\n
\n", - "description": "

Set the query parameters that are shown in the browser's URL bar.

\n
\n

Warning

\n

Query param embed cannot be set using this method.

\n
\n", + "example": "
\n

To point the user's web browser to something like\n"http://localhost:8501/?show_map=True&selected=asia&selected=america",\nyou would do the following:

\n
\nst.experimental_set_query_params(\n     show_map=True,\n     selected=["asia", "america"],\n )\n
\n
\n", + "description": "Set the query parameters that are shown in the browser's URL bar.", "args": [ { "name": "**query_params", @@ -1643,78 +1040,68 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/commands/query_params.py#L65" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/__init__.py#L361" + }, + "streamlit.experimental_show": { + "name": "experimental_show", + "signature": "st.experimental_show(*args)", + "notes": "
\n

This is an experimental feature with usage limitations:

\n\n
\n", + "example": "
\n
\ndataframe = pd.DataFrame({\n     'first column': [1, 2, 3, 4],\n     'second column': [10, 20, 30, 40],\n })\nst.experimental_show(dataframe)\n
\n
\n", + "description": "

Write arguments and argument names to your app for debugging purposes.

\n

Show() has similar properties to write():

\n
\n
    \n
  1. You can pass in multiple arguments, all of which will be debugged.
  2. \n
  3. It returns None, so it's "slot" in the app cannot be reused.
  4. \n
\n
\n

Note: This is an experimental feature. See\nhttps://docs.streamlit.io/library/advanced-features/prerelease#experimental for more information.

\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to debug in the App.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/__init__.py#L251" }, "streamlit.experimental_singleton": { "name": "experimental_singleton", - "signature": "st.experimental_singleton(func, *, ttl, max_entries, show_spinner, validate, experimental_allow_widgets, hash_funcs=None)", - "example": "
\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(url):\n    # Create a database session object that points to the URL.\n    return session\n\ns1 = get_database_session(SESSION_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(SESSION_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the connection object in s1 is the same as in s2.\n\ns3 = get_database_session(SESSION_URL_2)\n# This is a different URL, so the function executes.\n
\n

By default, all parameters to a cache_resource function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\ns1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _sessionmaker parameter was different\n# in both calls.\n
\n

A cache_resource function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\nget_database_session.clear()\n# Clear all cached entries for this function.\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. Person) to a hash\nfunction (str) like this:

\n
\nimport streamlit as st\nfrom pydantic import BaseModel\n\nclass Person(BaseModel):\n    name: str\n\n@st.cache_resource(hash_funcs={Person: str})\ndef get_person_name(person: Person):\n    return person.name\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "__main__.Person") to the hash function instead:

\n
\nimport streamlit as st\nfrom pydantic import BaseModel\n\nclass Person(BaseModel):\n    name: str\n\n@st.cache_resource(hash_funcs={"__main__.Person": str})\ndef get_person_name(person: Person):\n    return person.name\n
\n
\n", - "description": "

Decorator to cache functions that return global resources (e.g. database connections, ML models).

\n

Cached objects are shared across all users, sessions, and reruns. They\nmust be thread-safe because they can be accessed from multiple threads\nconcurrently. If thread safety is an issue, consider using st.session_state\nto store resources per session instead.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_resource.clear().

\n

To cache data, use st.cache_data instead. Learn more about caching at\nhttps://docs.streamlit.io/library/advanced-features/caching.

\n", + "signature": "st.experimental_singleton(func=None, *, show_spinner=True, suppress_st_warning=False)", + "example": "
\n
\n@st.experimental_singleton\n def get_database_session(url):\n     # Create a database session object that points to the URL.\n     return session\n\ns1 = get_database_session(SESSION_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(SESSION_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the connection object in s1 is the same as in s2.\n\ns3 = get_database_session(SESSION_URL_2)\n# This is a different URL, so the function executes.\n
\n

By default, all parameters to a singleton function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\n@st.experimental_singleton\n def get_database_session(_sessionmaker, url):\n     # Create a database connection object that points to the URL.\n     return connection\n\ns1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _sessionmaker parameter was different\n# in both calls.\n
\n

A singleton function's cache can be procedurally cleared:

\n
\n@st.experimental_singleton\n def get_database_session(_sessionmaker, url):\n     # Create a database connection object that points to the URL.\n     return connection\n\nget_database_session.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Function decorator to store singleton objects.

\n

Each singleton object is shared across all users connected to the app.\nSingleton objects must be thread-safe, because they can be accessed from\nmultiple threads concurrently.

\n

(If thread-safety is an issue, consider using st.session_state to\nstore per-session singleton objects instead.)

\n

You can clear a memoized function's cache with f.clear().

\n", "args": [ { "name": "func", "type_name": "callable", "is_optional": false, - "description": "

The function that creates the cached resource. Streamlit hashes the\nfunction's source code.

\n", - "default": null - }, - { - "name": "ttl", - "type_name": "float, timedelta, str, or None", - "is_optional": false, - "description": "

The maximum time to keep an entry in the cache. Can be one of:

\n\n

Note that ttl will be ignored if persist="disk" or persist=True.

\n", + "description": "

The function that creates the singleton. Streamlit hashes the\nfunction's source code.

\n", "default": null }, - { - "name": "max_entries", - "type_name": "int or None", - "is_optional": false, - "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. When a new entry is added to a full cache,\nthe oldest cached entry will be removed. Defaults to None.

\n", - "default": "None." - }, { "name": "show_spinner", - "type_name": "boolean or string", + "type_name": "boolean", "is_optional": false, - "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached resource is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the singleton is being created.

\n", "default": "True" }, { - "name": "validate", - "type_name": "callable or None", - "is_optional": false, - "description": "

An optional validation function for cached data. validate is called\neach time the cached value is accessed. It receives the cached value as\nits only parameter and it must return a boolean. If validate returns\nFalse, the current cached value is discarded, and the decorated function\nis called to compute a new value. This is useful e.g. to check the\nhealth of database connections.

\n", - "default": null - }, - { - "name": "experimental_allow_widgets", + "name": "suppress_st_warning", "type_name": "boolean", "is_optional": false, - "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", - "default": "False." - }, - { - "name": "hash_funcs", - "type_name": "dict or None", - "is_optional": false, - "description": "

Mapping of types or fully qualified names to hash functions.\nThis is used to override the behavior of the hasher inside Streamlit's\ncaching mechanism: when the hasher encounters an object, it will first\ncheck to see if its type matches a key in this dict and, if so, will use\nthe provided function to generate a hash for it. See below for an example\nof how this can be used.

\n", + "description": "

Suppress warnings about calling Streamlit functions from within\nthe singleton function.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/runtime/caching/cache_resource_api.py#L264" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/caching/singleton_decorator.py#L139" }, "streamlit.file_uploader": { "name": "file_uploader", - "signature": "st.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nimport streamlit as st\nimport pandas as pd\nfrom io import StringIO\n\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nimport streamlit as st\n\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n
\n", + "signature": "st.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n     # To read file as bytes:\n     bytes_data = uploaded_file.getvalue()\n     st.write(bytes_data)\n\n     # To convert to a string based IO:\n     stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n     st.write(stringio)\n\n     # To read file as string:\n     string_data = stringio.read()\n     st.write(string_data)\n\n     # Can be used wherever a "file-like" object is accepted:\n     dataframe = pd.read_csv(uploaded_file)\n     st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n     bytes_data = uploaded_file.read()\n     st.write("filename:", uploaded_file.name)\n     st.write(bytes_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this file uploader is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this file uploader is for.

\n", "default": null }, { @@ -1772,13 +1159,6 @@ "is_optional": false, "description": "

An optional boolean, which disables the file uploader if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" } ], "returns": [ @@ -1789,13 +1169,13 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/file_uploader.py#L222" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/file_uploader.py#L132" }, "streamlit.form": { "name": "form", "signature": "st.form(key, clear_on_submit=False)", - "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n\n \n
\n", - "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n\n", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.form("my_form"):\n    st.write("Inside the form")\n    slider_val = st.slider("Form slider")\n    checkbox_val = st.checkbox("Form checkbox")\n\n    # Every form must have a submit button.\n    submitted = st.form_submit_button("Submit")\n    if submitted:\n        st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n

Inserting elements out of order:

\n
\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n
\n", + "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n\n

For more information about forms, check out our\nblog post.

\n", "args": [ { "name": "key", @@ -1813,11 +1193,11 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/form.py#L118" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/form.py#L112" }, "streamlit.form_submit_button": { "name": "form_submit_button", - "signature": "st.form_submit_button(label=\"Submit\", help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "signature": "st.form_submit_button(label=\"Submit\", help=None, on_click=None, args=None, kwargs=None)", "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", "args": [ { @@ -1854,27 +1234,6 @@ "is_optional": false, "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null - }, - { - "name": "type", - "type_name": "\"secondary\" or \"primary\"", - "is_optional": false, - "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", - "default": "s" - }, - { - "name": "disabled", - "type_name": "bool", - "is_optional": false, - "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", - "default": "False." - }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", - "default": null } ], "returns": [ @@ -1885,7 +1244,7 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/form.py#L218" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/form.py#L200" }, "streamlit.get_option": { "name": "get_option", @@ -1901,13 +1260,13 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/config.py#L131" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/config.py#L90" }, "streamlit.graphviz_chart": { "name": "graphviz_chart", "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)", - "example": "
\n
\nimport streamlit as st\nimport graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n
\n", - "description": "

Display a graph using the dagre-d3 library.

\n", + "example": "
\n
\nimport streamlit as st\nimport graphviz as graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a graph using the dagre-d3 library.", "args": [ { "name": "figure_or_dot", @@ -1925,68 +1284,54 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/graphviz_chart.py#L39" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/graphviz_chart.py#L30" }, "streamlit.header": { "name": "header", - "signature": "st.header(body, anchor=None, *, help=None, divider=False)", - "examples": "
\n
\nimport streamlit as st\n\nst.header('This is a header with a divider', divider='rainbow')\nst.header('_Streamlit_ is :blue[cool] :sunglasses:')\n
\n\n \n
\n", - "description": "

Display text in header formatting.

\n", + "signature": "st.header(body, anchor=None)", + "example": "
\n
\nst.header('This is a header')\n
\n
\n", + "description": "Display text in header formatting.", "args": [ { "name": "body", "type_name": "str", "is_optional": false, - "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n\n", + "description": "

The text to display.

\n", "default": null }, { "name": "anchor", - "type_name": "str or False", + "type_name": "str", "is_optional": false, - "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", - "default": null - }, - { - "name": "help", - "type_name": "str", - "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the header.

\n", - "default": null - }, - { - "name": "divider", - "type_name": "bool or \u201cblue\u201d, \u201cgreen\u201d, \u201corange\u201d, \u201cred\u201d, \u201cviolet\u201d, \u201cgray\u201d/\"grey\", or \u201crainbow\u201d", - "is_optional": false, - "description": "

Shows a colored divider below the header. If True, successive\nheaders will cycle through divider colors. That is, the first\nheader will have a blue line, the second header will have a\ngreen line, and so on. If a string, the color can be set to one of\nthe following: blue, green, orange, red, violet, gray/grey, or\nrainbow.

\n", + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/heading.py#L41" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/markdown.py#L81" }, "streamlit.help": { "name": "help", - "signature": "st.help(obj=)", - "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nimport streamlit as st\nimport pandas\n\nst.help(pandas.DataFrame)\n
\n\n \n

Want to quickly check what data type is output by a certain function?\nTry:

\n
\nimport streamlit as st\n\nx = my_poorly_documented_function()\nst.help(x)\n
\n

Want to quickly inspect an object? No sweat:

\n
\nclass Dog:\n  '''A typical dog.'''\n\n  def __init__(self, breed, color):\n    self.breed = breed\n    self.color = color\n\n  def bark(self):\n    return 'Woof!'\n\n\nfido = Dog('poodle', 'white')\n\nst.help(fido)\n
\n\n \n

And if you're using Magic, you can get help for functions, classes,\nand modules without even typing st.help:

\n
\nimport streamlit as st\nimport pandas\n\n# Get help for Pandas read_csv:\npandas.read_csv\n\n# Get help for Streamlit itself:\nst\n
\n\n \n
\n", - "description": "

Display help and other information for a given object.

\n

Depending on the type of object that is passed in, this displays the\nobject's name, type, value, signature, docstring, and member variables,\nmethods \u2014 as well as the values/docstring of members and methods.

\n", + "signature": "st.help(obj)", + "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nst.help(pandas.DataFrame)\n
\n

Want to quickly check what datatype is output by a certain function?\nTry:

\n
\nx = my_poorly_documented_function()\nst.help(x)\n
\n
\n", + "description": "

Display object's doc string, nicely formatted.

\n

Displays the doc string for this object.

\n", "args": [ { "name": "obj", - "type_name": "any", + "type_name": "Object", "is_optional": false, - "description": "

The object whose information should be displayed. If left\nunspecified, this call will display help for Streamlit itself.

\n", + "description": "

The object whose docstring should be displayed.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/doc_string.py#L48" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/doc_string.py#L41" }, "streamlit.image": { "name": "image", "signature": "st.image(image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", - "example": "
\n
\nimport streamlit as st\nfrom PIL import Image\n\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n
\n", - "description": "

Display an image or list of images.

\n", + "example": "
\n
\nfrom PIL import Image\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an image or list of images.", "args": [ { "name": "image", @@ -2011,9 +1356,9 @@ }, { "name": "use_column_width", - "type_name": "\"auto\", \"always\", \"never\", or bool", + "type_name": "'auto' or 'always' or 'never' or bool", "is_optional": false, - "description": "

If "auto", set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf "always" or True, set the image's width to the column width.\nIf "never" or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", + "description": "

If 'auto', set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf 'always' or True, set the image's width to the column width.\nIf 'never' or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", "default": null }, { @@ -2025,27 +1370,27 @@ }, { "name": "channels", - "type_name": "\"RGB\" or \"BGR\"", + "type_name": "'RGB' or 'BGR'", "is_optional": false, - "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to "RGB", meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to "BGR", instead.

\n", + "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to 'RGB', meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to 'BGR', instead.

\n", "default": "s" }, { "name": "output_format", - "type_name": "\"JPEG\", \"PNG\", or \"auto\"", + "type_name": "'JPEG', 'PNG', or 'auto'", "is_optional": false, - "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to "auto" which identifies the compression type based\non the type and format of the image argument.

\n", + "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to 'auto' which identifies the compression type based\non the type and format of the image argument.

\n", "default": "s" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/image.py#L87" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/image.py#L60" }, "streamlit.info": { "name": "info", - "signature": "st.info(body, *, icon=None)", - "example": "
\n
\nimport streamlit as st\n\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", - "description": "

Display an informational message.

\n", + "signature": "st.info(body)", + "example": "
\n
\nst.info('This is a purely informational message')\n
\n
\n", + "description": "Display an informational message.", "args": [ { "name": "body", @@ -2053,27 +1398,20 @@ "is_optional": false, "description": "

The info text to display.

\n", "default": null - }, - { - "name": "icon", - "type_name": "str or None", - "is_optional": false, - "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", - "default": "None" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/alert.py#L91" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/alert.py#L62" }, "streamlit.json": { "name": "json", "signature": "st.json(body, *, expanded=True)", - "example": "
\n
\nimport streamlit as st\n\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n
\n", - "description": "

Display object or string as a pretty-printed JSON string.

\n", + "example": "
\n
\nst.json({\n     'foo': 'bar',\n     'baz': 'boz',\n     'stuff': [\n         'stuff 1',\n         'stuff 2',\n         'stuff 3',\n         'stuff 5',\n     ],\n })\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display object or string as a pretty-printed JSON string.", "args": [ { "name": "body", - "type_name": "object or str", + "type_name": "Object or str", "is_optional": false, "description": "

The object to print as JSON. All referenced objects should be\nserializable to JSON as well. If object is a string, we assume it\ncontains serialized JSON.

\n", "default": null @@ -2087,12 +1425,12 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/json.py#L35" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/json.py#L28" }, "streamlit.latex": { "name": "latex", - "signature": "st.latex(body, *, help=None)", - "example": "
\n
\nimport streamlit as st\n\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", + "signature": "st.latex(body)", + "example": "
\n
\nst.latex(r'''\n     a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n     \\sum_{k=0}^{n-1} ar^k =\n     a \\left(\\frac{1-r^{n}}{1-r}\\right)\n     ''')\n
\n
\n", "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", "args": [ { @@ -2101,178 +1439,108 @@ "is_optional": false, "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", "default": null - }, - { - "name": "help", - "type_name": "str", - "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the LaTeX expression.

\n", - "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/markdown.py#L210" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/markdown.py#L232" }, "streamlit.line_chart": { "name": "line_chart", - "signature": "st.line_chart(data=None, *, x=None, y=None, color=None, width=0, height=0, use_container_width=True)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\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 \n

You can also choose different columns to use for x and y, as well as set\nthe color dynamically based on a 3rd column (assuming your dataframe is in\nlong format):

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame({\n    'col1' : np.random.randn(20),\n    'col2' : np.random.randn(20),\n    'col3' : np.random.choice(['A','B','C'], 20)\n})\n\nst.line_chart(\n    chart_data,\n    x = 'col1',\n    y = 'col2',\n    color = 'col3'\n)\n
\n\n \n

Finally, if your dataframe is in wide format, you can group multiple\ncolumns under the y argument to show multiple lines with different\ncolors:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns = ['col1', 'col2', 'col3'])\n\nst.line_chart(\n    chart_data,\n    x = 'col1',\n    y = ['col2', 'col3'],\n    color = ['#FF0000', '#0000FF']  # Optional\n)\n
\n\n \n
\n", + "signature": "st.line_chart(data=None, width=0, height=0, use_container_width=True)", + "example": "
\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 \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", "args": [ { "name": "data", - "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict or None", - "is_optional": false, - "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", - "default": null - }, - { - "name": "x", - "type_name": "str or None", - "is_optional": false, - "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", - "default": null - }, - { - "name": "y", - "type_name": "str, sequence of str, or None", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict or None", "is_optional": false, - "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null }, - { - "name": "color", - "type_name": "str, tuple, sequence of str, sequence of tuple, or None", - "is_optional": false, - "description": "

The color to use for different lines in this chart. This argument\ncan only be supplied by keyword.

\n

For a line chart with just one line, this can be:

\n\n

For a line chart with multiple lines, where the dataframe is in\nlong format (that is, y is None or just one column), this can be:

\n\n

For a line chart with multiple lines, where the dataframe is in\nwide format (that is, y is a sequence of columns), this can be:

\n\n", - "default": "color." - }, { "name": "width", "type_name": "int", "is_optional": false, - "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "description": "

The chart width in pixels. If 0, selects the width automatically.

\n", "default": null }, { "name": "height", "type_name": "int", "is_optional": false, - "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "description": "

The chart height in pixels. If 0, selects the height automatically.

\n", "default": null }, { "name": "use_container_width", "type_name": "bool", "is_optional": false, - "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L231" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/dataframe_selector.py#L132" }, "streamlit.map": { "name": "map", - "signature": "st.map(data=None, *, latitude=None, longitude=None, color=None, size=None, zoom=None, use_container_width=True)", - "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n

You can also customize the size and color of the datapoints:

\n
\nst.map(df, size=20, color='#0044ff')\n
\n

And finally, you can choose different columns to use for the latitude\nand longitude components, as well as set size and color of each\ndatapoint dynamically based on other columns:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame({\n    "col1": np.random.randn(1000) / 50 + 37.76,\n    "col2": np.random.randn(1000) / 50 + -122.4,\n    "col3": np.random.randn(1000) * 100,\n    "col4": np.random.rand(1000, 4).tolist(),\n})\n\nst.map(df,\n    latitude='col1',\n    longitude='col2',\n    size='col3',\n    color='col4')\n
\n\n \n
\n", - "description": "

Display a map with a scatterplot overlaid onto it.

\n

This is a wrapper around st.pydeck_chart to quickly create\nscatterplot charts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "signature": "st.map(data=None, zoom=None, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n     np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n     columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a map with points on it.

\n

This is a wrapper around st.pydeck_chart to quickly create scatterplot\ncharts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more\ninfo on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", "args": [ { "name": "data", - "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,", "is_optional": false, - "description": "

The data to be plotted.

\n", + "description": "

or None\nThe data to be plotted. Must have columns called 'lat', 'lon',\n'latitude', or 'longitude'.

\n", "default": null }, - { - "name": "latitude", - "type_name": "str or None", - "is_optional": false, - "description": "

The name of the column containing the latitude coordinates of\nthe datapoints in the chart. This argument can only be supplied\nby keyword.

\n

If None, the latitude data will come from any column named 'lat',\n'latitude', 'LAT', or 'LATITUDE'.

\n", - "default": null - }, - { - "name": "longitude", - "type_name": "str or None", - "is_optional": false, - "description": "

The name of the column containing the longitude coordinates of\nthe datapoints in the chart. This argument can only be supplied\nby keyword.

\n

If None, the longitude data will come from any column named 'lon',\n'longitude', 'LON', or 'LONGITUDE'.

\n", - "default": null - }, - { - "name": "color", - "type_name": "str or tuple or None", - "is_optional": false, - "description": "

The color of the circles representing each datapoint. This argument\ncan only be supplied by keyword.

\n

Can be:

\n\n", - "default": "color." - }, - { - "name": "size", - "type_name": "str or float or None", - "is_optional": false, - "description": "

The size of the circles representing each point, in meters. This\nargument can only be supplied by keyword.

\n

This can be:

\n\n", - "default": "size." - }, { "name": "zoom", "type_name": "int", "is_optional": false, - "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels.\nThis argument can only be supplied by keyword.

\n", - "default": null - }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/map.py#L91" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/map.py#L31" }, "streamlit.markdown": { "name": "markdown", - "signature": "st.markdown(body, unsafe_allow_html=False, *, help=None)", - "examples": "
\n
\nimport streamlit as st\n\nst.markdown("*Streamlit* is **really** ***cool***.")\nst.markdown('''\n    :red[Streamlit] :orange[can] :green[write] :blue[text] :violet[in]\n    :gray[pretty] :rainbow[colors].''')\nst.markdown("Here's a bouquet &mdash;\\\n            :tulip::cherry_blossom::rose::hibiscus::sunflower::blossom:")\n\nmulti = '''If you end a line with two spaces,\na soft return is used for the next line.\n\nTwo (or more) newline characters in a row will result in a hard return.\n'''\nst.markdown(multi)\n
\n\n \n
\n", - "description": "

Display string formatted as Markdown.

\n", + "signature": "st.markdown(body, unsafe_allow_html=False)", + "example": "
\n
\nst.markdown('Streamlit is **_really_ cool**.')\n
\n
\n", + "description": "Display string formatted as Markdown.", "args": [ { "name": "body", "type_name": "str", "is_optional": false, - "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n\n", + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n\n", "default": null }, { "name": "unsafe_allow_html", "type_name": "bool", "is_optional": false, - "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", - "default": null - }, - { - "name": "help", - "type_name": "str", - "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the Markdown.

\n", + "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n

Also note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.

\n

If you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:

\n

https://discuss.streamlit.io/t/96

\n

This will help us come up with safe APIs that allow you to do what\nyou want.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/markdown.py#L31" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/markdown.py#L28" }, "streamlit.metric": { "name": "metric", - "signature": "st.metric(label, value, delta=None, delta_color=\"normal\", help=None, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n

st.metric looks especially nice in combination with st.columns:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n

The delta indicator color can also be inverted or turned off:

\n
\nimport streamlit as st\n\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n
\n", + "signature": "st.metric(label, value, delta=None, delta_color=\"normal\", help=None)", + "example": "
\n
\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n \n (view standalone Streamlit app)\n \n

st.metric looks especially nice in combination with st.columns:

\n
\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n \n (view standalone Streamlit app)\n \n

The delta indicator color can also be inverted or turned off:

\n
\nst.metric(label="Gas price", value=4, delta=-0.5,\n     delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n     delta_color="off")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

The header or title for the metric. The label can optionally contain\nMarkdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "description": "

The header or Title for the metric

\n", "default": null }, { @@ -2291,7 +1559,7 @@ }, { "name": "delta_color", - "type_name": "\"normal\", \"inverse\", or \"off\"", + "type_name": "str", "is_optional": false, "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", "default": null @@ -2302,29 +1570,22 @@ "is_optional": false, "description": "

An optional tooltip that gets displayed next to the metric label.

\n", "default": null - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/metric.py#L46" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/metric.py#L43" }, "streamlit.multiselect": { "name": "multiselect", - "signature": "st.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, max_selections=None, placeholder=\"Choose an option\", disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n
\n", + "signature": "st.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\noptions = st.multiselect(\n     'What are your favorite colors',\n     ['Green', 'Yellow', 'Red', 'Blue'],\n     ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this select widget is for.

\n", "default": null }, { @@ -2383,33 +1644,12 @@ "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, - { - "name": "max_selections", - "type_name": "int", - "is_optional": false, - "description": "

The max selections that can be selected at a time.\nThis argument can only be supplied by keyword.

\n", - "default": null - }, - { - "name": "placeholder", - "type_name": "str", - "is_optional": false, - "description": "

A string to display when no options are selected. Defaults to 'Choose an option'.

\n", - "default": "s" - }, { "name": "disabled", "type_name": "bool", "is_optional": false, "description": "

An optional boolean, which disables the multiselect widget if set\nto True. The default is False. This argument can only be supplied\nby keyword.

\n", "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" } ], "returns": [ @@ -2420,45 +1660,45 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/multiselect.py#L146" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/multiselect.py#L45" }, "streamlit.number_input": { "name": "number_input", - "signature": "st.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n
\n", - "description": "

Display a numeric input widget.

\n
\n

Note

\n

Integer values exceeding +/- (1<<53) - 1 cannot be accurately\nstored or returned by the widget due to serialization contstraints\nbetween the Python server and JavaScript client. You must handle\nsuch numbers as floats, leading to a loss in precision.

\n
\n", + "signature": "st.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a numeric input widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this input is for.

\n", "default": null }, { "name": "min_value", - "type_name": "int, float, or None", + "type_name": "int or float or None", "is_optional": false, "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", "default": null }, { "name": "max_value", - "type_name": "int, float, or None", + "type_name": "int or float or None", "is_optional": false, "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", "default": null }, { "name": "value", - "type_name": "int, float, or None", + "type_name": "int or float or None", "is_optional": false, "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", "default": "min_value" }, { "name": "step", - "type_name": "int, float, or None", + "type_name": "int or float or None", "is_optional": false, "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", "default": "1" @@ -2511,13 +1751,6 @@ "is_optional": false, "description": "

An optional boolean, which disables the number input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" } ], "returns": [ @@ -2528,12 +1761,12 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/number_input.py#L67" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/number_input.py#L39" }, "streamlit.plotly_chart": { "name": "plotly_chart", - "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", theme=\"streamlit\", **kwargs)", - "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport numpy as np\nimport plotly.figure_factory as ff\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n        hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n
\n", + "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)", + "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport plotly.figure_factory as ff\nimport numpy as np\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n         hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", "args": [ { @@ -2552,18 +1785,11 @@ }, { "name": "sharing", - "type_name": "\"streamlit\", \"private\", \"secret\", or \"public\"", + "type_name": "{'streamlit', 'private', 'secret', 'public'}", "is_optional": false, - "description": "

Use "streamlit" to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", + "description": "

Use 'streamlit' to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plotly.com/chart-studio/ for more information.

\n", "default": null }, - { - "name": "theme", - "type_name": "\"streamlit\" or None", - "is_optional": false, - "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", - "default": "behavior" - }, { "name": "**kwargs", "type_name": null, @@ -2573,13 +1799,13 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/plotly_chart.py#L81" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/plotly_chart.py#L67" }, "streamlit.progress": { "name": "progress", - "signature": "st.progress(value, text=None)", - "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport streamlit as st\nimport time\n\nprogress_text = "Operation in progress. Please wait."\nmy_bar = st.progress(0, text=progress_text)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1, text=progress_text)\n
\n
\n", - "description": "

Display a progress bar.

\n", + "signature": "st.progress(value)", + "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport time\n\nmy_bar = st.progress(0)\n\nfor percent_complete in range(100):\n     time.sleep(0.1)\n     my_bar.progress(percent_complete + 1)\n
\n
\n", + "description": "Display a progress bar.", "args": [ { "name": "value", @@ -2587,48 +1813,34 @@ "is_optional": false, "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", "default": null - }, - { - "name": "text", - "type_name": "str or None", - "is_optional": false, - "description": "

A message to display above the progress bar. The text can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", - "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/progress.py#L66" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/progress.py#L31" }, "streamlit.pydeck_chart": { "name": "pydeck_chart", "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)", - "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport pydeck as pdk\n\nchart_data = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=chart_data,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=chart_data,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", - "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:

\n
\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n     map_style='mapbox://styles/mapbox/light-v9',\n     initial_view_state=pdk.ViewState(\n         latitude=37.76,\n         longitude=-122.4,\n         zoom=11,\n         pitch=50,\n     ),\n     layers=[\n         pdk.Layer(\n            'HexagonLayer',\n            data=df,\n            get_position='[lon, lat]',\n            radius=200,\n            elevation_scale=4,\n            elevation_range=[0, 1000],\n            pickable=True,\n            extruded=True,\n         ),\n         pdk.Layer(\n             'ScatterplotLayer',\n             data=df,\n             get_position='[lon, lat]',\n             get_color='[200, 30, 0, 160]',\n             get_radius=200,\n         ),\n     ],\n ))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", "args": [ { - "name": "pydeck_obj", + "name": "spec", "type_name": "pydeck.Deck or None", "is_optional": false, "description": "

Object specifying the PyDeck chart to draw.

\n", "default": null - }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "", - "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/deck_gl_json_chart.py#L37" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/deck_gl_json_chart.py#L23" }, "streamlit.pyplot": { "name": "pyplot", - "signature": "st.pyplot(fig=None, clear_figure=None, use_container_width=True, **kwargs)", - "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", - "example": "
\n
\nimport streamlit as st\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n
\n", - "description": "

Display a matplotlib.pyplot figure.

\n", + "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)", + "notes": "
\n
\n

Note

\n

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

\n
\n

Matplotlib support several different types of "backends". If you're\ngetting an error using Matplotlib with Streamlit, try setting your\nbackend to "TkAgg":

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", + "example": "
\n
\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a matplotlib.pyplot figure.", "args": [ { "name": "fig", @@ -2644,13 +1856,6 @@ "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", "default": "based" }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "

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

\n", - "default": "s" - }, { "name": "**kwargs", "type_name": "any", @@ -2660,26 +1865,26 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/pyplot.py#L38" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/pyplot.py#L31" }, "streamlit.radio": { "name": "radio", - "signature": "st.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, captions=None, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\ngenre = st.radio(\n    "What's your favorite movie genre",\n    [":rainbow[Comedy]", "***Drama***", "Documentary :movie_camera:"],\n    captions = ["Laugh out loud.", "Get the popcorn.", "Never stop learning."])\n\nif genre == ':rainbow[Comedy]':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn\\'t select comedy.")\n
\n\n \n
\n", - "description": "

Display a radio button widget.

\n", + "signature": "st.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False)", + "example": "
\n
\ngenre = st.radio(\n     "What's your favorite movie genre",\n     ('Comedy', 'Drama', 'Documentary'))\n\nif genre == 'Comedy':\n     st.write('You selected comedy.')\n else:\n     st.write("You didn't select comedy.")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a radio button widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this radio group is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this radio group is for.

\n", "default": null }, { "name": "options", "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", "is_optional": false, - "description": "

Labels for the radio options. Labels can include markdown as\ndescribed in the label parameter and will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", + "description": "

Labels for the radio options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", "default": "." }, { @@ -2744,20 +1949,6 @@ "is_optional": false, "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", "default": "false" - }, - { - "name": "captions", - "type_name": "iterable of str or None", - "is_optional": false, - "description": "

A list of captions to show below each radio button. If None (default),\nno captions are shown.

\n", - "default": null - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" } ], "returns": [ @@ -2768,19 +1959,19 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/radio.py#L76" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/radio.py#L35" }, "streamlit.select_slider": { "name": "select_slider", - "signature": "st.select_slider(label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "examples": "
\nimport streamlit as st\n\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nimport streamlit as st\n\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n ", + "signature": "st.select_slider(label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "examples": "
\ncolor = st.select_slider(\n     'Select a color of the rainbow',\n     options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nstart_color, end_color = st.select_slider(\n     'Select a range of color wavelength',\n     options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n     value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n \n (view standalone Streamlit app)\n \n ", "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this slider is for.

\n", "default": null }, { @@ -2845,13 +2036,6 @@ "is_optional": false, "description": "

An optional boolean, which disables the select slider if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" } ], "returns": [ @@ -2862,19 +2046,19 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/select_slider.py#L107" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/select_slider.py#L35" }, "streamlit.selectbox": { "name": "selectbox", - "signature": "st.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=\"Select...\", disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n
\n", - "description": "

Display a select widget.

\n", + "signature": "st.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\noption = st.selectbox(\n     'How would you like to be contacted?',\n     ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a select widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this select widget is for.

\n", "default": null }, { @@ -2933,26 +2117,12 @@ "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, - { - "name": "placeholder", - "type_name": "str", - "is_optional": false, - "description": "

A string to display when no options are selected. Defaults to 'Select...'.

\n

A selectbox can't be empty, so a placeholder only displays while a\nuser's cursor is in a selectbox after manually deleting the current\nselection. A future update will allow selectboxes to be empty.

\n", - "default": "s" - }, { "name": "disabled", "type_name": "bool", "is_optional": false, "description": "

An optional boolean, which disables the selectbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" } ], "returns": [ @@ -2963,7 +2133,7 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/selectbox.py#L72" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/selectbox.py#L35" }, "streamlit.set_option": { "name": "set_option", @@ -2986,13 +2156,13 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/config.py#L92" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/__init__.py#L212" }, "streamlit.set_page_config": { "name": "set_page_config", "signature": "st.set_page_config(page_title=None, page_icon=None, layout=\"centered\", initial_sidebar_state=\"auto\", menu_items=None)", - "example": "
\nimport streamlit as st\n\nst.set_page_config(\n    page_title="Ex-stream-ly Cool App",\n    page_icon="\ud83e\uddca",\n    layout="wide",\n    initial_sidebar_state="expanded",\n    menu_items={\n        'Get Help': 'https://www.extremelycoolapp.com/help',\n        'Report a bug': "https://www.extremelycoolapp.com/bug",\n        'About': "# This is a header. This is an *extremely* cool app!"\n    }\n)\n
\n", - "description": "

Configures the default settings of the page.

\n
\n

Note

\n

This must be the first Streamlit command used on an app page, and must only\nbe set once per page.

\n
\n", + "example": "
\nst.set_page_config(\n     page_title="Ex-stream-ly Cool App",\n     page_icon="\ud83e\uddca",\n     layout="wide",\n     initial_sidebar_state="expanded",\n     menu_items={\n         'Get Help': 'https://www.extremelycoolapp.com/help',\n         'Report a bug': "https://www.extremelycoolapp.com/bug",\n         'About': "# This is a header. This is an *extremely* cool app!"\n     }\n )\n
\n", + "description": "

Configures the default settings of the page.

\n
\n

Note

\n

This must be the first Streamlit command used in your app, and must only\nbe set once.

\n
\n", "args": [ { "name": "page_title", @@ -3017,7 +2187,7 @@ }, { "name": "initial_sidebar_state", - "type_name": "\"auto\", \"expanded\", or \"collapsed\"", + "type_name": "\"auto\" or \"expanded\" or \"collapsed\"", "is_optional": false, "description": "

How the sidebar should start out. Defaults to "auto",\nwhich hides the sidebar on mobile-sized devices, and shows it otherwise.\n"expanded" shows the sidebar initially; "collapsed" hides it.

\n", "default": "s" @@ -3026,24 +2196,24 @@ "name": "menu_items", "type_name": "dict", "is_optional": false, - "description": "

Configure the menu that appears on the top-right side of this app.\nThe keys in this dict denote the menu item you'd like to configure:

\n
    \n
  • \n
    "Get help": str or None
    \n
    The URL this menu item should point to.\nIf None, hides this menu item.
    \n
    \n
  • \n
  • \n
    "Report a Bug": str or None
    \n
    The URL this menu item should point to.\nIf None, hides this menu item.
    \n
    \n
  • \n
  • \n
    "About": str or None
    \n
    A markdown string to show in the About dialog.\nIf None, only shows Streamlit's default About text.
    \n
    \n
  • \n
\n

The URL may also refer to an email address e.g. mailto:john@example.com.

\n", + "description": "

Configure the menu that appears on the top-right side of this app.\nThe keys in this dict denote the menu item you'd like to configure:

\n
    \n
  • \n
    "Get help": str or None
    \n
    The URL this menu item should point to.\nIf None, hides this menu item.
    \n
    \n
  • \n
  • \n
    "Report a Bug": str or None
    \n
    The URL this menu item should point to.\nIf None, hides this menu item.
    \n
    \n
  • \n
  • \n
    "About": str or None
    \n
    A markdown string to show in the About dialog.\nIf None, only shows Streamlit's default About text.
    \n
    \n
  • \n
\n", "default": "About" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/commands/page_config.py#L114" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/commands/page_config.py#L44" }, "streamlit.slider": { "name": "slider", - "signature": "st.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "examples": "
\n
\nimport streamlit as st\n\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nimport streamlit as st\n\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nimport streamlit as st\nfrom datetime import time\n\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nimport streamlit as st\nfrom datetime import datetime\n\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n
\n", - "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n
\n

Note

\n

Integer values exceeding +/- (1<<53) - 1 cannot be accurately\nstored or returned by the widget due to serialization contstraints\nbetween the Python server and JavaScript client. You must handle\nsuch numbers as floats, leading to a loss in precision.

\n
\n", + "signature": "st.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "examples": "
\n
\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nvalues = st.slider(\n     'Select a range of values',\n     0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nfrom datetime import time\nappointment = st.slider(\n     "Schedule your appointment:",\n     value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nfrom datetime import datetime\nstart_time = st.slider(\n     "When do you start?",\n     value=datetime(2020, 1, 1, 9, 30),\n     format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this slider is for.

\n", "default": null }, { @@ -3069,7 +2239,7 @@ }, { "name": "step", - "type_name": "int, float, timedelta, or None", + "type_name": "int/float/timedelta or None", "is_optional": false, "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", "default": "1" @@ -3122,13 +2292,6 @@ "is_optional": false, "description": "

An optional boolean, which disables the slider if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" } ], "returns": [ @@ -3139,22 +2302,22 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/slider.py#L173" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/slider.py#L37" }, "streamlit.snow": { "name": "snow", "signature": "st.snow()", - "example": "
\n
\nimport streamlit as st\n\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", - "description": "

Draw celebratory snowfall.

\n", + "example": "
\n
\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", + "description": "Draw celebratory snowfall.", "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/snow.py#L25" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/snow.py#L24" }, "streamlit.spinner": { "name": "spinner", "signature": "st.spinner(text=\"In progress...\")", - "example": "
\n
\nimport time\nimport streamlit as st\n\nwith st.spinner('Wait for it...'):\n    time.sleep(5)\nst.success('Done!')\n
\n
\n", - "description": "

Temporarily displays a message while executing a block of code.

\n", + "example": "
\n
\nwith st.spinner('Wait for it...'):\n    time.sleep(5)\nst.success('Done!')\n
\n
\n", + "description": "Temporarily displays a message while executing a block of code.", "args": [ { "name": "text", @@ -3165,98 +2328,46 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/spinner.py#L23" - }, - "streamlit.status": { - "name": "status", - "signature": "st.status(label, *, expanded=False, state=\"running\")", - "examples": "
\n

You can use with notation to insert any element into an status container:

\n
\nimport time\nimport streamlit as st\n\nwith st.status("Downloading data..."):\n    st.write("Searching for data...")\n    time.sleep(2)\n    st.write("Found URL.")\n    time.sleep(1)\n    st.write("Downloading data...")\n    time.sleep(1)\n\nst.button('Rerun')\n
\n\n \n

You can also use .update() on the container to change the label, state,\nor expanded state:

\n
\nimport time\nimport streamlit as st\n\nwith st.status("Downloading data...", expanded=True) as status:\n    st.write("Searching for data...")\n    time.sleep(2)\n    st.write("Found URL.")\n    time.sleep(1)\n    st.write("Downloading data...")\n    time.sleep(1)\n    status.update(label="Download complete!", state="complete", expanded=False)\n\nst.button('Rerun')\n
\n\n \n
\n", - "description": "

Insert a status container to display output from long-running tasks.

\n

Inserts a container into your app that is typically used to show the status and\ndetails of a process or task. The container can hold multiple elements and can\nbe expanded or collapsed by the user similar to st.expander.\nWhen collapsed, all that is visible is the status icon and label.

\n

The label, state, and expanded state can all be updated by calling .update()\non the returned object. To add elements to the returned container, you can\nuse "with" notation (preferred) or just call methods directly on the returned\nobject.

\n

By default, st.status() initializes in the "running" state. When called using\n"with" notation, it automatically updates to the "complete" state at the end\nof the "with" block. See examples below for more details.

\n", - "args": [ - { - "name": "label", - "type_name": "str", - "is_optional": false, - "description": "

The initial label of the status container. The label can optionally\ncontain Markdown and supports the following elements: Bold,\nItalics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents)\nrender. Display unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", - "default": null - }, - { - "name": "expanded", - "type_name": "bool", - "is_optional": false, - "description": "

If True, initializes the status container in "expanded" state. Defaults to\nFalse (collapsed).

\n", - "default": "s" - }, - { - "name": "state", - "type_name": "\"running\", \"complete\", or \"error\"", - "is_optional": false, - "description": "

The initial state of the status container which determines which icon is\nshown:

\n
    \n
  • running (default): A spinner icon is shown.
  • \n
  • complete: A checkmark icon is shown.
  • \n
  • error: An error icon is shown.
  • \n
\n", - "default": null - } - ], - "returns": [ - { - "type_name": "StatusContainer", - "is_generator": false, - "description": "

A mutable status container that can hold multiple elements. The label, state,\nand expanded state can be updated after creation via .update().

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/layouts.py#L414" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/__init__.py#L391" }, "streamlit.stop": { "name": "stop", "signature": "st.stop()", - "example": "
\n
\nimport streamlit as st\n\nname = st.text_input('Name')\nif not name:\n  st.warning('Please input a name.')\n  st.stop()\nst.success('Thank you for inputting a name.')\n
\n
\n", + "example": "
\n
\nname = st.text_input('Name')\nif not name:\n  st.warning('Please input a name.')\n  st.stop()\nst.success('Thank you for inputting a name.')\n
\n
\n", "description": "

Stops execution immediately.

\n

Streamlit will not run any statements after st.stop().\nWe recommend rendering a message to explain why the script has stopped.\nWhen run outside of Streamlit, this will raise an Exception.

\n", "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/commands/execution_control.py#L26" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/__init__.py#L492" }, "streamlit.subheader": { "name": "subheader", - "signature": "st.subheader(body, anchor=None, *, help=None, divider=False)", - "examples": "
\n
\nimport streamlit as st\n\nst.subheader('This is a subheader with a divider', divider='rainbow')\nst.subheader('_Streamlit_ is :blue[cool] :sunglasses:')\n
\n\n \n
\n", - "description": "

Display text in subheader formatting.

\n", + "signature": "st.subheader(body, anchor=None)", + "example": "
\n
\nst.subheader('This is a subheader')\n
\n
\n", + "description": "Display text in subheader formatting.", "args": [ { "name": "body", "type_name": "str", "is_optional": false, - "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", + "description": "

The text to display.

\n", "default": null }, { "name": "anchor", - "type_name": "str or False", - "is_optional": false, - "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", - "default": null - }, - { - "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the subheader.

\n", - "default": null - }, - { - "name": "divider", - "type_name": "bool or \u201cblue\u201d, \u201cgreen\u201d, \u201corange\u201d, \u201cred\u201d, \u201cviolet\u201d, \u201cgray\u201d/\"grey\", or \u201crainbow\u201d", - "is_optional": false, - "description": "

Shows a colored divider below the header. If True, successive\nheaders will cycle through divider colors. That is, the first\nheader will have a blue line, the second header will have a\ngreen line, and so on. If a string, the color can be set to one of\nthe following: blue, green, orange, red, violet, gray/grey, or\nrainbow.

\n", + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/heading.py#L111" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/markdown.py#L106" }, "streamlit.success": { "name": "success", - "signature": "st.success(body, *, icon=None)", - "example": "
\n
\nimport streamlit as st\n\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", - "description": "

Display a success message.

\n", + "signature": "st.success(body)", + "example": "
\n
\nst.success('This is a success message!')\n
\n
\n", + "description": "Display a success message.", "args": [ { "name": "body", @@ -3264,46 +2375,39 @@ "is_optional": false, "description": "

The success text to display.

\n", "default": null - }, - { - "name": "icon", - "type_name": "str or None", - "is_optional": false, - "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", - "default": "None" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/alert.py#L124" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/alert.py#L80" }, "streamlit.table": { "name": "table", "signature": "st.table(data=None)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n
\n", + "example": "
\n
\ndf = pd.DataFrame(\n    np.random.randn(10, 5),\n    columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", "args": [ { "name": "data", - "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", "is_optional": false, - "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L193" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/dataframe_selector.py#L99" }, "streamlit.tabs": { "name": "tabs", "signature": "st.tabs(tabs)", - "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\nimport streamlit as st\n\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n
\n", + "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n    st.header("A cat")\n    st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n    st.header("A dog")\n    st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n    st.header("An owl")\n    st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", "args": [ { "name": "tabs", "type_name": "list of strings", "is_optional": false, - "description": "

Creates a tab for each string in the list. The first tab is selected by default.\nThe string is used as the name of the tab and can optionally contain Markdown,\nsupporting the following elements: Bold, Italics, Strikethroughs, Inline Code,\nEmojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "description": "

Creates a tab for each string in the list. The string is used as the name of the tab.\nThe first tab is selected by default.

\n", "default": "." } ], @@ -3315,13 +2419,13 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/layouts.py#L207" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/layouts.py#L196" }, "streamlit.text": { "name": "text", - "signature": "st.text(body, *, help=None)", - "example": "
\n
\nimport streamlit as st\n\nst.text('This is some text.')\n
\n
\n", - "description": "

Write fixed-width and preformatted text.

\n", + "signature": "st.text(body)", + "example": "
\n
\nst.text('This is some text.')\n
\n
\n", + "description": "Write fixed-width and preformatted text.", "args": [ { "name": "body", @@ -3329,34 +2433,27 @@ "is_optional": false, "description": "

The string to display.

\n", "default": null - }, - { - "name": "help", - "type_name": "str", - "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the text.

\n", - "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/text.py#L27" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/text.py#L26" }, "streamlit.text_area": { "name": "text_area", - "signature": "st.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", - "description": "

Display a multi-line text input widget.

\n", + "signature": "st.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False)", + "example": "
\n
\ntxt = st.text_area('Text to analyze', '''\n     It was the best of times, it was the worst of times, it was\n     the age of wisdom, it was the age of foolishness, it was\n     the epoch of belief, it was the epoch of incredulity, it\n     was the season of Light, it was the season of Darkness, it\n     was the spring of hope, it was the winter of despair, (...)\n     ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", + "description": "Display a multi-line text input widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this input is for.

\n", "default": null }, { "name": "value", - "type_name": "object", + "type_name": "any", "is_optional": false, "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", "default": null @@ -3423,13 +2520,6 @@ "is_optional": false, "description": "

An optional boolean, which disables the text area if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" } ], "returns": [ @@ -3440,24 +2530,24 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/text_widgets.py#L288" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/text_widgets.py#L200" }, "streamlit.text_input": { "name": "text_input", - "signature": "st.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n
\n", - "description": "

Display a single-line text input widget.

\n", + "signature": "st.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False)", + "example": "
\n
\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a single-line text input widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this input is for.

\n", "default": null }, { "name": "value", - "type_name": "object", + "type_name": "any", "is_optional": false, "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", "default": null @@ -3478,7 +2568,7 @@ }, { "name": "type", - "type_name": "\"default\" or \"password\"", + "type_name": "str", "is_optional": false, "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", "default": "s" @@ -3501,7 +2591,7 @@ "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this text input's value changes.

\n", + "description": "

An optional callback invoked when this text_input's value changes.

\n", "default": null }, { @@ -3531,13 +2621,6 @@ "is_optional": false, "description": "

An optional boolean, which disables the text input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" } ], "returns": [ @@ -3548,19 +2631,19 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/text_widgets.py#L72" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/text_widgets.py#L36" }, "streamlit.time_input": { "name": "time_input", - "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", step=0:15:00)", - "example": "
\n
\nimport datetime\nimport streamlit as st\n\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n
\n", - "description": "

Display a time input widget.

\n", + "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a time input widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this time input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this time input is for.

\n", "default": null }, { @@ -3611,20 +2694,6 @@ "is_optional": false, "description": "

An optional boolean, which disables the time input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" - }, - { - "name": "step", - "type_name": "int or timedelta", - "is_optional": false, - "description": "

The stepping interval in seconds. Defaults to 900, i.e. 15 minutes.\nYou can also pass a datetime.timedelta object.

\n", - "default": "900" } ], "returns": [ @@ -3635,154 +2704,43 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/time_widgets.py#L219" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/time_widgets.py#L165" }, "streamlit.title": { "name": "title", - "signature": "st.title(body, anchor=None, *, help=None)", - "examples": "
\n
\nimport streamlit as st\n\nst.title('This is a title')\nst.title('_Streamlit_ is :blue[cool] :sunglasses:')\n
\n\n \n
\n", + "signature": "st.title(body, anchor=None)", + "example": "
\n
\nst.title('This is a title')\n
\n
\n", "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", "args": [ { "name": "body", "type_name": "str", "is_optional": false, - "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", + "description": "

The text to display.

\n", "default": null }, { "name": "anchor", - "type_name": "str or False", - "is_optional": false, - "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", - "default": null - }, - { - "name": "help", - "type_name": "str", - "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the title.

\n", - "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/heading.py#L181" - }, - "streamlit.toast": { - "name": "toast", - "signature": "st.toast(body, *, icon=None)", - "example": "
\n
\nimport streamlit as st\n\nst.toast('Your edited image was saved!', icon='\ud83d\ude0d')\n
\n
\n", - "description": "

Display a short message, known as a notification "toast".

\n

The toast appears in the app's bottom-right corner and disappears after four seconds.

\n
\n

Warning

\n

st.toast is not compatible with Streamlit's caching and\ncannot be called within a cached function.

\n
\n", - "args": [ - { - "name": "body", "type_name": "str", "is_optional": false, - "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", "default": null - }, - { - "name": "icon", - "type_name": "str or None", - "is_optional": false, - "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the toast. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", - "default": "None" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/toast.py#L37" - }, - "streamlit.toggle": { - "name": "toggle", - "signature": "st.toggle(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\non = st.toggle('Activate feature')\n\nif on:\n    st.write('Feature activated!')\n
\n\n \n
\n", - "description": "

Display a toggle widget.

\n", - "args": [ - { - "name": "label", - "type_name": "str", - "is_optional": false, - "description": "

A short label explaining to the user what this toggle is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", - "default": null - }, - { - "name": "value", - "type_name": "bool", - "is_optional": false, - "description": "

Preselect the toggle when it first renders. This will be\ncast to bool internally.

\n", - "default": null - }, - { - "name": "key", - "type_name": "str or int", - "is_optional": false, - "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", - "default": null - }, - { - "name": "help", - "type_name": "str", - "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the toggle.

\n", - "default": null - }, - { - "name": "on_change", - "type_name": "callable", - "is_optional": false, - "description": "

An optional callback invoked when this toggle's value changes.

\n", - "default": null - }, - { - "name": "args", - "type_name": "tuple", - "is_optional": false, - "description": "

An optional tuple of args to pass to the callback.

\n", - "default": null - }, - { - "name": "kwargs", - "type_name": "dict", - "is_optional": false, - "description": "

An optional dict of kwargs to pass to the callback.

\n", - "default": null - }, - { - "name": "disabled", - "type_name": "bool", - "is_optional": false, - "description": "

An optional boolean, which disables the toggle if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", - "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" - } - ], - "returns": [ - { - "type_name": "bool", - "is_generator": false, - "description": "

Whether or not the toggle is checked.

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/checkbox.py#L156" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/markdown.py#L161" }, "streamlit.vega_lite_chart": { "name": "vega_lite_chart", - "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, theme=\"streamlit\", **kwargs)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(chart_data, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", - "description": "

Display a chart using the Vega-Lite library.

\n", + "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, **kwargs)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n     np.random.randn(200, 3),\n     columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(df, {\n     'mark': {'type': 'circle', 'tooltip': True},\n     'encoding': {\n         'x': {'field': 'a', 'type': 'quantitative'},\n         'y': {'field': 'b', 'type': 'quantitative'},\n         'size': {'field': 'c', 'type': 'quantitative'},\n         'color': {'field': 'c', 'type': 'quantitative'},\n     },\n })\n
\n\n \n \n (view standalone Streamlit app)\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", + "description": "Display a chart using the Vega-Lite library.", "args": [ { "name": "data", "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", "is_optional": false, - "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null }, { @@ -3799,13 +2757,6 @@ "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", "default": null }, - { - "name": "theme", - "type_name": "\"streamlit\" or None", - "is_optional": false, - "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", - "default": "behavior" - }, { "name": "**kwargs", "type_name": "any", @@ -3815,19 +2766,19 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L819" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/dataframe_selector.py#L341" }, "streamlit.video": { "name": "video", "signature": "st.video(data, format=\"video/mp4\", start_time=0)", - "example": "
\n
\nimport streamlit as st\n\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", - "description": "

Display a video player.

\n", + "example": "
\n
\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", + "description": "Display a video player.", "args": [ { "name": "data", - "type_name": "str, bytes, BytesIO, numpy.ndarray, or file", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", "is_optional": false, - "description": "

Raw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "description": "

io.open().\nRaw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", "default": null }, { @@ -3846,13 +2797,13 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/media.py#L115" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/media.py#L79" }, "streamlit.warning": { "name": "warning", - "signature": "st.warning(body, *, icon=None)", - "example": "
\n
\nimport streamlit as st\n\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", - "description": "

Display warning message.

\n", + "signature": "st.warning(body)", + "example": "
\n
\nst.warning('This is a warning')\n
\n
\n", + "description": "Display warning message.", "args": [ { "name": "body", @@ -3860,1586 +2811,1560 @@ "is_optional": false, "description": "

The warning text to display.

\n", "default": null - }, - { - "name": "icon", - "type_name": "str or None", - "is_optional": false, - "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", - "default": "None" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/alert.py#L59" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/alert.py#L44" }, "streamlit.write": { "name": "write", - "signature": "st.write(*args, unsafe_allow_html=False, **kwargs)", - "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nimport streamlit as st\n\nst.write('Hello, *World!* :sunglasses:')\n
\n\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nimport streamlit as st\nimport pandas as pd\n\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nimport streamlit as st\n\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n
\n", + "signature": "st.write(*args, **kwargs)", + "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nwrite('Hello, *World!* :sunglasses:')\n
\n\n \n \n (view standalone Streamlit app)\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nst.write(1234)\nst.write(pd.DataFrame({\n     'first column': [1, 2, 3, 4],\n     'second column': [10, 20, 30, 40],\n }))\n
\n\n \n \n (view standalone Streamlit app)\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n \n (view standalone Streamlit app)\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n     np.random.randn(200, 3),\n     columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n     x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", "args": [ { "name": "*args", "type_name": "any", "is_optional": false, - "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression, emoji shortcodes, and colored text.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(class) : Displays information about a class.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", + "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression and emoji shortcodes.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", "default": null }, { "name": "unsafe_allow_html", "type_name": "bool", "is_optional": false, - "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n

Also note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.

\n

If you decide to turn on HTML anyway, we ask you to please tell us your\nexact use case here:\nhttps://discuss.streamlit.io/t/96 .

\n

This will help us come up with safe APIs that allow you to do what you\nwant.

\n", "default": "False." } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/write.py#L49" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/write.py#L43" }, "streamlit.experimental_memo.clear": { "name": "experimental_memo.clear", "signature": "st.experimental_memo.clear()", - "description": "

Clear all in-memory and on-disk data caches.

\n", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/runtime/caching/cache_data_api.py#L587" - }, - "streamlit.cache_data.clear": { - "name": "cache_data.clear", - "signature": "st.cache_data.clear()", - "description": "

Clear all in-memory and on-disk data caches.

\n", + "description": "Clear all in-memory and on-disk memo caches.", "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/runtime/caching/cache_data_api.py#L587" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/caching/memo_decorator.py#L351" }, "streamlit.experimental_singleton.clear": { "name": "experimental_singleton.clear", "signature": "st.experimental_singleton.clear()", - "description": "

Clear all cache_resource caches.

\n", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/runtime/caching/cache_resource_api.py#L449" - }, - "streamlit.cache_resource.clear": { - "name": "cache_resource.clear", - "signature": "st.cache_resource.clear()", - "description": "

Clear all cache_resource caches.

\n", + "description": "Clear all singleton caches.", "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/runtime/caching/cache_resource_api.py#L449" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/caching/singleton_decorator.py#L237" }, - "streamlit.connections.ExperimentalBaseConnection": { - "name": "ExperimentalBaseConnection", - "signature": "st.connections.ExperimentalBaseConnection(connection_name, **kwargs)", - "is_class": true, - "methods": [ + "streamlit.components.v1.declare_component": { + "name": "declare_component", + "signature": "st.components.v1.declare_component(name, path=None, url=None)", + "description": "Create and register a custom component.", + "args": [ { - "name": "reset", - "signature": "st.connections.reset.reset()", - "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", - "description": "

Reset this connection so that it gets reinitialized the next time it's used.

", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/base_connection.py#L137" - } - ], - "properties": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/base_connection.py#L25", - "description": "

The abstract base class that all Streamlit Connections must inherit from.

\n

This base class provides connection authors with a standardized way to hook into the\nst.experimental_connection() factory function: connection authors are required to\nprovide an implementation for the abstract method _connect in their subclasses.

\n

Additionally, it also provides a few methods/properties designed to make\nimplementation of connections more convenient. See the docstrings for each of the\nmethods of this class for more information

\n
\n

Note

\n

While providing an implementation of _connect is technically all that's\nrequired to define a valid connection, connections should also provide the user\nwith context-specific ways of interacting with the underlying connection object.\nFor example, the first-party SQLConnection provides a query() method for\nreads and a session property for more complex operations.

\n
\n", - "args": [], - "returns": [] - }, - "streamlit.connections.SQLConnection": { - "name": "SQLConnection", - "signature": "st.connections.SQLConnection(connection_name, **kwargs)", - "is_class": true, - "methods": [ + "name": "name", + "type_name": "str", + "is_optional": false, + "description": "

A short, descriptive name for the component. Like, "slider".

\n", + "default": null + }, { - "name": "query", - "signature": "st.connections.query.query(sql, *, ttl=None, index_col=None, chunksize=None, params=None, **kwargs)", - "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("sql")\ndf = conn.query("select * from pet_owners where owner = :owner", ttl=3600, params={"owner":"barbara"})\nst.dataframe(df)\n
\n
\n", - "description": "

Run a read-only query.

", - "args": [ - { - "name": "sql", - "type_name": "str", - "is_optional": false, - "description": "

The read-only SQL query to execute.

\n", - "default": null - }, - { - "name": "ttl", - "type_name": "float, int, timedelta or None", - "is_optional": false, - "description": "

The maximum number of seconds to keep results in the cache, or\nNone if cached results should not expire. The default is None.

\n", - "default": "None." - }, - { - "name": "index_col", - "type_name": "str, list of str, or None", - "is_optional": false, - "description": "

Column(s) to set as index(MultiIndex). Default is None.

\n", - "default": "None." - }, - { - "name": "chunksize", - "type_name": "int or None", - "is_optional": false, - "description": "

If specified, return an iterator where chunksize is the number of\nrows to include in each chunk. Default is None.

\n", - "default": "None." - }, - { - "name": "params", - "type_name": "list, tuple, dict or None", - "is_optional": false, - "description": "

List of parameters to pass to the execute method. The syntax used to pass\nparameters is database driver dependent. Check your database driver\ndocumentation for which of the five syntax styles, described in PEP 249\nparamstyle, is supported.\nDefault is None.

\n", - "default": "None." - }, - { - "name": "**kwargs", - "type_name": "dict", - "is_optional": false, - "description": "

Additional keyword arguments are passed to pd.read_sql.

\n", - "default": null - } - ], - "returns": [ - { - "type_name": "pd.DataFrame", - "is_generator": false, - "description": "

The result of running the query, formatted as a pandas DataFrame.

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/sql_connection.py#L121" + "name": "path", + "type_name": "str or None", + "is_optional": false, + "description": "

The path to serve the component's frontend files from. Either\npath or url must be specified, but not both.

\n", + "default": null }, { - "name": "reset", - "signature": "st.connections.reset.reset()", - "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", - "description": "

Reset this connection so that it gets reinitialized the next time it's used.

", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/base_connection.py#L137" + "name": "url", + "type_name": "str or None", + "is_optional": false, + "description": "

The URL that the component is served from. Either path or url\nmust be specified, but not both.

\n", + "default": null } ], - "properties": [ + "returns": [ { - "name": "session", - "signature": "st.connections.session.session", - "example": "
\n
\nimport streamlit as st\nconn = st.experimental_connection("sql")\nn = st.slider("Pick a number")\nif st.button("Add the number!"):\n    with conn.session as session:\n        session.execute("INSERT INTO numbers (val) VALUES (:n);", {"n": n})\n        session.commit()\n
\n
\n", - "description": "

Return a SQLAlchemy Session.

", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/sql_connection.py#L226" + "type_name": "CustomComponent", + "is_generator": false, + "description": "

A CustomComponent that can be called like a function.\nCalling the component will create a new instance of the component\nin the Streamlit app.

\n", + "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/sql_connection.py#L45", - "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("sql")\ndf = conn.query("select * from pet_owners")\nst.dataframe(df)\n
\n
\n", - "description": "

A connection to a SQL database using a SQLAlchemy Engine. Initialize using st.experimental_connection("<name>", type="sql").

\n

SQLConnection provides the query() convenience method, which can be used to\nrun simple read-only queries with both caching and simple error handling/retries.\nMore complex DB interactions can be performed by using the .session property\nto receive a regular SQLAlchemy Session.

\n

SQLConnections should always be created using st.experimental_connection(),\nnot initialized directly. Connection parameters for a SQLConnection can be\nspecified using either st.secrets or **kwargs. Some frequently used\nparameters include:

\n
    \n
  • url or arguments for sqlalchemy.engine.URL.create().\nMost commonly it includes a dialect, host, database, username and password.
  • \n
  • create_engine_kwargs can be passed via st.secrets, such as for\nsnowflake-sqlalchemy\nor Google BigQuery.\nThese can also be passed directly as **kwargs to experimental_connection().
  • \n
  • autocommit=True to run with isolation level AUTOCOMMIT. Default is False.
  • \n
\n", - "args": [], - "returns": [] + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/components/v1/components.py#L246" }, - "streamlit.connections.SnowparkConnection": { - "name": "SnowparkConnection", - "signature": "st.connections.SnowparkConnection(connection_name, **kwargs)", - "is_class": true, - "methods": [ + "streamlit.components.v1.html": { + "name": "html", + "signature": "st.components.v1.html(html, width=None, height=None, scrolling=False)", + "description": "Display an HTML string in an iframe.", + "args": [ { - "name": "query", - "signature": "st.connections.query.query(sql, ttl=None)", - "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("snowpark")\ndf = conn.query("select * from pet_owners")\nst.dataframe(df)\n
\n
\n", - "description": "

Run a read-only SQL query.

", - "args": [ - { - "name": "sql", - "type_name": "str", - "is_optional": false, - "description": "

The read-only SQL query to execute.

\n", - "default": null - }, - { - "name": "ttl", - "type_name": "float, int, timedelta or None", - "is_optional": false, - "description": "

The maximum number of seconds to keep results in the cache, or\nNone if cached results should not expire. The default is None.

\n", - "default": "None." - } - ], - "returns": [ - { - "type_name": "pd.DataFrame", - "is_generator": false, - "description": "

The result of running the query, formatted as a pandas DataFrame.

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/snowpark_connection.py#L123" + "name": "html", + "type_name": "str", + "is_optional": false, + "description": "

The HTML string to embed in the iframe.

\n", + "default": null }, { - "name": "reset", - "signature": "st.connections.reset.reset()", - "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", - "description": "

Reset this connection so that it gets reinitialized the next time it's used.

", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/base_connection.py#L137" + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", + "default": "the" }, { - "name": "safe_session", - "signature": "st.connections.safe_session.safe_session()", - "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("snowpark")\nwith conn.safe_session() as session:\n    df = session.table("mytable").limit(10).to_pandas()\n\nst.dataframe(df)\n
\n
\n", - "description": "

Grab the underlying Snowpark session in a thread-safe manner.

", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/snowpark_connection.py#L207" - } - ], - "properties": [ + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", + "default": "150." + }, { - "name": "session", - "signature": "st.connections.session.session", - "example": "
\n
\nimport streamlit as st\n\nsession = st.experimental_connection("snowpark").session\ndf = session.table("mytable").limit(10).to_pandas()\nst.dataframe(df)\n
\n
\n", - "description": "

Access the underlying Snowpark session.

", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/snowpark_connection.py#L184" + "name": "scrolling", + "type_name": "bool", + "is_optional": false, + "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", + "default": "False." } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/snowpark_connection.py#L70", - "description": "

A connection to Snowpark using snowflake.snowpark.session.Session. Initialize using

\n

st.experimental_connection("<name>", type="snowpark").

\n

In addition to accessing the Snowpark Session, SnowparkConnection supports direct SQL querying using\nquery("...") and thread safe access using with conn.safe_session():. See methods\nbelow for more information. SnowparkConnections should always be created using\nst.experimental_connection(), not initialized directly.

\n
\n

Note

\n

We don't expect this iteration of SnowparkConnection to be able to scale\nwell in apps with many concurrent users due to the lock contention that will occur\nover the single underlying Session object under high load.

\n
\n", - "args": [], - "returns": [] + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/iframe.py#L57" }, - "streamlit.connections.SQLConnection.query": { - "name": "query", - "signature": "SQLConnection.query(sql, *, ttl=None, index_col=None, chunksize=None, params=None, **kwargs)", - "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("sql")\ndf = conn.query("select * from pet_owners where owner = :owner", ttl=3600, params={"owner":"barbara"})\nst.dataframe(df)\n
\n
\n", - "description": "

Run a read-only query.

\n

This method implements both query result caching (with caching behavior\nidentical to that of using @st.cache_data) as well as simple error handling/retries.

\n
\n

Note

\n

Queries that are run without a specified ttl are cached indefinitely.

\n
\n

Aside from the ttl kwarg, all kwargs passed to this function are passed down\nto pd.read_sql\nand have the behavior described in the pandas documentation.

\n", + "streamlit.components.v1.iframe": { + "name": "iframe", + "signature": "st.components.v1.iframe(src, width=None, height=None, scrolling=False)", + "description": "Load a remote URL in an iframe.", "args": [ { - "name": "sql", + "name": "src", "type_name": "str", "is_optional": false, - "description": "

The read-only SQL query to execute.

\n", + "description": "

The URL of the page to embed.

\n", "default": null }, { - "name": "ttl", - "type_name": "float, int, timedelta or None", + "name": "width", + "type_name": "int", "is_optional": false, - "description": "

The maximum number of seconds to keep results in the cache, or\nNone if cached results should not expire. The default is None.

\n", - "default": "None." + "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", + "default": "the" }, { - "name": "index_col", - "type_name": "str, list of str, or None", + "name": "height", + "type_name": "int", "is_optional": false, - "description": "

Column(s) to set as index(MultiIndex). Default is None.

\n", - "default": "None." + "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", + "default": "150." }, { - "name": "chunksize", - "type_name": "int or None", + "name": "scrolling", + "type_name": "bool", "is_optional": false, - "description": "

If specified, return an iterator where chunksize is the number of\nrows to include in each chunk. Default is None.

\n", - "default": "None." - }, + "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/iframe.py#L24" + }, + "DeltaGenerator.add_rows": { + "name": "add_rows", + "signature": "element.add_rows(self, data=None, **kwargs)", + "example": "
\n
\ndf1 = pd.DataFrame(\n    np.random.randn(50, 20),\n    columns=('col %d' % i for i in range(20)))\n\nmy_table = st.table(df1)\n\ndf2 = pd.DataFrame(\n    np.random.randn(50, 20),\n    columns=('col %d' % i for i in range(20)))\n\nmy_table.add_rows(df2)\n# Now the table shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

You can do the same thing with plots. For example, if you want to add\nmore data to a line chart:

\n
\n# Assuming df1 and df2 from the example above still exist...\nmy_chart = st.line_chart(df1)\nmy_chart.add_rows(df2)\n# Now the chart shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

And for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:

\n
\nmy_chart = st.vega_lite_chart({\n     'mark': 'line',\n     'encoding': {'x': 'a', 'y': 'b'},\n     'datasets': {\n       'some_fancy_name': df1,  # <-- named dataset\n      },\n     'data': {'name': 'some_fancy_name'},\n }),\nmy_chart.add_rows(some_fancy_name=df2)  # <-- name used as keyword\n
\n
\n", + "description": "Concatenate a dataframe to the bottom of the current one.", + "args": [ { - "name": "params", - "type_name": "list, tuple, dict or None", + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", "is_optional": false, - "description": "

List of parameters to pass to the execute method. The syntax used to pass\nparameters is database driver dependent. Check your database driver\ndocumentation for which of the five syntax styles, described in PEP 249\nparamstyle, is supported.\nDefault is None.

\n", - "default": "None." + "description": "

Table to concat. Optional.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null }, { "name": "**kwargs", - "type_name": "dict", + "type_name": "pandas.DataFrame, numpy.ndarray, Iterable, dict, or None", "is_optional": false, - "description": "

Additional keyword arguments are passed to pd.read_sql.

\n", + "description": "

The named dataset to concat. Optional. You can only pass in 1\ndataset (including the one in the data parameter).

\n", "default": null } ], - "returns": [ - { - "type_name": "pd.DataFrame", - "is_generator": false, - "description": "

The result of running the query, formatted as a pandas DataFrame.

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/sql_connection.py#L121" - }, - "streamlit.connections.SQLConnection.reset": { - "name": "reset", - "signature": "SQLConnection.reset()", - "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", - "description": "

Reset this connection so that it gets reinitialized the next time it's used.

\n

This method can be useful when a connection has become stale, an auth token has\nexpired, or in similar scenarios where a broken connection might be fixed by\nreinitializing it. Note that some connection methods may already use reset()\nin their error handling code.

\n", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/base_connection.py#L137" - }, - "streamlit.connections.SQLConnection.session": { - "name": "session", - "signature": "SQLConnection.session", - "example": "
\n
\nimport streamlit as st\nconn = st.experimental_connection("sql")\nn = st.slider("Pick a number")\nif st.button("Add the number!"):\n    with conn.session as session:\n        session.execute("INSERT INTO numbers (val) VALUES (:n);", {"n": n})\n        session.commit()\n
\n
\n", - "description": "

Return a SQLAlchemy Session.

\n

Users of this connection should use the contextmanager pattern for writes,\ntransactions, and anything more complex than simple read queries.

\n

See the usage example below, which assumes we have a table numbers with a\nsingle integer column val. The SQLAlchemy docs also contain\nmuch more information on the usage of sessions.

\n", - "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/sql_connection.py#L226" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/dataframe_selector.py#L410" }, - "streamlit.connections.SnowparkConnection.query": { - "name": "query", - "signature": "SnowparkConnection.query(sql, ttl=None)", - "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("snowpark")\ndf = conn.query("select * from pet_owners")\nst.dataframe(df)\n
\n
\n", - "description": "

Run a read-only SQL query.

\n

This method implements both query result caching (with caching behavior\nidentical to that of using @st.cache_data) as well as simple error handling/retries.

\n
\n

Note

\n

Queries that are run without a specified ttl are cached indefinitely.

\n
\n", + "DeltaGenerator.altair_chart": { + "name": "altair_chart", + "signature": "element.altair_chart(self, altair_chart, use_container_width=False)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n     np.random.randn(200, 3),\n     columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n     x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a chart using the Altair library.", "args": [ { - "name": "sql", - "type_name": "str", + "name": "altair_chart", + "type_name": "altair.vegalite.v2.api.Chart", "is_optional": false, - "description": "

The read-only SQL query to execute.

\n", + "description": "

The Altair chart object to display.

\n", "default": null }, { - "name": "ttl", - "type_name": "float, int, timedelta or None", + "name": "use_container_width", + "type_name": "bool", "is_optional": false, - "description": "

The maximum number of seconds to keep results in the cache, or\nNone if cached results should not expire. The default is None.

\n", - "default": "None." - } - ], - "returns": [ - { - "type_name": "pd.DataFrame", - "is_generator": false, - "description": "

The result of running the query, formatted as a pandas DataFrame.

\n", - "return_name": null + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", + "default": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/snowpark_connection.py#L123" - }, - "streamlit.connections.SnowparkConnection.reset": { - "name": "reset", - "signature": "SnowparkConnection.reset()", - "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", - "description": "

Reset this connection so that it gets reinitialized the next time it's used.

\n

This method can be useful when a connection has become stale, an auth token has\nexpired, or in similar scenarios where a broken connection might be fixed by\nreinitializing it. Note that some connection methods may already use reset()\nin their error handling code.

\n", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/base_connection.py#L137" - }, - "streamlit.connections.SnowparkConnection.safe_session": { - "name": "safe_session", - "signature": "SnowparkConnection.safe_session()", - "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("snowpark")\nwith conn.safe_session() as session:\n    df = session.table("mytable").limit(10).to_pandas()\n\nst.dataframe(df)\n
\n
\n", - "description": "

Grab the underlying Snowpark session in a thread-safe manner.

\n

As operations on a Snowpark session are not thread safe, we need to take care\nwhen using a session in the context of a Streamlit app where each script run\noccurs in its own thread. Using the contextmanager pattern to do this ensures\nthat access on this connection's underlying Session is done in a thread-safe\nmanner.

\n

Information on how to use Snowpark sessions can be found in the Snowpark documentation.

\n", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/snowpark_connection.py#L207" - }, - "streamlit.connections.SnowparkConnection.session": { - "name": "session", - "signature": "SnowparkConnection.session", - "example": "
\n
\nimport streamlit as st\n\nsession = st.experimental_connection("snowpark").session\ndf = session.table("mytable").limit(10).to_pandas()\nst.dataframe(df)\n
\n
\n", - "description": "

Access the underlying Snowpark session.

\n
\n

Note

\n

Snowpark sessions are not thread safe. Users of this method are\nresponsible for ensuring that access to the session returned by this method is\ndone in a thread-safe manner. For most users, we recommend using the thread-safe\nsafe_session() method and a with block.

\n
\n

Information on how to use Snowpark sessions can be found in the Snowpark documentation.

\n", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/snowpark_connection.py#L184" - }, - "streamlit.connections.ExperimentalBaseConnection.reset": { - "name": "reset", - "signature": "ExperimentalBaseConnection.reset()", - "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", - "description": "

Reset this connection so that it gets reinitialized the next time it's used.

\n

This method can be useful when a connection has become stale, an auth token has\nexpired, or in similar scenarios where a broken connection might be fixed by\nreinitializing it. Note that some connection methods may already use reset()\nin their error handling code.

\n", - "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/base_connection.py#L137" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/dataframe_selector.py#L295" }, - "streamlit.column_config.BarChartColumn": { - "name": "BarChartColumn", - "signature": "st.column_config.BarChartColumn(label=None, *, width=None, help=None, y_min=None, y_max=None)", - "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "sales": [\n            [0, 4, 26, 80, 100, 40],\n            [80, 20, 80, 35, 40, 100],\n            [10, 20, 80, 80, 70, 0],\n            [10, 100, 20, 100, 30, 100],\n        ],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "sales": st.column_config.BarChartColumn(\n            "Sales (last 6 months)",\n            help="The sales volume in the last 6 months",\n            y_min=0,\n            y_max=100,\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Configure a bar chart column in st.dataframe or st.data_editor.

\n

Cells need to contain a list of numbers. Chart columns are not editable\nat the moment. This command needs to be used in the column_config parameter\nof st.dataframe or st.data_editor.

\n", + "DeltaGenerator.area_chart": { + "name": "area_chart", + "signature": "element.area_chart(self, data=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nchart_data = pd.DataFrame(\n     np.random.randn(20, 3),\n     columns=['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", "args": [ { - "name": "label", - "type_name": "str or None", + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, or dict", "is_optional": false, - "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null }, { "name": "width", - "type_name": "\"small\", \"medium\", \"large\", or None", + "type_name": "int", "is_optional": false, - "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "description": "

The chart width in pixels. If 0, selects the width automatically.

\n", "default": null }, { - "name": "help", - "type_name": "str or None", + "name": "height", + "type_name": "int", "is_optional": false, - "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "description": "

The chart height in pixels. If 0, selects the height automatically.

\n", "default": null }, { - "name": "y_min", - "type_name": "int, float, or None", + "name": "use_container_width", + "type_name": "bool", "is_optional": false, - "description": "

The minimum value on the y-axis for all cells in the column.\nIf None (default), every cell will use the minimum of its data.

\n", + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/dataframe_selector.py#L186" + }, + "DeltaGenerator.audio": { + "name": "audio", + "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0)", + "example": "
\n
\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an audio player.", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw audio data, filename, or a URL pointing to the file to load.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", "default": null }, { - "name": "y_max", - "type_name": "int, float, or None", + "name": "start_time", + "type_name": "int", "is_optional": false, - "description": "

The maximum value on the y-axis for all cells in the column. If None (default),\nevery cell will use the maximum of its data.

\n", + "description": "

The time from which this element should start playing.

\n", "default": null + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/lib/column_types.py#L746" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/media.py#L41" }, - "streamlit.column_config.CheckboxColumn": { - "name": "CheckboxColumn", - "signature": "st.column_config.CheckboxColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None)", - "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "widgets": ["st.selectbox", "st.number_input", "st.text_area", "st.button"],\n        "favorite": [True, False, False, True],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "favorite": st.column_config.CheckboxColumn(\n            "Your favorite?",\n            help="Select your **favorite** widgets",\n            default=False,\n        )\n    },\n    disabled=["widgets"],\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Configure a checkbox column in st.dataframe or st.data_editor.

\n

This is the default column type for boolean values. This command needs to be used in\nthe column_config parameter of st.dataframe or st.data_editor.\nWhen used with st.data_editor, editing will be enabled with a checkbox widget.

\n", + "DeltaGenerator.balloons": { + "name": "balloons", + "signature": "element.balloons(self)", + "example": "
\n
\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", + "description": "Draw celebratory balloons.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/balloons.py#L24" + }, + "DeltaGenerator.bar_chart": { + "name": "bar_chart", + "signature": "element.bar_chart(self, data=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nchart_data = pd.DataFrame(\n     np.random.randn(50, 3),\n     columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", "args": [ { - "name": "label", - "type_name": "str or None", + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, or dict", "is_optional": false, - "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null }, { "name": "width", - "type_name": "\"small\", \"medium\", \"large\", or None", + "type_name": "int", "is_optional": false, - "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "description": "

The chart width in pixels. If 0, selects the width automatically.

\n", "default": null }, { - "name": "help", - "type_name": "str or None", + "name": "height", + "type_name": "int", "is_optional": false, - "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "description": "

The chart height in pixels. If 0, selects the height automatically.

\n", "default": null }, { - "name": "disabled", - "type_name": "bool or None", + "name": "use_container_width", + "type_name": "bool", "is_optional": false, - "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", - "default": "False." - }, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/dataframe_selector.py#L240" + }, + "DeltaGenerator.beta_columns": { + "name": "beta_columns", + "signature": "element.beta_columns(*args, **kwargs)", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n    st.header("A cat")\n    st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n    st.header("A dog")\n    st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n    st.header("An owl")\n    st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put columns inside another column.

\n
\n", + "args": [ { - "name": "required", - "type_name": "bool or None", + "name": "spec", + "type_name": "int or list of numbers", "is_optional": false, - "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", - "default": "False." + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null }, { - "name": "default", - "type_name": "bool or None", + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", "is_optional": false, - "description": "

Specifies the default value in this column when a new row is added by the user.

\n", - "default": "value" + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null } ], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/beta_util.py#L43" + }, + "DeltaGenerator.beta_container": { + "name": "beta_container", + "signature": "element.beta_container(*args, **kwargs)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.container():\n    st.write("This is inside the container")\n\n    # You can call any Streamlit command, including custom components:\n    st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/lib/column_types.py#L565" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/beta_util.py#L43" }, - "streamlit.column_config.Column": { - "name": "Column", - "signature": "st.column_config.Column(label=None, *, width=None, help=None, disabled=None, required=None)", - "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "widgets": ["st.selectbox", "st.number_input", "st.text_area", "st.button"],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "widgets": st.column_config.Column(\n            "Streamlit Widgets",\n            help="Streamlit **widget** commands \ud83c\udf88",\n            width="medium",\n            required=True,\n        )\n    },\n    hide_index=True,\n    num_rows="dynamic",\n)\n
\n\n \n
\n", - "description": "

Configure a generic column in st.dataframe or st.data_editor.

\n

The type of the column will be automatically inferred from the data type.\nThis command needs to be used in the column_config parameter of st.dataframe\nor st.data_editor.

\n

To change the type of the column and enable type-specific configuration options,\nuse one of the column types in the st.column_config namespace,\ne.g. st.column_config.NumberColumn.

\n", + "DeltaGenerator.beta_expander": { + "name": "beta_expander", + "signature": "element.beta_expander(*args, **kwargs)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n     st.write("""\n         The chart above shows some numbers I picked for you.\n         I rolled actual dice for these, so they're *guaranteed* to\n         be random.\n     """)\n     st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write("""\n     The chart above shows some numbers I picked for you.\n     I rolled actual dice for these, so they're *guaranteed* to\n     be random.\n """)\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", "args": [ { "name": "label", - "type_name": "str or None", + "type_name": "str", "is_optional": false, - "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "description": "

A string to use as the header for the expander.

\n", "default": null }, { - "name": "width", - "type_name": "\"small\", \"medium\", \"large\", or None", + "name": "expanded", + "type_name": "bool", "is_optional": false, - "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", - "default": null - }, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/beta_util.py#L43" + }, + "DeltaGenerator.bokeh_chart": { + "name": "bokeh_chart", + "signature": "element.bokeh_chart(self, figure, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n     title='simple line example',\n     x_axis_label='x',\n     y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", + "args": [ { - "name": "help", - "type_name": "str or None", + "name": "figure", + "type_name": "bokeh.plotting.figure.Figure", "is_optional": false, - "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "description": "

A Bokeh figure to plot.

\n", "default": null }, { - "name": "disabled", - "type_name": "bool or None", - "is_optional": false, - "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", - "default": "False." - }, - { - "name": "required", - "type_name": "bool or None", + "name": "use_container_width", + "type_name": "bool", "is_optional": false, - "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", - "default": "False." + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Bokeh's native width value.

\n", + "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/lib/column_types.py#L187" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/bokeh_chart.py#L33" }, - "streamlit.column_config.DateColumn": { - "name": "DateColumn", - "signature": "st.column_config.DateColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, format=None, min_value=None, max_value=None, step=None)", - "examples": "
\n
\nfrom datetime import date\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "birthday": [\n            date(1980, 1, 1),\n            date(1990, 5, 3),\n            date(1974, 5, 19),\n            date(2001, 8, 17),\n        ]\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "birthday": st.column_config.DateColumn(\n            "Birthday",\n            min_value=date(1900, 1, 1),\n            max_value=date(2005, 1, 1),\n            format="DD.MM.YYYY",\n            step=1,\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Configure a date column in st.dataframe or st.data_editor.

\n

This is the default column type for date values. This command needs to be used in\nthe column_config parameter of st.dataframe or st.data_editor. When used\nwith st.data_editor, editing will be enabled with a date picker widget.

\n", + "DeltaGenerator.button": { + "name": "button", + "signature": "element.button(self, label, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\nif st.button('Say hello'):\n     st.write('Why hello there')\n else:\n     st.write('Goodbye')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a button widget.", "args": [ { "name": "label", - "type_name": "str or None", + "type_name": "str", "is_optional": false, - "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "description": "

A short label explaining to the user what this button is for.

\n", "default": null }, { - "name": "width", - "type_name": "\"small\", \"medium\", \"large\", or None", + "name": "key", + "type_name": "str or int", "is_optional": false, - "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", "default": null }, { "name": "help", - "type_name": "str or None", + "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", "default": null }, { - "name": "disabled", - "type_name": "bool or None", - "is_optional": false, - "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", - "default": "False." - }, - { - "name": "required", - "type_name": "bool or None", - "is_optional": false, - "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", - "default": "False." - }, - { - "name": "default", - "type_name": "datetime.date or None", - "is_optional": false, - "description": "

Specifies the default value in this column when a new row is added by the user.

\n", - "default": "value" - }, - { - "name": "format", - "type_name": "str or None", + "name": "on_click", + "type_name": "callable", "is_optional": false, - "description": "

A momentJS format string controlling how times are displayed. See\nmomentJS docs for available\nformats. If None (default), uses YYYY-MM-DD.

\n", + "description": "

An optional callback invoked when this button is clicked.

\n", "default": null }, { - "name": "min_value", - "type_name": "datetime.date or None", + "name": "args", + "type_name": "tuple", "is_optional": false, - "description": "

The minimum date that can be entered.\nIf None (default), there will be no minimum.

\n", + "description": "

An optional tuple of args to pass to the callback.

\n", "default": null }, { - "name": "max_value", - "type_name": "datetime.date or None", + "name": "kwargs", + "type_name": "dict", "is_optional": false, - "description": "

The maximum date that can be entered.\nIf None (default), there will be no maximum.

\n", + "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, { - "name": "step", - "type_name": "int or None", + "name": "disabled", + "type_name": "bool", "is_optional": false, - "description": "

The stepping interval in days. If None (default), the step will be 1 day.

\n", - "default": null + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." } ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/lib/column_types.py#L1278" + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/button.py#L51" }, - "streamlit.column_config.DatetimeColumn": { - "name": "DatetimeColumn", - "signature": "st.column_config.DatetimeColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, format=None, min_value=None, max_value=None, step=None, timezone=None)", - "examples": "
\n
\nfrom datetime import datetime\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "appointment": [\n            datetime(2024, 2, 5, 12, 30),\n            datetime(2023, 11, 10, 18, 0),\n            datetime(2024, 3, 11, 20, 10),\n            datetime(2023, 9, 12, 3, 0),\n        ]\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "appointment": st.column_config.DatetimeColumn(\n            "Appointment",\n            min_value=datetime(2023, 6, 1),\n            max_value=datetime(2025, 1, 1),\n            format="D MMM YYYY, h:mm a",\n            step=60,\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Configure a datetime column in st.dataframe or st.data_editor.

\n

This is the default column type for datetime values. This command needs to be\nused in the column_config parameter of st.dataframe or\nst.data_editor. When used with st.data_editor, editing will be enabled\nwith a datetime picker widget.

\n", + "DeltaGenerator.camera_input": { + "name": "camera_input", + "signature": "element.camera_input(self, label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n     st.image(picture)\n
\n
\n", + "description": "Display a widget that returns pictures from the user's webcam.", "args": [ { "name": "label", - "type_name": "str or None", + "type_name": "str", "is_optional": false, - "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "description": "

A short label explaining to the user what this widget is used for.

\n", "default": null }, { - "name": "width", - "type_name": "\"small\", \"medium\", \"large\", or None", + "name": "key", + "type_name": "str or int", "is_optional": false, - "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", "default": null }, { "name": "help", - "type_name": "str or None", + "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "description": "

A tooltip that gets displayed next to the camera input.

\n", "default": null }, { - "name": "disabled", - "type_name": "bool or None", + "name": "on_change", + "type_name": "callable", "is_optional": false, - "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", - "default": "False." + "description": "

An optional callback invoked when this camera_input's value\nchanges.

\n", + "default": null }, { - "name": "required", - "type_name": "bool or None", + "name": "args", + "type_name": "tuple", "is_optional": false, - "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", - "default": "False." + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null }, { - "name": "default", - "type_name": "datetime.datetime or None", + "name": "kwargs", + "type_name": "dict", "is_optional": false, - "description": "

Specifies the default value in this column when a new row is added by the user.

\n", - "default": "value" + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null }, { - "name": "format", - "type_name": "str or None", + "name": "disabled", + "type_name": "bool", "is_optional": false, - "description": "

A momentJS format string controlling how datetimes are displayed. See\nmomentJS docs for available\nformats. If None (default), uses YYYY-MM-DD HH:mm:ss.

\n", - "default": null - }, + "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + } + ], + "returns": [ { - "name": "min_value", - "type_name": "datetime.datetime or None", + "type_name": "None or UploadedFile", + "is_generator": false, + "description": "

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/camera_input.py#L47" + }, + "DeltaGenerator.caption": { + "name": "caption", + "signature": "element.caption(self, body, unsafe_allow_html=False)", + "example": "
\n
\nst.caption('This is a string that explains something above.')\n
\n
\n", + "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", "is_optional": false, - "description": "

The minimum datetime that can be entered.\nIf None (default), there will be no minimum.

\n", + "description": "

The text to display.

\n", "default": null }, { - "name": "max_value", - "type_name": "datetime.datetime or None", + "name": "unsafe_allow_html", + "type_name": "bool", "is_optional": false, - "description": "

The maximum datetime that can be entered.\nIf None (default), there will be no maximum.

\n", - "default": null - }, - { - "name": "step", - "type_name": "int, float, datetime.timedelta, or None", - "is_optional": false, - "description": "

The stepping interval in seconds. If None (default), the step will be 1 second.

\n", - "default": null - }, - { - "name": "timezone", - "type_name": "str or None", - "is_optional": false, - "description": "

The timezone of this column. If None (default),\nthe timezone is inferred from the underlying data.

\n", + "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n

Also note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.

\n

If you decide to turn on HTML anyway, we ask you to please tell us your\nexact use case here:\nhttps://discuss.streamlit.io/t/96 .

\n

This will help us come up with safe APIs that allow you to do what you\nwant.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/lib/column_types.py#L1043" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/markdown.py#L189" }, - "streamlit.column_config.ImageColumn": { - "name": "ImageColumn", - "signature": "st.column_config.ImageColumn(label=None, *, width=None, help=None)", - "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "apps": [\n            "https://storage.googleapis.com/s4a-prod-share-preview/default/st_app_screenshot_image/5435b8cb-6c6c-490b-9608-799b543655d3/Home_Page.png",\n            "https://storage.googleapis.com/s4a-prod-share-preview/default/st_app_screenshot_image/ef9a7627-13f2-47e5-8f65-3f69bb38a5c2/Home_Page.png",\n            "https://storage.googleapis.com/s4a-prod-share-preview/default/st_app_screenshot_image/31b99099-8eae-4ff8-aa89-042895ed3843/Home_Page.png",\n            "https://storage.googleapis.com/s4a-prod-share-preview/default/st_app_screenshot_image/6a399b09-241e-4ae7-a31f-7640dc1d181e/Home_Page.png",\n        ],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "apps": st.column_config.ImageColumn(\n            "Preview Image", help="Streamlit app preview screenshots"\n        )\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Configure an image column in st.dataframe or st.data_editor.

\n

The cell values need to be one of:

\n
    \n
  • A URL to fetch the image from. This can also be a relative URL of an image\ndeployed via static file serving.\nNote that you can NOT use an arbitrary local image if it is not available through\na public URL.
  • \n
  • A data URL containing an SVG XML like data:image/svg+xml;utf8,<svg xmlns=...</svg>.
  • \n
  • A data URL containing a Base64 encoded image like data:image/png;base64,iVBO....
  • \n
\n

Image columns are not editable at the moment. This command needs to be used in the\ncolumn_config parameter of st.dataframe or st.data_editor.

\n", + "DeltaGenerator.checkbox": { + "name": "checkbox", + "signature": "element.checkbox(self, label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\nagree = st.checkbox('I agree')\n\nif agree:\n     st.write('Great!')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a checkbox widget.", "args": [ { "name": "label", - "type_name": "str or None", + "type_name": "str", "is_optional": false, - "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "description": "

A short label explaining to the user what this checkbox is for.

\n", "default": null }, { - "name": "width", - "type_name": "\"small\", \"medium\", \"large\", or None", + "name": "value", + "type_name": "bool", "is_optional": false, - "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "description": "

Preselect the checkbox when it first renders. This will be\ncast to bool internally.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", "default": null }, { "name": "help", - "type_name": "str or None", + "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "description": "

An optional tooltip that gets displayed next to the checkbox.

\n", "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/lib/column_types.py#L907" - }, - "streamlit.column_config.LineChartColumn": { - "name": "LineChartColumn", - "signature": "st.column_config.LineChartColumn(label=None, *, width=None, help=None, y_min=None, y_max=None)", - "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "sales": [\n            [0, 4, 26, 80, 100, 40],\n            [80, 20, 80, 35, 40, 100],\n            [10, 20, 80, 80, 70, 0],\n            [10, 100, 20, 100, 30, 100],\n        ],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "sales": st.column_config.LineChartColumn(\n            "Sales (last 6 months)",\n            width="medium",\n            help="The sales volume in the last 6 months",\n            y_min=0,\n            y_max=100,\n         ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Configure a line chart column in st.dataframe or st.data_editor.

\n

Cells need to contain a list of numbers. Chart columns are not editable\nat the moment. This command needs to be used in the column_config parameter\nof st.dataframe or st.data_editor.

\n", - "args": [ + }, { - "name": "label", - "type_name": "str or None", + "name": "on_change", + "type_name": "callable", "is_optional": false, - "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "description": "

An optional callback invoked when this checkbox's value changes.

\n", "default": null }, { - "name": "width", - "type_name": "\"small\", \"medium\", \"large\", or None", + "name": "args", + "type_name": "tuple", "is_optional": false, - "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "description": "

An optional tuple of args to pass to the callback.

\n", "default": null }, { - "name": "help", - "type_name": "str or None", + "name": "kwargs", + "type_name": "dict", "is_optional": false, - "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, { - "name": "y_min", - "type_name": "int, float, or None", + "name": "disabled", + "type_name": "bool", "is_optional": false, - "description": "

The minimum value on the y-axis for all cells in the column.\nIf None (default), every cell will use the minimum of its data.

\n", + "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

Whether or not the checkbox is checked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/checkbox.py#L36" + }, + "DeltaGenerator.code": { + "name": "code", + "signature": "element.code(self, body, language=\"python\")", + "example": "
\n
\ncode = '''def hello():\n     print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", + "description": "

Display a code block with optional syntax highlighting.

\n

(This is a convenience wrapper around st.markdown())

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as code.

\n", "default": null }, { - "name": "y_max", - "type_name": "int, float, or None", + "name": "language", + "type_name": "str", "is_optional": false, - "description": "

The maximum value on the y-axis for all cells in the column. If None (default),\nevery cell will use the maximum of its data.

\n", + "description": "

The language that the code is written in, for syntax highlighting.\nIf omitted, the code will be unstyled.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/lib/column_types.py#L826" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/markdown.py#L132" }, - "streamlit.column_config.LinkColumn": { - "name": "LinkColumn", - "signature": "st.column_config.LinkColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, max_chars=None, validate=None)", - "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "apps": [\n            "https://roadmap.streamlit.app",\n            "https://extras.streamlit.app",\n            "https://issues.streamlit.app",\n            "https://30days.streamlit.app",\n        ],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "apps": st.column_config.LinkColumn(\n            "Trending apps",\n            help="The top trending Streamlit apps",\n            validate="^https://[a-z]+\\.streamlit\\.app$",\n            max_chars=100,\n        )\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Configure a link column in st.dataframe or st.data_editor.

\n

The cell values need to be string and will be shown as clickable links.\nThis command needs to be used in the column_config parameter of st.dataframe\nor st.data_editor. When used with st.data_editor, editing will be enabled\nwith a text input widget.

\n", + "DeltaGenerator.color_picker": { + "name": "color_picker", + "signature": "element.color_picker(self, label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a color picker widget.", "args": [ { "name": "label", - "type_name": "str or None", + "type_name": "str", "is_optional": false, - "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "description": "

A short label explaining to the user what this input is for.

\n", "default": null }, { - "name": "width", - "type_name": "\"small\", \"medium\", \"large\", or None", + "name": "value", + "type_name": "str", "is_optional": false, - "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "description": "

The hex value of this widget when it first renders. If None,\ndefaults to black.

\n", + "default": "black." + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", "default": null }, { "name": "help", - "type_name": "str or None", + "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "description": "

An optional tooltip that gets displayed next to the color picker.

\n", "default": null }, { - "name": "disabled", - "type_name": "bool or None", + "name": "on_change", + "type_name": "callable", "is_optional": false, - "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", - "default": "False." + "description": "

An optional callback invoked when this color_picker's value\nchanges.

\n", + "default": null }, { - "name": "required", - "type_name": "bool or None", + "name": "args", + "type_name": "tuple", "is_optional": false, - "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", - "default": "False." + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null }, { - "name": "default", - "type_name": "str or None", + "name": "kwargs", + "type_name": "dict", "is_optional": false, - "description": "

Specifies the default value in this column when a new row is added by the user.

\n", - "default": "value" + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null }, { - "name": "max_chars", - "type_name": "int or None", + "name": "disabled", + "type_name": "bool", "is_optional": false, - "description": "

The maximum number of characters that can be entered. If None (default),\nthere will be no maximum.

\n", + "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The selected color as a hex string.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/color_picker.py#L35" + }, + "DeltaGenerator.columns": { + "name": "columns", + "signature": "element.columns(self, spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n    st.header("A cat")\n    st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n    st.header("A dog")\n    st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n    st.header("An owl")\n    st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put columns inside another column.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", "default": null }, { - "name": "validate", - "type_name": "str or None", + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", "is_optional": false, - "description": "

A regular expression (JS flavor, e.g. "^https://.+$") that edited values are validated against.\nIf the input is invalid, it will not be submitted.

\n", - "default": null + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null } ], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/layouts.py#L72" + }, + "DeltaGenerator.container": { + "name": "container", + "signature": "element.container(self)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.container():\n    st.write("This is inside the container")\n\n    # You can call any Streamlit command, including custom components:\n    st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/lib/column_types.py#L466" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/layouts.py#L28" }, - "streamlit.column_config.ListColumn": { - "name": "ListColumn", - "signature": "st.column_config.ListColumn(label=None, *, width=None, help=None)", - "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "sales": [\n            [0, 4, 26, 80, 100, 40],\n            [80, 20, 80, 35, 40, 100],\n            [10, 20, 80, 80, 70, 0],\n            [10, 100, 20, 100, 30, 100],\n        ],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "sales": st.column_config.ListColumn(\n            "Sales (last 6 months)",\n            help="The sales volume in the last 6 months",\n            width="medium",\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Configure a list column in st.dataframe or st.data_editor.

\n

This is the default column type for list-like values. List columns are not editable\nat the moment. This command needs to be used in the column_config parameter of\nst.dataframe or st.data_editor.

\n", + "DeltaGenerator.dataframe": { + "name": "dataframe", + "signature": "element.dataframe(self, data=None, width=None, height=None)", + "examples": "
\n
\ndf = pd.DataFrame(\n    np.random.randn(50, 20),\n    columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\nst.dataframe(df, 200, 100)\n
\n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\ndf = pd.DataFrame(\n    np.random.randn(10, 20),\n    columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a dataframe as an interactive table.", "args": [ { - "name": "label", - "type_name": "str or None", + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", "is_optional": false, - "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderyling DataFrame. Streamlit supports custom cell\nvalues and colors. (It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.)\nStyler support is experimental!\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null }, { "name": "width", - "type_name": "\"small\", \"medium\", \"large\", or None", + "type_name": "int or None", "is_optional": false, - "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", - "default": null + "description": "

Desired width of the UI element expressed in pixels. If None, a\ndefault width based on the page width is used.

\n", + "default": "width" }, { - "name": "help", - "type_name": "str or None", + "name": "height", + "type_name": "int or None", "is_optional": false, - "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", - "default": null + "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/lib/column_types.py#L978" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/dataframe_selector.py#L37" }, - "streamlit.column_config.NumberColumn": { - "name": "NumberColumn", - "signature": "st.column_config.NumberColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, format=None, min_value=None, max_value=None, step=None)", - "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "price": [20, 950, 250, 500],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "price": st.column_config.NumberColumn(\n            "Price (in USD)",\n            help="The price of the product in USD",\n            min_value=0,\n            max_value=1000,\n            step=1,\n            format="$%d",\n        )\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Configure a number column in st.dataframe or st.data_editor.

\n

This is the default column type for integer and float values. This command needs to\nbe used in the column_config parameter of st.dataframe or st.data_editor.\nWhen used with st.data_editor, editing will be enabled with a numeric input widget.

\n", + "DeltaGenerator.date_input": { + "name": "date_input", + "signature": "element.date_input(self, label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\nd = st.date_input(\n     "When's your birthday",\n     datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a date input widget.", "args": [ { "name": "label", - "type_name": "str or None", + "type_name": "str", "is_optional": false, - "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "description": "

A short label explaining to the user what this date input is for.

\n", "default": null }, { - "name": "width", - "type_name": "\"small\", \"medium\", \"large\", or None", + "name": "value", + "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", "is_optional": false, - "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", - "default": null + "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", + "default": "today" }, { - "name": "help", - "type_name": "str or None", + "name": "min_value", + "type_name": "datetime.date or datetime.datetime", "is_optional": false, - "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", - "default": null + "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", + "default": "value" }, { - "name": "disabled", - "type_name": "bool or None", + "name": "max_value", + "type_name": "datetime.date or datetime.datetime", "is_optional": false, - "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", - "default": "False." + "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", + "default": "value" }, { - "name": "required", - "type_name": "bool or None", + "name": "key", + "type_name": "str or int", "is_optional": false, - "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", - "default": "False." + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null }, { - "name": "default", - "type_name": "int, float, or None", + "name": "help", + "type_name": "str", "is_optional": false, - "description": "

Specifies the default value in this column when a new row is added by the user.

\n", - "default": "value" + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null }, { - "name": "format", - "type_name": "str or None", + "name": "on_change", + "type_name": "callable", "is_optional": false, - "description": "

A printf-style format string controlling how numbers are displayed.\nThis does not impact the return value. Valid formatters: %d %e %f %g %i %u.\nYou can also add prefixes and suffixes, e.g. "$ %.2f" to show a dollar prefix.

\n", + "description": "

An optional callback invoked when this date_input's value changes.

\n", "default": null }, { - "name": "min_value", - "type_name": "int, float, or None", + "name": "args", + "type_name": "tuple", "is_optional": false, - "description": "

The minimum value that can be entered.\nIf None (default), there will be no minimum.

\n", + "description": "

An optional tuple of args to pass to the callback.

\n", "default": null }, { - "name": "max_value", - "type_name": "int, float, or None", + "name": "kwargs", + "type_name": "dict", "is_optional": false, - "description": "

The maximum value that can be entered.\nIf None (default), there will be no maximum.

\n", + "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, { - "name": "step", - "type_name": "int, float, or None", + "name": "disabled", + "type_name": "bool", "is_optional": false, - "description": "

The stepping interval. Specifies the precision of numbers that can be entered.\nIf None (default), uses 1 for integers and unrestricted precision for floats.

\n", - "default": null + "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." } ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/lib/column_types.py#L262" + "returns": [ + { + "type_name": "datetime.date or a tuple with 0-2 dates", + "is_generator": false, + "description": "

The current value of the date input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/time_widgets.py#L305" }, - "streamlit.column_config.ProgressColumn": { - "name": "ProgressColumn", - "signature": "st.column_config.ProgressColumn(label=None, *, width=None, help=None, format=None, min_value=None, max_value=None)", - "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "sales": [200, 550, 1000, 80],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "sales": st.column_config.ProgressColumn(\n            "Sales volume",\n            help="The sales volume in USD",\n            format="$%f",\n            min_value=0,\n            max_value=1000,\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Configure a progress column in st.dataframe or st.data_editor.

\n

Cells need to contain a number. Progress columns are not editable at the moment.\nThis command needs to be used in the column_config parameter of st.dataframe\nor st.data_editor.

\n", + "DeltaGenerator.determine_delta_color_and_direction": { + "name": "determine_delta_color_and_direction", + "signature": "element.determine_delta_color_and_direction(self, delta_color, delta)" + }, + "DeltaGenerator.download_button": { + "name": "download_button", + "signature": "element.download_button(self, label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False)", + "examples": "
\n

Download a large DataFrame as a CSV:

\n
\n@st.cache\n def convert_df(df):\n     # IMPORTANT: Cache the conversion to prevent computation on every rerun\n     return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n     label="Download data as CSV",\n     data=csv,\n     file_name='large_df.csv',\n     mime='text/csv',\n )\n
\n

Download a string as a file:

\n
\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nwith open("flower.png", "rb") as file:\n     btn = st.download_button(\n             label="Download image",\n             data=file,\n             file_name="flower.png",\n             mime="image/png"\n           )\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", "args": [ { "name": "label", - "type_name": "str or None", + "type_name": "str", "is_optional": false, - "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "description": "

A short label explaining to the user what this button is for.

\n", "default": null }, { - "name": "width", - "type_name": "\"small\", \"medium\", \"large\", or None", + "name": "data", + "type_name": "str or bytes or file", "is_optional": false, - "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "description": "

The contents of the file to be downloaded. See example below for\ncaching techniques to avoid recomputing this data unnecessarily.

\n", "default": null }, { - "name": "help", - "type_name": "str or None", + "name": "file_name", + "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "description": "

An optional string to use as the name of the file to be downloaded,\nsuch as 'my_file.csv'. If not specified, the name will be\nautomatically generated.

\n", "default": null }, { - "name": "format", + "name": "mime", "type_name": "str or None", "is_optional": false, - "description": "

A printf-style format string controlling how numbers are displayed.\nValid formatters: %d %e %f %g %i %u. You can also add prefixes and suffixes,\ne.g. "$ %.2f" to show a dollar prefix.

\n", - "default": null + "description": "

The MIME type of the data. If None, defaults to "text/plain"\n(if data is of type str or is a textual file) or\n"application/octet-stream" (if data is of type bytes or is a\nbinary file).

\n", + "default": "s" }, { - "name": "min_value", - "type_name": "int, float, or None", + "name": "key", + "type_name": "str or int", "is_optional": false, - "description": "

The minimum value of the progress bar.\nIf None (default), will be 0.

\n", + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", "default": null }, { - "name": "max_value", - "type_name": "int, float, or None", + "name": "help", + "type_name": "str", "is_optional": false, - "description": "

The minimum value of the progress bar. If None (default), will be 100 for\ninteger values and 1 for float values.

\n", + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/lib/column_types.py#L1391" - }, - "streamlit.column_config.SelectboxColumn": { - "name": "SelectboxColumn", - "signature": "st.column_config.SelectboxColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, options=None)", - "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "category": [\n            "\ud83d\udcca Data Exploration",\n            "\ud83d\udcc8 Data Visualization",\n            "\ud83e\udd16 LLM",\n            "\ud83d\udcca Data Exploration",\n        ],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "category": st.column_config.SelectboxColumn(\n            "App Category",\n            help="The category of the app",\n            width="medium",\n            options=[\n                "\ud83d\udcca Data Exploration",\n                "\ud83d\udcc8 Data Visualization",\n                "\ud83e\udd16 LLM",\n            ],\n            required=True,\n        )\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Configure a selectbox column in st.dataframe or st.data_editor.

\n

This is the default column type for Pandas categorical values. This command needs to\nbe used in the column_config parameter of st.dataframe or st.data_editor.\nWhen used with st.data_editor, editing will be enabled with a selectbox widget.

\n", - "args": [ + }, { - "name": "label", - "type_name": "str or None", + "name": "on_click", + "type_name": "callable", "is_optional": false, - "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "description": "

An optional callback invoked when this button is clicked.

\n", "default": null }, { - "name": "width", - "type_name": "\"small\", \"medium\", \"large\", or None", + "name": "args", + "type_name": "tuple", "is_optional": false, - "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "description": "

An optional tuple of args to pass to the callback.

\n", "default": null }, { - "name": "help", - "type_name": "str or None", + "name": "kwargs", + "type_name": "dict", "is_optional": false, - "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, { "name": "disabled", - "type_name": "bool or None", + "type_name": "bool", "is_optional": false, - "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", + "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", "default": "False." - }, + } + ], + "returns": [ { - "name": "required", - "type_name": "bool or None", - "is_optional": false, - "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", - "default": "False." - }, + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/button.py#L118" + }, + "DeltaGenerator.empty": { + "name": "empty", + "signature": "element.empty(self)", + "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport time\n\nwith st.empty():\n     for seconds in range(60):\n         st.write(f"\u23f3 {seconds} seconds have passed")\n         time.sleep(1)\n     st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n     st.write("This is one element")\n     st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", + "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/empty.py#L24" + }, + "DeltaGenerator.error": { + "name": "error", + "signature": "element.error(self, body)", + "example": "
\n
\nst.error('This is an error')\n
\n
\n", + "description": "Display error message.", + "args": [ { - "name": "default", - "type_name": "str, int, float, bool, or None", + "name": "body", + "type_name": "str", "is_optional": false, - "description": "

Specifies the default value in this column when a new row is added by the user.

\n", - "default": "value" - }, + "description": "

The error text to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/alert.py#L26" + }, + "DeltaGenerator.exception": { + "name": "exception", + "signature": "element.exception(self, exception)", + "example": "
\n
\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", + "description": "Display an exception.", + "args": [ { - "name": "options", - "type_name": "iterable of str or None", + "name": "exception", + "type_name": "Exception", "is_optional": false, - "description": "

The options that can be selected during editing. If None (default), this will be\ninferred from the underlying dataframe column if its dtype is \u201ccategory\u201d\n(see Pandas docs on categorical data).

\n", + "description": "

The exception to display.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/lib/column_types.py#L647" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/exception.py#L46" }, - "streamlit.column_config.TextColumn": { - "name": "TextColumn", - "signature": "st.column_config.TextColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, max_chars=None, validate=None)", - "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "widgets": ["st.selectbox", "st.number_input", "st.text_area", "st.button"],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "widgets": st.column_config.TextColumn(\n            "Widgets",\n            help="Streamlit **widget** commands \ud83c\udf88",\n            default="st.",\n            max_chars=50,\n            validate="^st\\.[a-z_]+$",\n        )\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Configure a text column in st.dataframe or st.data_editor.

\n

This is the default column type for string values. This command needs to be used in the\ncolumn_config parameter of st.dataframe or st.data_editor. When used with\nst.data_editor, editing will be enabled with a text input widget.

\n", + "DeltaGenerator.expander": { + "name": "expander", + "signature": "element.expander(self, label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n     st.write("""\n         The chart above shows some numbers I picked for you.\n         I rolled actual dice for these, so they're *guaranteed* to\n         be random.\n     """)\n     st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write("""\n     The chart above shows some numbers I picked for you.\n     I rolled actual dice for these, so they're *guaranteed* to\n     be random.\n """)\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", "args": [ { "name": "label", - "type_name": "str or None", + "type_name": "str", "is_optional": false, - "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "description": "

A string to use as the header for the expander.

\n", "default": null }, { - "name": "width", - "type_name": "\"small\", \"medium\", \"large\", or None", + "name": "expanded", + "type_name": "bool", "is_optional": false, - "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/layouts.py#L283" + }, + "DeltaGenerator.file_uploader": { + "name": "file_uploader", + "signature": "element.file_uploader(self, label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n     # To read file as bytes:\n     bytes_data = uploaded_file.getvalue()\n     st.write(bytes_data)\n\n     # To convert to a string based IO:\n     stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n     st.write(stringio)\n\n     # To read file as string:\n     string_data = stringio.read()\n     st.write(string_data)\n\n     # Can be used wherever a "file-like" object is accepted:\n     dataframe = pd.read_csv(uploaded_file)\n     st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n     bytes_data = uploaded_file.read()\n     st.write("filename:", uploaded_file.name)\n     st.write(bytes_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this file uploader is for.

\n", "default": null }, { - "name": "help", - "type_name": "str or None", + "name": "type", + "type_name": "str or list of str or None", "is_optional": false, - "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", - "default": null + "description": "

Array of allowed extensions. ['png', 'jpg']\nThe default is None, which means all extensions are allowed.

\n", + "default": "None" }, { - "name": "disabled", - "type_name": "bool or None", + "name": "accept_multiple_files", + "type_name": "bool", "is_optional": false, - "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", - "default": "False." + "description": "

If True, allows the user to upload multiple files at the same time,\nin which case the return value will be a list of files.\nDefault: False

\n", + "default": "False" }, { - "name": "required", - "type_name": "bool or None", + "name": "key", + "type_name": "str or int", "is_optional": false, - "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", - "default": "False." + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null }, { - "name": "default", - "type_name": "str or None", + "name": "help", + "type_name": "str", "is_optional": false, - "description": "

Specifies the default value in this column when a new row is added by the user.

\n", - "default": "value" + "description": "

A tooltip that gets displayed next to the file uploader.

\n", + "default": null }, { - "name": "max_chars", - "type_name": "int or None", + "name": "on_change", + "type_name": "callable", "is_optional": false, - "description": "

The maximum number of characters that can be entered. If None (default),\nthere will be no maximum.

\n", + "description": "

An optional callback invoked when this file_uploader's value\nchanges.

\n", "default": null }, { - "name": "validate", - "type_name": "str or None", + "name": "args", + "type_name": "tuple", "is_optional": false, - "description": "

A regular expression (JS flavor, e.g. "^[a-z]+$") that edited values are validated against.\nIf the input is invalid, it will not be submitted.

\n", + "description": "

An optional tuple of args to pass to the callback.

\n", "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/lib/column_types.py#L372" - }, - "streamlit.column_config.TimeColumn": { - "name": "TimeColumn", - "signature": "st.column_config.TimeColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, format=None, min_value=None, max_value=None, step=None)", - "examples": "
\n
\nfrom datetime import time\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "appointment": [\n            time(12, 30),\n            time(18, 0),\n            time(9, 10),\n            time(16, 25),\n        ]\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "appointment": st.column_config.TimeColumn(\n            "Appointment",\n            min_value=time(8, 0, 0),\n            max_value=time(19, 0, 0),\n            format="hh:mm a",\n            step=60,\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Configure a time column in st.dataframe or st.data_editor.

\n

This is the default column type for time values. This command needs to be used in\nthe column_config parameter of st.dataframe or st.data_editor. When\nused with st.data_editor, editing will be enabled with a time picker widget.

\n", - "args": [ + }, { - "name": "label", - "type_name": "str or None", + "name": "kwargs", + "type_name": "dict", "is_optional": false, - "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, { - "name": "width", - "type_name": "\"small\", \"medium\", \"large\", or None", + "name": "disabled", + "type_name": "bool", "is_optional": false, - "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", - "default": null - }, + "description": "

An optional boolean, which disables the file uploader if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + } + ], + "returns": [ { - "name": "help", - "type_name": "str or None", + "type_name": "None or UploadedFile or list of UploadedFile", + "is_generator": false, + "description": "
    \n
  • If accept_multiple_files is False, returns either None or\nan UploadedFile object.
  • \n
  • If accept_multiple_files is True, returns a list with the\nuploaded files as UploadedFile objects. If no files were\nuploaded, returns an empty list.
  • \n
\n

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/file_uploader.py#L132" + }, + "DeltaGenerator.form": { + "name": "form", + "signature": "element.form(self, key, clear_on_submit=False)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.form("my_form"):\n    st.write("Inside the form")\n    slider_val = st.slider("Form slider")\n    checkbox_val = st.checkbox("Form checkbox")\n\n    # Every form must have a submit button.\n    submitted = st.form_submit_button("Submit")\n    if submitted:\n        st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n

Inserting elements out of order:

\n
\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n
\n", + "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "key", + "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "description": "

A string that identifies the form. Each form must have its own\nkey. (This key is not displayed to the user in the interface.)

\n", "default": null }, { - "name": "disabled", - "type_name": "bool or None", + "name": "clear_on_submit", + "type_name": "bool", "is_optional": false, - "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", - "default": "False." - }, + "description": "

If True, all widgets inside the form will be reset to their default\nvalues after the user presses the Submit button. Defaults to False.\n(Note that Custom Components are unaffected by this flag, and\nwill not be reset to their defaults on form submission.)

\n", + "default": "values" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/form.py#L112" + }, + "DeltaGenerator.form_submit_button": { + "name": "form_submit_button", + "signature": "element.form_submit_button(self, label=\"Submit\", help=None, on_click=None, args=None, kwargs=None)", + "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", + "args": [ { - "name": "required", - "type_name": "bool or None", + "name": "label", + "type_name": "str", "is_optional": false, - "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", - "default": "False." + "description": "

A short label explaining to the user what this button is for.\nDefaults to "Submit".

\n", + "default": "s" }, { - "name": "default", - "type_name": "datetime.time or None", + "name": "help", + "type_name": "str or None", "is_optional": false, - "description": "

Specifies the default value in this column when a new row is added by the user.

\n", - "default": "value" + "description": "

A tooltip that gets displayed when the button is hovered over.\nDefaults to None.

\n", + "default": "None." }, { - "name": "format", - "type_name": "str or None", + "name": "on_click", + "type_name": "callable", "is_optional": false, - "description": "

A momentJS format string controlling how times are displayed. See\nmomentJS docs for available\nformats. If None (default), uses HH:mm:ss.

\n", + "description": "

An optional callback invoked when this button is clicked.

\n", "default": null }, { - "name": "min_value", - "type_name": "datetime.time or None", + "name": "args", + "type_name": "tuple", "is_optional": false, - "description": "

The minimum time that can be entered.\nIf None (default), there will be no minimum.

\n", + "description": "

An optional tuple of args to pass to the callback.

\n", "default": null }, { - "name": "max_value", - "type_name": "datetime.time or None", + "name": "kwargs", + "type_name": "dict", "is_optional": false, - "description": "

The maximum time that can be entered.\nIf None (default), there will be no maximum.

\n", + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/form.py#L200" + }, + "DeltaGenerator.graphviz_chart": { + "name": "graphviz_chart", + "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nimport graphviz as graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a graph using the dagre-d3 library.", + "args": [ + { + "name": "figure_or_dot", + "type_name": "graphviz.dot.Graph, graphviz.dot.Digraph, str", + "is_optional": false, + "description": "

The Graphlib graph object or dot string to display

\n", "default": null }, { - "name": "step", - "type_name": "int, float, datetime.timedelta, or None", + "name": "use_container_width", + "type_name": "bool", "is_optional": false, - "description": "

The stepping interval in seconds. If None (default), the step will be 1 second.

\n", + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/lib/column_types.py#L1164" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/graphviz_chart.py#L30" }, - "streamlit.components.v1.declare_component": { - "name": "declare_component", - "signature": "st.components.v1.declare_component(name, path=None, url=None)", - "description": "

Create and register a custom component.

\n", + "DeltaGenerator.header": { + "name": "header", + "signature": "element.header(self, body, anchor=None)", + "example": "
\n
\nst.header('This is a header')\n
\n
\n", + "description": "Display text in header formatting.", "args": [ { - "name": "name", + "name": "body", "type_name": "str", "is_optional": false, - "description": "

A short, descriptive name for the component. Like, "slider".

\n", - "default": null - }, - { - "name": "path", - "type_name": "str or None", - "is_optional": false, - "description": "

The path to serve the component's frontend files from. Either\npath or url must be specified, but not both.

\n", + "description": "

The text to display.

\n", "default": null }, { - "name": "url", - "type_name": "str or None", + "name": "anchor", + "type_name": "str", "is_optional": false, - "description": "

The URL that the component is served from. Either path or url\nmust be specified, but not both.

\n", + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", "default": null } ], - "returns": [ + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/markdown.py#L81" + }, + "DeltaGenerator.help": { + "name": "help", + "signature": "element.help(self, obj)", + "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nst.help(pandas.DataFrame)\n
\n

Want to quickly check what datatype is output by a certain function?\nTry:

\n
\nx = my_poorly_documented_function()\nst.help(x)\n
\n
\n", + "description": "

Display object's doc string, nicely formatted.

\n

Displays the doc string for this object.

\n", + "args": [ { - "type_name": "CustomComponent", - "is_generator": false, - "description": "

A CustomComponent that can be called like a function.\nCalling the component will create a new instance of the component\nin the Streamlit app.

\n", - "return_name": null + "name": "obj", + "type_name": "Object", + "is_optional": false, + "description": "

The object whose docstring should be displayed.

\n", + "default": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/components/v1/components.py#L262" + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/doc_string.py#L41" }, - "streamlit.components.v1.html": { - "name": "html", - "signature": "st.components.v1.html(html, width=None, height=None, scrolling=False)", - "description": "

Display an HTML string in an iframe.

\n", + "DeltaGenerator.image": { + "name": "image", + "signature": "element.image(self, image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", + "example": "
\n
\nfrom PIL import Image\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an image or list of images.", "args": [ { - "name": "html", - "type_name": "str", + "name": "image", + "type_name": "numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]", "is_optional": false, - "description": "

The HTML string to embed in the iframe.

\n", + "description": "

Monochrome image of shape (w,h) or (w,h,1)\nOR a color image of shape (w,h,3)\nOR an RGBA image of shape (w,h,4)\nOR a URL to fetch the image from\nOR a path of a local image file\nOR an SVG XML string like <svg xmlns=...</svg>\nOR a list of one of the above, to display multiple images.

\n", "default": null }, { - "name": "width", - "type_name": "int", + "name": "caption", + "type_name": "str or list of str", "is_optional": false, - "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", - "default": "the" + "description": "

Image caption. If displaying multiple images, caption should be a\nlist of captions (one for each image).

\n", + "default": null }, { - "name": "height", - "type_name": "int", + "name": "width", + "type_name": "int or None", "is_optional": false, - "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", - "default": "150." + "description": "

Image width. None means use the image width,\nbut do not exceed the width of the column.\nShould be set for SVG images, as they have no default image width.

\n", + "default": "image" }, { - "name": "scrolling", - "type_name": "bool", - "is_optional": false, - "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", - "default": "False." - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/iframe.py#L59" - }, - "streamlit.components.v1.iframe": { - "name": "iframe", - "signature": "st.components.v1.iframe(src, width=None, height=None, scrolling=False)", - "description": "

Load a remote URL in an iframe.

\n", - "args": [ - { - "name": "src", - "type_name": "str", + "name": "use_column_width", + "type_name": "'auto' or 'always' or 'never' or bool", "is_optional": false, - "description": "

The URL of the page to embed.

\n", + "description": "

If 'auto', set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf 'always' or True, set the image's width to the column width.\nIf 'never' or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", "default": null }, { - "name": "width", - "type_name": "int", + "name": "clamp", + "type_name": "bool", "is_optional": false, - "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", - "default": "the" + "description": "

Clamp image pixel values to a valid range ([0-255] per channel).\nThis is only meaningful for byte array images; the parameter is\nignored for image URLs. If this is not set, and an image has an\nout-of-range value, an error will be thrown.

\n", + "default": null }, { - "name": "height", - "type_name": "int", + "name": "channels", + "type_name": "'RGB' or 'BGR'", "is_optional": false, - "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", - "default": "150." + "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to 'RGB', meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to 'BGR', instead.

\n", + "default": "s" }, { - "name": "scrolling", - "type_name": "bool", + "name": "output_format", + "type_name": "'JPEG', 'PNG', or 'auto'", "is_optional": false, - "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", - "default": "False." + "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to 'auto' which identifies the compression type based\non the type and format of the image argument.

\n", + "default": "s" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/iframe.py#L25" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/image.py#L60" }, - "DeltaGenerator.add_rows": { - "name": "add_rows", - "signature": "element.add_rows(data=None, **kwargs)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf1 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table = st.table(df1)\n\ndf2 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table.add_rows(df2)\n# Now the table shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

You can do the same thing with plots. For example, if you want to add\nmore data to a line chart:

\n
\n# Assuming df1 and df2 from the example above still exist...\nmy_chart = st.line_chart(df1)\nmy_chart.add_rows(df2)\n# Now the chart shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

And for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:

\n
\nmy_chart = st.vega_lite_chart({\n    'mark': 'line',\n    'encoding': {'x': 'a', 'y': 'b'},\n    'datasets': {\n      'some_fancy_name': df1,  # <-- named dataset\n     },\n    'data': {'name': 'some_fancy_name'},\n}),\nmy_chart.add_rows(some_fancy_name=df2)  # <-- name used as keyword\n
\n
\n", - "description": "

Concatenate a dataframe to the bottom of the current one.

\n", + "DeltaGenerator.info": { + "name": "info", + "signature": "element.info(self, body)", + "example": "
\n
\nst.info('This is a purely informational message')\n
\n
\n", + "description": "Display an informational message.", "args": [ { - "name": "data", - "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, Iterable, dict, or None", - "is_optional": false, - "description": "

Table to concat. Optional.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", - "default": null - }, - { - "name": "**kwargs", - "type_name": "pandas.DataFrame, numpy.ndarray, Iterable, dict, or None", + "name": "body", + "type_name": "str", "is_optional": false, - "description": "

The named dataset to concat. Optional. You can only pass in 1\ndataset (including the one in the data parameter).

\n", + "description": "

The info text to display.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L894" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/alert.py#L62" }, - "DeltaGenerator.altair_chart": { - "name": "altair_chart", - "signature": "element.altair_chart(altair_chart, use_container_width=False, theme=\"streamlit\")", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(chart_data).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n
\n", - "description": "

Display a chart using the Altair library.

\n", + "DeltaGenerator.is_negative": { + "name": "is_negative", + "signature": "element.is_negative(delta)" + }, + "DeltaGenerator.json": { + "name": "json", + "signature": "element.json(self, body, *, expanded=True)", + "example": "
\n
\nst.json({\n     'foo': 'bar',\n     'baz': 'boz',\n     'stuff': [\n         'stuff 1',\n         'stuff 2',\n         'stuff 3',\n         'stuff 5',\n     ],\n })\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display object or string as a pretty-printed JSON string.", "args": [ { - "name": "altair_chart", - "type_name": "altair.Chart", + "name": "body", + "type_name": "Object or str", "is_optional": false, - "description": "

The Altair chart object to display.

\n", + "description": "

The object to print as JSON. All referenced objects should be\nserializable to JSON as well. If object is a string, we assume it\ncontains serialized JSON.

\n", "default": null }, { - "name": "use_container_width", + "name": "expanded", "type_name": "bool", "is_optional": false, - "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", - "default": null - }, - { - "name": "theme", - "type_name": "\"streamlit\" or None", - "is_optional": false, - "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", - "default": "behavior" + "description": "

An optional boolean that allows the user to set whether the initial\nstate of this json element should be expanded. Defaults to True.\nThis argument can only be supplied by keyword.

\n", + "default": "True." } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L766" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/json.py#L28" }, - "DeltaGenerator.area_chart": { - "name": "area_chart", - "signature": "element.area_chart(data=None, *, x=None, y=None, color=None, width=0, height=0, use_container_width=True)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns = ['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n

You can also choose different columns to use for x and y, as well as set\nthe color dynamically based on a 3rd column (assuming your dataframe is in\nlong format):

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame({\n    'col1' : np.random.randn(20),\n    'col2' : np.random.randn(20),\n    'col3' : np.random.choice(['A', 'B', 'C'], 20)\n})\n\nst.area_chart(\n    chart_data,\n    x = 'col1',\n    y = 'col2',\n    color = 'col3'\n)\n
\n\n \n

Finally, if your dataframe is in wide format, you can group multiple\ncolumns under the y argument to show multiple series with different\ncolors:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['col1', 'col2', 'col3'])\n\nst.area_chart(\n    chart_data,\n    x='col1',\n    y=['col2', 'col3'],\n    color=['#FF0000','#0000FF']  # Optional\n)\n
\n\n \n
\n", - "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "DeltaGenerator.latex": { + "name": "latex", + "signature": "element.latex(self, body)", + "example": "
\n
\nst.latex(r'''\n     a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n     \\sum_{k=0}^{n-1} ar^k =\n     a \\left(\\frac{1-r^{n}}{1-r}\\right)\n     ''')\n
\n
\n", + "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", "args": [ { - "name": "data", - "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", - "is_optional": false, - "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", - "default": null - }, - { - "name": "x", - "type_name": "str or None", + "name": "body", + "type_name": "str or SymPy expression", "is_optional": false, - "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", "default": null - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/markdown.py#L232" + }, + "DeltaGenerator.line_chart": { + "name": "line_chart", + "signature": "element.line_chart(self, data=None, width=0, height=0, use_container_width=True)", + "example": "
\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 \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ { - "name": "y", - "type_name": "str, sequence of str, or None", + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict or None", "is_optional": false, - "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null }, - { - "name": "color", - "type_name": "str, tuple, sequence of str, sequence of tuple, or None", - "is_optional": false, - "description": "

The color to use for different series in this chart. This argument\ncan only be supplied by keyword.

\n

For an area chart with just 1 series, this can be:

\n
    \n
  • None, to use the default color.
  • \n
  • A hex string like "#ffaa00" or "#ffaa0088".
  • \n
  • An RGB or RGBA tuple with the red, green, blue, and alpha\ncomponents specified as ints from 0 to 255 or floats from 0.0 to\n1.0.
  • \n
\n

For an area chart with multiple series, where the dataframe is in\nlong format (that is, y is None or just one column), this can be:

\n
    \n
  • None, to use the default colors.

    \n
  • \n
  • The name of a column in the dataset. Data points will be grouped\ninto series of the same color based on the value of this column.\nIn addition, if the values in this column match one of the color\nformats above (hex string or color tuple), then that color will\nbe used.

    \n

    For example: if the dataset has 1000 rows, but this column can\nonly contains the values "adult", "child", "baby",\nthen those 1000 datapoints will be grouped into 3 series, whose\ncolors will be automatically selected from the default palette.

    \n

    But, if for the same 1000-row dataset, this column contained\nthe values "#ffaa00", "#f0f", "#0000ff", then then those 1000\ndatapoints would still be grouped into 3 series, but their\ncolors would be "#ffaa00", "#f0f", "#0000ff" this time around.

    \n
  • \n
\n

For an area chart with multiple series, where the dataframe is in\nwide format (that is, y is a sequence of columns), this can be:

\n
    \n
  • None, to use the default colors.
  • \n
  • A list of string colors or color tuples to be used for each of\nthe series in the chart. This list should have the same length\nas the number of y values (e.g. color=["#fd0", "#f0f", "#04f"]\nfor three lines).
  • \n
\n", - "default": "color." - }, { "name": "width", "type_name": "int", "is_optional": false, - "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "description": "

The chart width in pixels. If 0, selects the width automatically.

\n", "default": null }, { "name": "height", "type_name": "int", "is_optional": false, - "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "description": "

The chart height in pixels. If 0, selects the height automatically.

\n", "default": null }, { "name": "use_container_width", "type_name": "bool", "is_optional": false, - "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L409" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/dataframe_selector.py#L132" }, - "DeltaGenerator.audio": { - "name": "audio", - "signature": "element.audio(data, format=\"audio/wav\", start_time=0, *, sample_rate=None)", - "example": "
\n
\nimport streamlit as st\nimport numpy as np\n\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n\nsample_rate = 44100  # 44100 samples per second\nseconds = 2  # Note duration of 2 seconds\nfrequency_la = 440  # Our played note will be 440 Hz\n# Generate array with seconds*sample_rate steps, ranging between 0 and seconds\nt = np.linspace(0, seconds, seconds * sample_rate, False)\n# Generate a 440 Hz sine wave\nnote_la = np.sin(frequency_la * t * 2 * np.pi)\n\nst.audio(note_la, sample_rate=sample_rate)\n
\n\n \n
\n", - "description": "

Display an audio player.

\n", + "DeltaGenerator.map": { + "name": "map", + "signature": "element.map(self, data=None, zoom=None, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n     np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n     columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a map with points on it.

\n

This is a wrapper around st.pydeck_chart to quickly create scatterplot\ncharts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more\ninfo on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", "args": [ { "name": "data", - "type_name": "str, bytes, BytesIO, numpy.ndarray, or file", - "is_optional": false, - "description": "

Raw audio data, filename, or a URL pointing to the file to load.\nRaw data formats must include all necessary file headers to match the file\nformat specified via format.\nIf data is a numpy array, it must either be a 1D array of the waveform\nor a 2D array of shape (num_channels, num_samples) with waveforms\nfor all channels. See the default channel order at\nhttp://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx

\n", - "default": "channel" - }, - { - "name": "format", - "type_name": "str", - "is_optional": false, - "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", - "default": "s" - }, - { - "name": "start_time", - "type_name": "int", + "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,", "is_optional": false, - "description": "

The time from which this element should start playing.

\n", + "description": "

or None\nThe data to be plotted. Must have columns called 'lat', 'lon',\n'latitude', or 'longitude'.

\n", "default": null }, { - "name": "sample_rate", - "type_name": "int or None", + "name": "zoom", + "type_name": "int", "is_optional": false, - "description": "

The sample rate of the audio data in samples per second. Only required if\ndata is a numpy array.

\n", + "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/media.py#L42" - }, - "DeltaGenerator.balloons": { - "name": "balloons", - "signature": "element.balloons()", - "example": "
\n
\nimport streamlit as st\n\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", - "description": "

Draw celebratory balloons.

\n", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/balloons.py#L25" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/map.py#L31" }, - "DeltaGenerator.bar_chart": { - "name": "bar_chart", - "signature": "element.bar_chart(data=None, *, x=None, y=None, color=None, width=0, height=0, use_container_width=True)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n

You can also choose different columns to use for x and y, as well as set\nthe color dynamically based on a 3rd column (assuming your dataframe is in\nlong format):

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame({\n    'col1' : np.random.randn(20),\n    'col2' : np.random.randn(20),\n    'col3' : np.random.choice(['A','B','C'],20)\n})\n\nst.bar_chart(\n    chart_data,\n    x='col1',\n    y='col2',\n    color='col3'\n)\n
\n\n \n

Finally, if your dataframe is in wide format, you can group multiple\ncolumns under the y argument to show multiple series with different\ncolors:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['col1', 'col2', 'col3'])\n\nst.bar_chart(\n    chart_data,\n    x='col1',\n    y=['col2', 'col3'],\n    color=['#FF0000','#0000FF']  # Optional\n)\n
\n\n \n
\n", - "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "DeltaGenerator.markdown": { + "name": "markdown", + "signature": "element.markdown(self, body, unsafe_allow_html=False)", + "example": "
\n
\nst.markdown('Streamlit is **_really_ cool**.')\n
\n
\n", + "description": "Display string formatted as Markdown.", "args": [ { - "name": "data", - "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "name": "body", + "type_name": "str", "is_optional": false, - "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n\n", "default": null }, { - "name": "x", - "type_name": "str or None", + "name": "unsafe_allow_html", + "type_name": "bool", "is_optional": false, - "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n

Also note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.

\n

If you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:

\n

https://discuss.streamlit.io/t/96

\n

This will help us come up with safe APIs that allow you to do what\nyou want.

\n", "default": null - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/markdown.py#L28" + }, + "DeltaGenerator.metric": { + "name": "metric", + "signature": "element.metric(self, label, value, delta=None, delta_color=\"normal\", help=None)", + "example": "
\n
\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n \n (view standalone Streamlit app)\n \n

st.metric looks especially nice in combination with st.columns:

\n
\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n \n (view standalone Streamlit app)\n \n

The delta indicator color can also be inverted or turned off:

\n
\nst.metric(label="Gas price", value=4, delta=-0.5,\n     delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n     delta_color="off")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", + "args": [ { - "name": "y", - "type_name": "str, sequence of str, or None", + "name": "label", + "type_name": "str", "is_optional": false, - "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "description": "

The header or Title for the metric

\n", "default": null }, { - "name": "color", - "type_name": "str, tuple, sequence of str, sequence of tuple, or None", + "name": "value", + "type_name": "int, float, str, or None", "is_optional": false, - "description": "

The color to use for different series in this chart. This argument\ncan only be supplied by keyword.

\n

For a bar chart with just 1 series, this can be:

\n
    \n
  • None, to use the default color.
  • \n
  • A hex string like "#ffaa00" or "#ffaa0088".
  • \n
  • An RGB or RGBA tuple with the red, green, blue, and alpha\ncomponents specified as ints from 0 to 255 or floats from 0.0 to\n1.0.
  • \n
\n

For a bar chart with multiple series, where the dataframe is in\nlong format (that is, y is None or just one column), this can be:

\n
    \n
  • None, to use the default colors.

    \n
  • \n
  • The name of a column in the dataset. Data points will be grouped\ninto series of the same color based on the value of this column.\nIn addition, if the values in this column match one of the color\nformats above (hex string or color tuple), then that color will\nbe used.

    \n

    For example: if the dataset has 1000 rows, but this column can\nonly contains the values "adult", "child", "baby",\nthen those 1000 datapoints will be grouped into 3 series, whose\ncolors will be automatically selected from the default palette.

    \n

    But, if for the same 1000-row dataset, this column contained\nthe values "#ffaa00", "#f0f", "#0000ff", then then those 1000\ndatapoints would still be grouped into 3 series, but their\ncolors would be "#ffaa00", "#f0f", "#0000ff" this time around.

    \n
  • \n
\n

For a bar chart with multiple series, where the dataframe is in\nwide format (that is, y is a sequence of columns), this can be:

\n
    \n
  • None, to use the default colors.
  • \n
  • A list of string colors or color tuples to be used for each of\nthe series in the chart. This list should have the same length\nas the number of y values (e.g. color=["#fd0", "#f0f", "#04f"]\nfor three lines).
  • \n
\n", - "default": "color." + "description": "

Value of the metric. None is rendered as a long dash.

\n", + "default": null }, { - "name": "width", - "type_name": "int", + "name": "delta", + "type_name": "int, float, str, or None", "is_optional": false, - "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "description": "

Indicator of how the metric changed, rendered with an arrow below\nthe metric. If delta is negative (int/float) or starts with a minus\nsign (str), the arrow points down and the text is red; else the\narrow points up and the text is green. If None (default), no delta\nindicator is shown.

\n", "default": null }, { - "name": "height", - "type_name": "int", + "name": "delta_color", + "type_name": "str", "is_optional": false, - "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", "default": null }, { - "name": "use_container_width", - "type_name": "bool", + "name": "help", + "type_name": "str", "is_optional": false, - "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "description": "

An optional tooltip that gets displayed next to the metric label.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L587" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/metric.py#L43" }, - "DeltaGenerator.bokeh_chart": { - "name": "bokeh_chart", - "signature": "element.bokeh_chart(figure, use_container_width=False)", - "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n
\n", - "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", + "DeltaGenerator.multiselect": { + "name": "multiselect", + "signature": "element.multiselect(self, label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\noptions = st.multiselect(\n     'What are your favorite colors',\n     ['Green', 'Yellow', 'Red', 'Blue'],\n     ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", "args": [ { - "name": "figure", - "type_name": "bokeh.plotting.figure.Figure", + "name": "label", + "type_name": "str", "is_optional": false, - "description": "

A Bokeh figure to plot.

\n", + "description": "

A short label explaining to the user what this select widget is for.

\n", "default": null }, { - "name": "use_container_width", - "type_name": "bool", + "name": "options", + "type_name": "Sequence[V], numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", "is_optional": false, - "description": "

If True, set the chart width to the column width. This takes\nprecedence over Bokeh's native width value.

\n", - "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/bokeh_chart.py#L36" - }, - "DeltaGenerator.button": { - "name": "button", - "signature": "element.button(label, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", - "example": "
\n
\nimport streamlit as st\n\nst.button("Reset", type="primary")\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n
\n", - "description": "

Display a button widget.

\n", - "args": [ + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, { - "name": "label", - "type_name": "str", + "name": "default", + "type_name": "[V], V, or None", "is_optional": false, - "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "description": "

List of default values. Can also be a single value.

\n", + "default": "values." + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of selectbox options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe multiselect.

\n", "default": null }, { @@ -5453,14 +4378,14 @@ "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "description": "

An optional tooltip that gets displayed next to the multiselect.

\n", "default": null }, { - "name": "on_click", + "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this button is clicked.

\n", + "description": "

An optional callback invoked when this multiselect's value changes.

\n", "default": null }, { @@ -5477,75 +4402,96 @@ "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, - { - "name": "type", - "type_name": "\"secondary\" or \"primary\"", - "is_optional": false, - "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", - "default": "s" - }, { "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "description": "

An optional boolean, which disables the multiselect widget if set\nto True. The default is False. This argument can only be supplied\nby keyword.

\n", "default": "False." - }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", - "default": null } ], "returns": [ { - "type_name": "bool", + "type_name": "list", "is_generator": false, - "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "description": "

A list with the selected options

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/button.py#L61" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/multiselect.py#L45" }, - "DeltaGenerator.camera_input": { - "name": "camera_input", - "signature": "element.camera_input(label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", - "description": "

Display a widget that returns pictures from the user's webcam.

\n", + "DeltaGenerator.number_input": { + "name": "number_input", + "signature": "element.number_input(self, label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a numeric input widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this widget is used for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this input is for.

\n", "default": null }, { - "name": "key", - "type_name": "str or int", + "name": "min_value", + "type_name": "int or float or None", "is_optional": false, - "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", "default": null }, { - "name": "help", - "type_name": "str", + "name": "max_value", + "type_name": "int or float or None", "is_optional": false, - "description": "

A tooltip that gets displayed next to the camera input.

\n", + "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", "default": null }, { - "name": "on_change", - "type_name": "callable", + "name": "value", + "type_name": "int or float or None", "is_optional": false, - "description": "

An optional callback invoked when this camera_input's value\nchanges.

\n", - "default": null + "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", + "default": "min_value" }, { - "name": "args", - "type_name": "tuple", + "name": "step", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. Output must be purely numeric. This does not impact\nthe return value. Valid formatters: %d %e %f %g %i %u

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this number_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", "is_optional": false, "description": "

An optional tuple of args to pass to the callback.

\n", "default": null @@ -5561,97 +4507,189 @@ "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "description": "

An optional boolean, which disables the number input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" } ], "returns": [ { - "type_name": "None or UploadedFile", + "type_name": "int or float", "is_generator": false, - "description": "

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "description": "

The current value of the numeric input widget. The return type\nwill match the data type of the value parameter.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/camera_input.py#L78" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/number_input.py#L39" }, - "DeltaGenerator.caption": { - "name": "caption", - "signature": "element.caption(body, unsafe_allow_html=False, *, help=None)", - "examples": "
\n
\nimport streamlit as st\n\nst.caption('This is a string that explains something above.')\nst.caption('A caption with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", - "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", + "DeltaGenerator.parse_delta": { + "name": "parse_delta", + "signature": "element.parse_delta(delta)" + }, + "DeltaGenerator.parse_label": { + "name": "parse_label", + "signature": "element.parse_label(label)" + }, + "DeltaGenerator.parse_value": { + "name": "parse_value", + "signature": "element.parse_value(value)" + }, + "DeltaGenerator.plotly_chart": { + "name": "plotly_chart", + "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)", + "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport plotly.figure_factory as ff\nimport numpy as np\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n         hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", "args": [ { - "name": "body", - "type_name": "str", + "name": "figure_or_data", + "type_name": "plotly.graph_objs.Figure, plotly.graph_objs.Data,", "is_optional": false, - "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", + "description": "

dict/list of plotly.graph_objs.Figure/Data

\n

See https://plot.ly/python/ for examples of graph descriptions.

\n", "default": null }, { - "name": "unsafe_allow_html", + "name": "use_container_width", "type_name": "bool", "is_optional": false, - "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", "default": null }, { - "name": "help", - "type_name": "str", + "name": "sharing", + "type_name": "{'streamlit', 'private', 'secret', 'public'}", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the caption.

\n", + "description": "

Use 'streamlit' to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plotly.com/chart-studio/ for more information.

\n", + "default": null + }, + { + "name": "**kwargs", + "type_name": null, + "is_optional": null, + "description": "

Any argument accepted by Plotly's plot() function.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/markdown.py#L146" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/plotly_chart.py#L67" }, - "DeltaGenerator.chat_input": { - "name": "chat_input", - "signature": "element.chat_input(placeholder=\"Your message\", *, key=None, max_chars=None, disabled=False, on_submit=None, args=None, kwargs=None)", - "examples": "
\n
\nimport streamlit as st\n\nprompt = st.chat_input("Say something")\nif prompt:\n    st.write(f"User has sent the following prompt: {prompt}")\n
\n\n \n
\n", - "description": "

Display a chat input widget.

\n
\n

Warning

\n

Chat input can only be used once per app page and inside the main area of the app.\nIt cannot be used in the sidebar, columns, expanders, forms or tabs.\nWe plan to support this in the future.

\n
\n", + "DeltaGenerator.progress": { + "name": "progress", + "signature": "element.progress(self, value)", + "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport time\n\nmy_bar = st.progress(0)\n\nfor percent_complete in range(100):\n     time.sleep(0.1)\n     my_bar.progress(percent_complete + 1)\n
\n
\n", + "description": "Display a progress bar.", "args": [ { - "name": "placeholder", + "name": "value", + "type_name": "int or float", + "is_optional": false, + "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/progress.py#L31" + }, + "DeltaGenerator.pydeck_chart": { + "name": "pydeck_chart", + "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)", + "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:

\n
\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n     map_style='mapbox://styles/mapbox/light-v9',\n     initial_view_state=pdk.ViewState(\n         latitude=37.76,\n         longitude=-122.4,\n         zoom=11,\n         pitch=50,\n     ),\n     layers=[\n         pdk.Layer(\n            'HexagonLayer',\n            data=df,\n            get_position='[lon, lat]',\n            radius=200,\n            elevation_scale=4,\n            elevation_range=[0, 1000],\n            pickable=True,\n            extruded=True,\n         ),\n         pdk.Layer(\n             'ScatterplotLayer',\n             data=df,\n             get_position='[lon, lat]',\n             get_color='[200, 30, 0, 160]',\n             get_radius=200,\n         ),\n     ],\n ))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "spec", + "type_name": "pydeck.Deck or None", + "is_optional": false, + "description": "

Object specifying the PyDeck chart to draw.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/deck_gl_json_chart.py#L23" + }, + "DeltaGenerator.pyplot": { + "name": "pyplot", + "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)", + "notes": "
\n
\n

Note

\n

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

\n
\n

Matplotlib support several different types of "backends". If you're\ngetting an error using Matplotlib with Streamlit, try setting your\nbackend to "TkAgg":

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", + "example": "
\n
\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a matplotlib.pyplot figure.", + "args": [ + { + "name": "fig", + "type_name": "Matplotlib Figure", + "is_optional": false, + "description": "

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

\n", + "default": null + }, + { + "name": "clear_figure", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", + "default": "based" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Arguments to pass to Matplotlib's savefig function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/pyplot.py#L31" + }, + "DeltaGenerator.radio": { + "name": "radio", + "signature": "element.radio(self, label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False)", + "example": "
\n
\ngenre = st.radio(\n     "What's your favorite movie genre",\n     ('Comedy', 'Drama', 'Documentary'))\n\nif genre == 'Comedy':\n     st.write('You selected comedy.')\n else:\n     st.write("You didn't select comedy.")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a radio button widget.", + "args": [ + { + "name": "label", "type_name": "str", "is_optional": false, - "description": "

A placeholder text shown when the chat input is empty. Defaults to\n"Your message". For accessibility reasons, you should not use an\nempty string.

\n", - "default": "s" + "description": "

A short label explaining to the user what this radio group is for.

\n", + "default": null }, { - "name": "key", - "type_name": "str or int", + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", "is_optional": false, - "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget based on\nits content. Multiple widgets of the same type may not share the same key.

\n", + "description": "

Labels for the radio options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", "default": null }, { - "name": "max_chars", - "type_name": "int or None", + "name": "format_func", + "type_name": "function", "is_optional": false, - "description": "

The maximum number of characters that can be entered. If None\n(default), there will be no maximum.

\n", + "description": "

Function to modify the display of radio options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe radio.

\n", "default": null }, { - "name": "disabled", - "type_name": "bool", + "name": "key", + "type_name": "str or int", "is_optional": false, - "description": "

Whether the chat input should be disabled. Defaults to False.

\n", - "default": "False." + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null }, { - "name": "on_submit", + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the radio.

\n", + "default": null + }, + { + "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when the chat input's value is submitted.

\n", + "description": "

An optional callback invoked when this radio's value changes.

\n", "default": null }, { @@ -5667,67 +4705,64 @@ "is_optional": false, "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null - } - ], - "returns": [ - { - "type_name": "str or None", - "is_generator": false, - "description": "

The current (non-empty) value of the text input widget on the last\nrun of the app, None otherwise.

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/chat.py#L214" - }, - "DeltaGenerator.chat_message": { - "name": "chat_message", - "signature": "element.chat_message(name, *, avatar=None)", - "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\nimport numpy as np\n\nwith st.chat_message("user"):\n    st.write("Hello \ud83d\udc4b")\n    st.line_chart(np.random.randn(30, 3))\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\nmessage = st.chat_message("assistant")\nmessage.write("Hello human")\nmessage.bar_chart(np.random.randn(30, 3))\n
\n\n \n
\n", - "description": "

Insert a chat message container.

\n

To add elements to the returned container, you can use with notation\n(preferred) or just call methods directly on the returned object. See the\nexamples below.

\n", - "args": [ + }, { - "name": "name", - "type_name": "\"user\", \"assistant\", \"ai\", \"human\", or str", + "name": "disabled", + "type_name": "bool", "is_optional": false, - "description": "

The name of the message author. Can be "human"/"user" or\n"ai"/"assistant" to enable preset styling and avatars.

\n

Currently, the name is not shown in the UI but is only set as an\naccessibility label. For accessibility reasons, you should not use\nan empty string.

\n", - "default": null + "description": "

An optional boolean, which disables the radio button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." }, { - "name": "avatar", - "type_name": "str, numpy.ndarray, or BytesIO", + "name": "horizontal", + "type_name": "bool", "is_optional": false, - "description": "

The avatar shown next to the message. Can be one of:

\n
    \n
  • A single emoji, e.g. "\ud83e\uddd1\u200d\ud83d\udcbb", "\ud83e\udd16", "\ud83e\udd96". Shortcodes are not supported.
  • \n
  • \n
    An image using one of the formats allowed for st.image: path of a local
    \n
    image file; URL to fetch the image from; array of shape (w,h) or (w,h,1)\nfor a monochrome image, (w,h,3) for a color image, or (w,h,4) for an RGBA image.
    \n
    \n
  • \n
\n

If None (default), uses default icons if name is "user",\n"assistant", "ai", "human" or the first letter of the name value.

\n", - "default": "icons" + "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", + "default": "false" } ], "returns": [ { - "type_name": "Container", + "type_name": "any", "is_generator": false, - "description": "

A single container that can hold multiple elements.

\n", + "description": "

The selected option.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/chat.py#L121" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/radio.py#L35" }, - "DeltaGenerator.checkbox": { - "name": "checkbox", - "signature": "element.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n
\n", - "description": "

Display a checkbox widget.

\n", + "DeltaGenerator.select_slider": { + "name": "select_slider", + "signature": "element.select_slider(self, label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "examples": "
\ncolor = st.select_slider(\n     'Select a color of the rainbow',\n     options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nstart_color, end_color = st.select_slider(\n     'Select a range of color wavelength',\n     options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n     value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n \n (view standalone Streamlit app)\n \n ", + "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this checkbox is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this slider is for.

\n", "default": null }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the slider options. All options will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", + "default": "." + }, { "name": "value", - "type_name": "bool", + "type_name": "a supported type or a tuple/list of supported types or None", "is_optional": false, - "description": "

Preselect the checkbox when it first renders. This will be\ncast to bool internally.

\n", + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to first option.

\n", + "default": "first" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels from the options.\nargument. It receives the option as an argument and its output\nwill be cast to str.

\n", "default": null }, { @@ -5741,14 +4776,14 @@ "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the checkbox.

\n", + "description": "

An optional tooltip that gets displayed next to the select slider.

\n", "default": null }, { "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this checkbox's value changes.

\n", + "description": "

An optional callback invoked when this select_slider's value changes.

\n", "default": null }, { @@ -5769,77 +4804,53 @@ "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "description": "

An optional boolean, which disables the select slider if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" } ], "returns": [ { - "type_name": "bool", + "type_name": "any value or tuple of any value", "is_generator": false, - "description": "

Whether or not the checkbox is checked.

\n", + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/checkbox.py#L53" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/select_slider.py#L35" }, - "DeltaGenerator.code": { - "name": "code", - "signature": "element.code(body, language=\"python\", line_numbers=False)", - "example": "
\n
\nimport streamlit as st\n\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", - "description": "

Display a code block with optional syntax highlighting.

\n", + "DeltaGenerator.selectbox": { + "name": "selectbox", + "signature": "element.selectbox(self, label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\noption = st.selectbox(\n     'How would you like to be contacted?',\n     ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a select widget.", "args": [ { - "name": "body", + "name": "label", "type_name": "str", "is_optional": false, - "description": "

The string to display as code.

\n", + "description": "

A short label explaining to the user what this select widget is for.

\n", "default": null }, { - "name": "language", - "type_name": "str or None", + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", "is_optional": false, - "description": "

The language that the code is written in, for syntax highlighting.\nIf None, the code will be unstyled. Defaults to "python".

\n

For a list of available language values, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", - "default": "s" + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." }, { - "name": "line_numbers", - "type_name": "bool", - "is_optional": false, - "description": "

An optional boolean indicating whether to show line numbers to the\nleft of the code block. Defaults to False.

\n", - "default": "s" - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/code.py#L27" - }, - "DeltaGenerator.color_picker": { - "name": "color_picker", - "signature": "element.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n
\n", - "description": "

Display a color picker widget.

\n", - "args": [ - { - "name": "label", - "type_name": "str", + "name": "index", + "type_name": "int", "is_optional": false, - "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

The index of the preselected option on first render.

\n", "default": null }, { - "name": "value", - "type_name": "str", + "name": "format_func", + "type_name": "function", "is_optional": false, - "description": "

The hex value of this widget when it first renders. If None,\ndefaults to black.

\n", - "default": "black." + "description": "

Function to modify the display of the labels. It receives the option\nas an argument and its output will be cast to str.

\n", + "default": null }, { "name": "key", @@ -5852,14 +4863,14 @@ "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the color picker.

\n", + "description": "

An optional tooltip that gets displayed next to the selectbox.

\n", "default": null }, { "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this color_picker's value\nchanges.

\n", + "description": "

An optional callback invoked when this selectbox's value changes.

\n", "default": null }, { @@ -5880,148 +4891,87 @@ "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "description": "

An optional boolean, which disables the selectbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" - } - ], - "returns": [ - { - "type_name": "str", - "is_generator": false, - "description": "

The selected color as a hex string.

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/color_picker.py#L53" - }, - "DeltaGenerator.columns": { - "name": "columns", - "signature": "element.columns(spec, *, gap=\"small\")", - "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n
\n", - "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", - "args": [ - { - "name": "spec", - "type_name": "int or iterable of numbers", - "is_optional": false, - "description": "

Controls the number and width of columns to insert. Can be one of:

\n
    \n
  • An integer that specifies the number of columns. All columns have equal\nwidth in this case.
  • \n
  • An iterable of numbers (int or float) that specify the relative width of\neach column. E.g. [0.7, 0.3] creates two columns where the first\none takes up 70% of the available with and the second one takes up 30%.\nOr [1, 2, 3] creates three columns where the second one is two times\nthe width of the first one, and the third one is three times that width.
  • \n
\n", - "default": null - }, - { - "name": "gap", - "type_name": "\"small\", \"medium\", or \"large\"", - "is_optional": false, - "description": "

The size of the gap between the columns. Defaults to "small". This\nargument can only be supplied by keyword.

\n", - "default": "s" } ], "returns": [ { - "type_name": "list of containers", + "type_name": "any", "is_generator": false, - "description": "

A list of container objects.

\n", + "description": "

The selected option

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/layouts.py#L79" - }, - "DeltaGenerator.container": { - "name": "container", - "signature": "element.container()", - "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n
\n", - "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/layouts.py#L31" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/selectbox.py#L35" }, - "DeltaGenerator.data_editor": { - "name": "data_editor", - "signature": "element.data_editor(data, *, width=None, height=None, use_container_width=False, hide_index=None, column_order=None, column_config=None, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", - "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

Or you can customize the data editor via column_config, hide_index, column_order, or disabled:

\n
\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    [\n        {"command": "st.selectbox", "rating": 4, "is_widget": True},\n        {"command": "st.balloons", "rating": 5, "is_widget": False},\n        {"command": "st.time_input", "rating": 3, "is_widget": True},\n    ]\n)\nedited_df = st.data_editor(\n    df,\n    column_config={\n        "command": "Streamlit Command",\n        "rating": st.column_config.NumberColumn(\n            "Your rating",\n            help="How much do you like this command (1-5)?",\n            min_value=1,\n            max_value=5,\n            step=1,\n            format="%d \u2b50",\n        ),\n        "is_widget": "Widget ?",\n    },\n    disabled=["command", "is_widget"],\n    hide_index=True,\n)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n
\n", - "description": "

Display a data editor widget.

\n

The data editor widget allows you to edit dataframes and many other data structures in a table-like UI.

\n
\n

Warning

\n

When going from st.experimental_data_editor to st.data_editor in\n1.23.0, the data editor's representation in st.session_state was changed.\nThe edited_cells dictionary is now called edited_rows and uses a\ndifferent format ({0: {"column name": "edited value"}} instead of\n{"0:1": "edited value"}). You may need to adjust the code if your app uses\nst.experimental_data_editor in combination with st.session_state."

\n
\n", + "DeltaGenerator.slider": { + "name": "slider", + "signature": "element.slider(self, label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "examples": "
\n
\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nvalues = st.slider(\n     'Select a range of values',\n     0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nfrom datetime import time\nappointment = st.slider(\n     "Schedule your appointment:",\n     value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nfrom datetime import datetime\nstart_time = st.slider(\n     "When do you start?",\n     value=datetime(2020, 1, 1, 9, 30),\n     format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n", "args": [ { - "name": "data", - "type_name": "pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None", - "is_optional": false, - "description": "

The data to edit in the data editor.

\n
\n

Note

\n
    \n
  • Styles from pandas.Styler will only be applied to non-editable columns.
  • \n
  • Mixing data types within a column can make the column uneditable.
  • \n
  • Additionally, the following data types are not yet supported for editing:\ncomplex, list, tuple, bytes, bytearray, memoryview, dict, set, frozenset,\ndatetime.timedelta, decimal.Decimal, fractions.Fraction, pandas.Interval,\npandas.Period, pandas.Timedelta.
  • \n
\n
\n", - "default": null - }, - { - "name": "width", - "type_name": "int or None", + "name": "label", + "type_name": "str", "is_optional": false, - "description": "

Desired width of the data editor expressed in pixels. If None, the width will\nbe automatically determined.

\n", + "description": "

A short label explaining to the user what this slider is for.

\n", "default": null }, { - "name": "height", - "type_name": "int or None", + "name": "min_value", + "type_name": "a supported type or None", "is_optional": false, - "description": "

Desired height of the data editor expressed in pixels. If None, the height will\nbe automatically determined.

\n", - "default": null + "description": "

The minimum permitted value.\nDefaults to 0 if the value is an int, 0.0 if a float,\nvalue - timedelta(days=14) if a date/datetime, time.min if a time

\n", + "default": "0" }, { - "name": "use_container_width", - "type_name": "bool", + "name": "max_value", + "type_name": "a supported type or None", "is_optional": false, - "description": "

If True, set the data editor width to the width of the parent container.\nThis takes precedence over the width argument. Defaults to False.

\n", - "default": "False." + "description": "

The maximum permitted value.\nDefaults to 100 if the value is an int, 1.0 if a float,\nvalue + timedelta(days=14) if a date/datetime, time.max if a time

\n", + "default": "100" }, { - "name": "hide_index", - "type_name": "bool or None", + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", "is_optional": false, - "description": "

Whether to hide the index column(s). If None (default), the visibility of\nindex columns is automatically determined based on the data.

\n", - "default": null + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to min_value.

\n", + "default": "min_value." }, { - "name": "column_order", - "type_name": "iterable of str or None", + "name": "step", + "type_name": "int/float/timedelta or None", "is_optional": false, - "description": "

Specifies the display order of columns. This also affects which columns are\nvisible. For example, column_order=("col2", "col1") will display 'col2'\nfirst, followed by 'col1', and will hide all other non-index columns. If\nNone (default), the order is inherited from the original data structure.

\n", - "default": null + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", + "default": "1" }, { - "name": "column_config", - "type_name": "dict or None", + "name": "format", + "type_name": "str or None", "is_optional": false, - "description": "

Configures how columns are displayed, e.g. their title, visibility, type, or\nformat, as well as editing properties such as min/max value or step.\nThis needs to be a dictionary where each key is a column name and the value\nis one of:

\n
    \n
  • None to hide the column.
  • \n
  • A string to set the display label of the column.
  • \n
  • One of the column types defined under st.column_config, e.g.\nst.column_config.NumberColumn("Dollar values\u201d, format=\u201d$ %d") to show\na column as dollar amounts. See more info on the available column types\nand config options here.
  • \n
\n

To configure the index column(s), use _index as the column name.

\n", + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. This does not impact the return value.\nFormatter for int/float supports: %d %e %f %g %i\nFormatter for date/time/datetime uses Moment.js notation:\nhttps://momentjs.com/docs/#/displaying/format/

\n", "default": null }, { - "name": "num_rows", - "type_name": "\"fixed\" or \"dynamic\"", - "is_optional": false, - "description": "

Specifies if the user can add and delete rows in the data editor.\nIf "fixed", the user cannot add or delete rows. If "dynamic", the user can\nadd and delete rows in the data editor, but column sorting is disabled.\nDefaults to "fixed".

\n", - "default": "s" - }, - { - "name": "disabled", - "type_name": "bool or iterable of str", + "name": "key", + "type_name": "str or int", "is_optional": false, - "description": "

Controls the editing of columns. If True, editing is disabled for all columns.\nIf an iterable of column names is provided (e.g., disabled=("col1", "col2")),\nonly the specified columns will be disabled for editing. If False (default),\nall columns that support editing are editable.

\n", + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", "default": null }, { - "name": "key", + "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional string to use as the unique key for this widget. If this\nis omitted, a key will be generated for the widget based on its\ncontent. Multiple widgets of the same type may not share the same\nkey.

\n", + "description": "

An optional tooltip that gets displayed next to the slider.

\n", "default": null }, { "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this data_editor's value changes.

\n", + "description": "

An optional callback invoked when this slider's value changes.

\n", "default": null }, { @@ -6037,110 +4987,166 @@ "is_optional": false, "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the slider if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." } ], "returns": [ { - "type_name": "pandas.DataFrame, pandas.Series, pyarrow.Table, numpy.ndarray, list, set, tuple, or dict.", + "type_name": "int/float/date/time/datetime or tuple of int/float/date/time/datetime", "is_generator": false, - "description": "

The edited data. The edited data is returned in its original data type if\nit corresponds to any of the supported return types. All other data types\nare returned as a pd.DataFrame.

\n", + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/data_editor.py#L529" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/slider.py#L37" }, - "DeltaGenerator.dataframe": { - "name": "dataframe", - "signature": "element.dataframe(data=None, width=None, height=None, *, use_container_width=False, hide_index=None, column_order=None, column_config=None)", - "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n

Or you can customize the dataframe via column_config, hide_index, or column_order:

\n
\nimport random\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    {\n        "name": ["Roadmap", "Extras", "Issues"],\n        "url": ["https://roadmap.streamlit.app", "https://extras.streamlit.app", "https://issues.streamlit.app"],\n        "stars": [random.randint(0, 1000) for _ in range(3)],\n        "views_history": [[random.randint(0, 5000) for _ in range(30)] for _ in range(3)],\n    }\n)\nst.dataframe(\n    df,\n    column_config={\n        "name": "App name",\n        "stars": st.column_config.NumberColumn(\n            "Github Stars",\n            help="Number of stars on GitHub",\n            format="%d \u2b50",\n        ),\n        "url": st.column_config.LinkColumn("App URL"),\n        "views_history": st.column_config.LineChartColumn(\n            "Views (past 30 days)", y_min=0, y_max=5000\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Display a dataframe as an interactive table.

\n

This command works with dataframes from Pandas, PyArrow, Snowpark, and PySpark.\nIt can also display several other types that can be converted to dataframes,\ne.g. numpy arrays, lists, sets and dictionaries.

\n", + "DeltaGenerator.snow": { + "name": "snow", + "signature": "element.snow(self)", + "example": "
\n
\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", + "description": "Draw celebratory snowfall.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/snow.py#L24" + }, + "DeltaGenerator.subheader": { + "name": "subheader", + "signature": "element.subheader(self, body, anchor=None)", + "example": "
\n
\nst.subheader('This is a subheader')\n
\n
\n", + "description": "Display text in subheader formatting.", "args": [ { - "name": "data", - "type_name": "pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "name": "body", + "type_name": "str", "is_optional": false, - "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.

\n", + "description": "

The text to display.

\n", "default": null }, { - "name": "width", - "type_name": "int or None", + "name": "anchor", + "type_name": "str", "is_optional": false, - "description": "

Desired width of the dataframe expressed in pixels. If None, the width\nwill be automatically calculated based on the column content.

\n", + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", "default": null - }, - { - "name": "height", - "type_name": "int or None", - "is_optional": false, - "description": "

Desired height of the dataframe expressed in pixels. If None, a\ndefault height is used.

\n", - "default": "height" - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/markdown.py#L106" + }, + "DeltaGenerator.success": { + "name": "success", + "signature": "element.success(self, body)", + "example": "
\n
\nst.success('This is a success message!')\n
\n
\n", + "description": "Display a success message.", + "args": [ { - "name": "use_container_width", - "type_name": "bool", + "name": "body", + "type_name": "str", "is_optional": false, - "description": "

If True, set the dataframe width to the width of the parent container.\nThis takes precedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "description": "

The success text to display.

\n", "default": null - }, - { - "name": "hide_index", - "type_name": "bool or None", - "is_optional": false, - "description": "

Whether to hide the index column(s). If None (default), the visibility of\nindex columns is automatically determined based on the data.

\n", - "default": null - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/alert.py#L80" + }, + "DeltaGenerator.table": { + "name": "table", + "signature": "element.table(self, data=None)", + "example": "
\n
\ndf = pd.DataFrame(\n    np.random.randn(10, 5),\n    columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", + "args": [ { - "name": "column_order", - "type_name": "iterable of str or None", + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", "is_optional": false, - "description": "

Specifies the display order of columns. This also affects which columns are\nvisible. For example, column_order=("col2", "col1") will display 'col2'\nfirst, followed by 'col1', and will hide all other non-index columns. If\nNone (default), the order is inherited from the original data structure.

\n", + "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/dataframe_selector.py#L99" + }, + "DeltaGenerator.tabs": { + "name": "tabs", + "signature": "element.tabs(self, tabs)", + "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n    st.header("A cat")\n    st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n    st.header("A dog")\n    st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n    st.header("An owl")\n    st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", + "args": [ { - "name": "column_config", - "type_name": "dict or None", + "name": "tabs", + "type_name": "list of strings", "is_optional": false, - "description": "

Configures how columns are displayed, e.g. their title, visibility, type, or\nformat. This needs to be a dictionary where each key is a column name and\nthe value is one of:

\n
    \n
  • None to hide the column.
  • \n
  • A string to set the display label of the column.
  • \n
  • One of the column types defined under st.column_config, e.g.\nst.column_config.NumberColumn("Dollar values\u201d, format=\u201d$ %d") to show\na column as dollar amounts. See more info on the available column types\nand config options here.
  • \n
\n

To configure the index column(s), use _index as the column name.

\n", + "description": "

Creates a tab for each string in the list. The string is used as the name of the tab.\nThe first tab is selected by default.

\n", + "default": "." + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/layouts.py#L196" + }, + "DeltaGenerator.text": { + "name": "text", + "signature": "element.text(self, body)", + "example": "
\n
\nst.text('This is some text.')\n
\n
\n", + "description": "Write fixed-width and preformatted text.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L44" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/text.py#L26" }, - "DeltaGenerator.date_input": { - "name": "date_input", - "signature": "element.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, format=\"YYYY/MM/DD\", disabled=False, label_visibility=\"visible\")", - "examples": "
\n
\nimport datetime\nimport streamlit as st\n\nd = st.date_input("When's your birthday", datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n
\nimport datetime\nimport streamlit as st\n\ntoday = datetime.datetime.now()\nnext_year = today.year + 1\njan_1 = datetime.date(next_year, 1, 1)\ndec_31 = datetime.date(next_year, 12, 31)\n\nd = st.date_input(\n    "Select your vacation for next year",\n    (jan_1, datetime.date(next_year, 1, 7)),\n    jan_1,\n    dec_31,\n    format="MM.DD.YYYY",\n)\nd\n
\n\n \n
\n", - "description": "

Display a date input widget.

\n", + "DeltaGenerator.text_area": { + "name": "text_area", + "signature": "element.text_area(self, label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False)", + "example": "
\n
\ntxt = st.text_area('Text to analyze', '''\n     It was the best of times, it was the worst of times, it was\n     the age of wisdom, it was the age of foolishness, it was\n     the epoch of belief, it was the epoch of incredulity, it\n     was the season of Light, it was the season of Darkness, it\n     was the spring of hope, it was the winter of despair, (...)\n     ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", + "description": "Display a multi-line text input widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this date input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this input is for.

\n", "default": null }, { "name": "value", - "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", + "type_name": "any", "is_optional": false, - "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", - "default": "today" + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null }, { - "name": "min_value", - "type_name": "datetime.date or datetime.datetime", + "name": "height", + "type_name": "int or None", "is_optional": false, - "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", - "default": "value" + "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" }, { - "name": "max_value", - "type_name": "datetime.date or datetime.datetime", + "name": "max_chars", + "type_name": "int or None", "is_optional": false, - "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", - "default": "value" + "description": "

Maximum number of characters allowed in text area.

\n", + "default": null }, { "name": "key", @@ -6153,14 +5159,14 @@ "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the input.

\n", + "description": "

An optional tooltip that gets displayed next to the textarea.

\n", "default": null }, { "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this date_input's value changes.

\n", + "description": "

An optional callback invoked when this text_area's value changes.

\n", "default": null }, { @@ -6178,88 +5184,57 @@ "default": null }, { - "name": "format", - "type_name": "str", + "name": "placeholder", + "type_name": "str or None", "is_optional": false, - "description": "

A format string controlling how the interface should display dates.\nSupports \u201cYYYY/MM/DD\u201d (default), \u201cDD/MM/YYYY\u201d, or \u201cMM/DD/YYYY\u201d.\nYou may also use a period (.) or hyphen (-) as separators.

\n", + "description": "

An optional string displayed when the text area is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", "default": null }, { "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "description": "

An optional boolean, which disables the text area if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" } ], "returns": [ { - "type_name": "datetime.date or a tuple with 0-2 dates", + "type_name": "str", "is_generator": false, - "description": "

The current value of the date input widget.

\n", + "description": "

The current value of the text input widget.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/time_widgets.py#L415" - }, - "DeltaGenerator.dg": { - "name": "dg", - "signature": "element.dg", - "description": "

Get our DeltaGenerator.

\n", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/alert.py#L156" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/text_widgets.py#L200" }, - "DeltaGenerator.divider": { - "name": "divider", - "signature": "element.divider()", - "example": "
\n
\nimport streamlit as st\n\nst.divider()\n
\n
\n", - "description": "

Display a horizontal rule.

\n
\n

Note

\n

You can achieve the same effect with st.write("---") or\neven just "---" in your script (via magic).

\n
\n", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/markdown.py#L258" - }, - "DeltaGenerator.download_button": { - "name": "download_button", - "signature": "element.download_button(label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", - "examples": "
\n

Download a large DataFrame as a CSV:

\n
\nimport streamlit as st\n\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\nimport streamlit as st\n\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nimport streamlit as st\n\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nimport streamlit as st\n\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n
\n", - "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", + "DeltaGenerator.text_input": { + "name": "text_input", + "signature": "element.text_input(self, label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False)", + "example": "
\n
\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a single-line text input widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "description": "

A short label explaining to the user what this input is for.

\n", "default": null }, { - "name": "data", - "type_name": "str or bytes or file", + "name": "value", + "type_name": "any", "is_optional": false, - "description": "

The contents of the file to be downloaded. See example below for\ncaching techniques to avoid recomputing this data unnecessarily.

\n", + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", "default": null }, { - "name": "file_name", - "type_name": "str", + "name": "max_chars", + "type_name": "int or None", "is_optional": false, - "description": "

An optional string to use as the name of the file to be downloaded,\nsuch as 'my_file.csv'. If not specified, the name will be\nautomatically generated.

\n", + "description": "

Max number of characters allowed in text input.

\n", "default": null }, - { - "name": "mime", - "type_name": "str or None", - "is_optional": false, - "description": "

The MIME type of the data. If None, defaults to "text/plain"\n(if data is of type str or is a textual file) or\n"application/octet-stream" (if data is of type bytes or is a\nbinary file).

\n", - "default": "s" - }, { "name": "key", "type_name": "str or int", @@ -6267,18 +5242,32 @@ "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", "default": null }, + { + "name": "type", + "type_name": "str", + "is_optional": false, + "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", + "default": "s" + }, { "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "description": "

An optional tooltip that gets displayed next to the input.

\n", "default": null }, { - "name": "on_click", + "name": "autocomplete", + "type_name": "str", + "is_optional": false, + "description": "

An optional value that will be passed to the <input> element's\nautocomplete property. If unspecified, this value will be set to\n"new-password" for "password" inputs, and the empty string for\n"default" inputs. For more details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

\n", + "default": null + }, + { + "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this button is clicked.

\n", + "description": "

An optional callback invoked when this text_input's value changes.

\n", "default": null }, { @@ -6296,846 +5285,735 @@ "default": null }, { - "name": "type", - "type_name": "\"secondary\" or \"primary\"", + "name": "placeholder", + "type_name": "str or None", "is_optional": false, - "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", - "default": "s" + "description": "

An optional string displayed when the text input is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null }, { "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "description": "

An optional boolean, which disables the text input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", "default": "False." - }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", - "default": null } ], "returns": [ { - "type_name": "bool", + "type_name": "str", "is_generator": false, - "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "description": "

The current value of the text input widget.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/button.py#L170" - }, - "DeltaGenerator.empty": { - "name": "empty", - "signature": "element.empty()", - "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport streamlit as st\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nimport streamlit as st\n\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", - "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/empty.py#L24" + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/text_widgets.py#L36" }, - "DeltaGenerator.error": { - "name": "error", - "signature": "element.error(body, *, icon=None)", - "example": "
\n
\nimport streamlit as st\n\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", - "description": "

Display error message.

\n", + "DeltaGenerator.time_input": { + "name": "time_input", + "signature": "element.time_input(self, label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a time input widget.", "args": [ { - "name": "body", + "name": "label", "type_name": "str", "is_optional": false, - "description": "

The error text to display.

\n", + "description": "

A short label explaining to the user what this time input is for.

\n", "default": null }, { - "name": "icon", - "type_name": "str or None", + "name": "value", + "type_name": "datetime.time/datetime.datetime", "is_optional": false, - "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", - "default": "None" - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/alert.py#L27" - }, - "DeltaGenerator.exception": { - "name": "exception", - "signature": "element.exception(exception)", - "example": "
\n
\nimport streamlit as st\n\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", - "description": "

Display an exception.

\n", - "args": [ + "description": "

The value of this widget when it first renders. This will be\ncast to str internally. Defaults to the current time.

\n", + "default": "the" + }, { - "name": "exception", - "type_name": "Exception", + "name": "key", + "type_name": "str or int", "is_optional": false, - "description": "

The exception to display.

\n", + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/exception.py#L50" - }, - "DeltaGenerator.expander": { - "name": "expander", - "signature": "element.expander(label, expanded=False)", - "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n
\n", - "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", - "args": [ + }, { - "name": "label", + "name": "help", "type_name": "str", "is_optional": false, - "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "description": "

An optional tooltip that gets displayed next to the input.

\n", "default": null }, { - "name": "expanded", - "type_name": "bool", - "is_optional": false, - "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", - "default": "s" - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/layouts.py#L319" - }, - "DeltaGenerator.experimental_data_editor": { - "name": "experimental_data_editor", - "signature": "element.experimental_data_editor(data, *, width=None, height=None, use_container_width=False, hide_index=None, column_order=None, column_config=None, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", - "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

Or you can customize the data editor via column_config, hide_index, column_order, or disabled:

\n
\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    [\n        {"command": "st.selectbox", "rating": 4, "is_widget": True},\n        {"command": "st.balloons", "rating": 5, "is_widget": False},\n        {"command": "st.time_input", "rating": 3, "is_widget": True},\n    ]\n)\nedited_df = st.data_editor(\n    df,\n    column_config={\n        "command": "Streamlit Command",\n        "rating": st.column_config.NumberColumn(\n            "Your rating",\n            help="How much do you like this command (1-5)?",\n            min_value=1,\n            max_value=5,\n            step=1,\n            format="%d \u2b50",\n        ),\n        "is_widget": "Widget ?",\n    },\n    disabled=["command", "is_widget"],\n    hide_index=True,\n)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n
\n", - "description": "

Display a data editor widget.

\n

The data editor widget allows you to edit dataframes and many other data structures in a table-like UI.

\n
\n

Warning

\n

When going from st.experimental_data_editor to st.data_editor in\n1.23.0, the data editor's representation in st.session_state was changed.\nThe edited_cells dictionary is now called edited_rows and uses a\ndifferent format ({0: {"column name": "edited value"}} instead of\n{"0:1": "edited value"}). You may need to adjust the code if your app uses\nst.experimental_data_editor in combination with st.session_state."

\n
\n", - "args": [ - { - "name": "data", - "type_name": "pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None", + "name": "on_change", + "type_name": "callable", "is_optional": false, - "description": "

The data to edit in the data editor.

\n
\n

Note

\n
    \n
  • Styles from pandas.Styler will only be applied to non-editable columns.
  • \n
  • Mixing data types within a column can make the column uneditable.
  • \n
  • Additionally, the following data types are not yet supported for editing:\ncomplex, list, tuple, bytes, bytearray, memoryview, dict, set, frozenset,\ndatetime.timedelta, decimal.Decimal, fractions.Fraction, pandas.Interval,\npandas.Period, pandas.Timedelta.
  • \n
\n
\n", + "description": "

An optional callback invoked when this time_input's value changes.

\n", "default": null }, { - "name": "width", - "type_name": "int or None", + "name": "args", + "type_name": "tuple", "is_optional": false, - "description": "

Desired width of the data editor expressed in pixels. If None, the width will\nbe automatically determined.

\n", + "description": "

An optional tuple of args to pass to the callback.

\n", "default": null }, { - "name": "height", - "type_name": "int or None", + "name": "kwargs", + "type_name": "dict", "is_optional": false, - "description": "

Desired height of the data editor expressed in pixels. If None, the height will\nbe automatically determined.

\n", + "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, { - "name": "use_container_width", + "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

If True, set the data editor width to the width of the parent container.\nThis takes precedence over the width argument. Defaults to False.

\n", + "description": "

An optional boolean, which disables the time input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", "default": "False." - }, + } + ], + "returns": [ { - "name": "hide_index", - "type_name": "bool or None", + "type_name": "datetime.time", + "is_generator": false, + "description": "

The current value of the time input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/time_widgets.py#L165" + }, + "DeltaGenerator.title": { + "name": "title", + "signature": "element.title(self, body, anchor=None)", + "example": "
\n
\nst.title('This is a title')\n
\n
\n", + "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", + "args": [ + { + "name": "body", + "type_name": "str", "is_optional": false, - "description": "

Whether to hide the index column(s). If None (default), the visibility of\nindex columns is automatically determined based on the data.

\n", + "description": "

The text to display.

\n", "default": null }, { - "name": "column_order", - "type_name": "iterable of str or None", + "name": "anchor", + "type_name": "str", "is_optional": false, - "description": "

Specifies the display order of columns. This also affects which columns are\nvisible. For example, column_order=("col2", "col1") will display 'col2'\nfirst, followed by 'col1', and will hide all other non-index columns. If\nNone (default), the order is inherited from the original data structure.

\n", + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", "default": null - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/markdown.py#L161" + }, + "DeltaGenerator.vega_lite_chart": { + "name": "vega_lite_chart", + "signature": "element.vega_lite_chart(self, data=None, spec=None, use_container_width=False, **kwargs)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n     np.random.randn(200, 3),\n     columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(df, {\n     'mark': {'type': 'circle', 'tooltip': True},\n     'encoding': {\n         'x': {'field': 'a', 'type': 'quantitative'},\n         'y': {'field': 'b', 'type': 'quantitative'},\n         'size': {'field': 'c', 'type': 'quantitative'},\n         'color': {'field': 'c', 'type': 'quantitative'},\n     },\n })\n
\n\n \n \n (view standalone Streamlit app)\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", + "description": "Display a chart using the Vega-Lite library.", + "args": [ { - "name": "column_config", - "type_name": "dict or None", + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", "is_optional": false, - "description": "

Configures how columns are displayed, e.g. their title, visibility, type, or\nformat, as well as editing properties such as min/max value or step.\nThis needs to be a dictionary where each key is a column name and the value\nis one of:

\n
    \n
  • None to hide the column.
  • \n
  • A string to set the display label of the column.
  • \n
  • One of the column types defined under st.column_config, e.g.\nst.column_config.NumberColumn("Dollar values\u201d, format=\u201d$ %d") to show\na column as dollar amounts. See more info on the available column types\nand config options here.
  • \n
\n

To configure the index column(s), use _index as the column name.

\n", + "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null }, { - "name": "num_rows", - "type_name": "\"fixed\" or \"dynamic\"", + "name": "spec", + "type_name": "dict or None", "is_optional": false, - "description": "

Specifies if the user can add and delete rows in the data editor.\nIf "fixed", the user cannot add or delete rows. If "dynamic", the user can\nadd and delete rows in the data editor, but column sorting is disabled.\nDefaults to "fixed".

\n", - "default": "s" + "description": "

The Vega-Lite spec for the chart. If the spec was already passed in\nthe previous argument, this must be set to None. See\nhttps://vega.github.io/vega-lite/docs/ for more info.

\n", + "default": null }, { - "name": "disabled", - "type_name": "bool or iterable of str", + "name": "use_container_width", + "type_name": "bool", "is_optional": false, - "description": "

Controls the editing of columns. If True, editing is disabled for all columns.\nIf an iterable of column names is provided (e.g., disabled=("col1", "col2")),\nonly the specified columns will be disabled for editing. If False (default),\nall columns that support editing are editable.

\n", + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", "default": null }, { - "name": "key", - "type_name": "str", + "name": "**kwargs", + "type_name": "any", "is_optional": false, - "description": "

An optional string to use as the unique key for this widget. If this\nis omitted, a key will be generated for the widget based on its\ncontent. Multiple widgets of the same type may not share the same\nkey.

\n", + "description": "

Same as spec, but as keywords.

\n", "default": null - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/dataframe_selector.py#L341" + }, + "DeltaGenerator.video": { + "name": "video", + "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)", + "example": "
\n
\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", + "description": "Display a video player.", + "args": [ { - "name": "on_change", - "type_name": "callable", + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", "is_optional": false, - "description": "

An optional callback invoked when this data_editor's value changes.

\n", + "description": "

io.open().\nRaw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", "default": null }, { - "name": "args", - "type_name": "tuple", + "name": "format", + "type_name": "str", "is_optional": false, - "description": "

An optional tuple of args to pass to the callback.

\n", - "default": null + "description": "

The mime type for the video file. Defaults to 'video/mp4'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" }, { - "name": "kwargs", - "type_name": "dict", + "name": "start_time", + "type_name": "int", "is_optional": false, - "description": "

An optional dict of kwargs to pass to the callback.

\n", + "description": "

The time from which this element should start playing.

\n", "default": null } ], - "returns": [ + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/media.py#L79" + }, + "DeltaGenerator.warning": { + "name": "warning", + "signature": "element.warning(self, body)", + "example": "
\n
\nst.warning('This is a warning')\n
\n
\n", + "description": "Display warning message.", + "args": [ { - "type_name": "pandas.DataFrame, pandas.Series, pyarrow.Table, numpy.ndarray, list, set, tuple, or dict.", - "is_generator": false, - "description": "

The edited data. The edited data is returned in its original data type if\nit corresponds to any of the supported return types. All other data types\nare returned as a pd.DataFrame.

\n", - "return_name": null + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The warning text to display.

\n", + "default": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/data_editor.py#L529" + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/alert.py#L44" }, - "DeltaGenerator.file_uploader": { - "name": "file_uploader", - "signature": "element.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nimport streamlit as st\nimport pandas as pd\nfrom io import StringIO\n\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nimport streamlit as st\n\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n
\n", - "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "DeltaGenerator.write": { + "name": "write", + "signature": "element.write(self, *args, **kwargs)", + "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nwrite('Hello, *World!* :sunglasses:')\n
\n\n \n \n (view standalone Streamlit app)\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nst.write(1234)\nst.write(pd.DataFrame({\n     'first column': [1, 2, 3, 4],\n     'second column': [10, 20, 30, 40],\n }))\n
\n\n \n \n (view standalone Streamlit app)\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n \n (view standalone Streamlit app)\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n     np.random.randn(200, 3),\n     columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n     x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", "args": [ { - "name": "label", - "type_name": "str", + "name": "*args", + "type_name": "any", "is_optional": false, - "description": "

A short label explaining to the user what this file uploader is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression and emoji shortcodes.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", "default": null }, { - "name": "type", - "type_name": "str or list of str or None", + "name": "unsafe_allow_html", + "type_name": "bool", "is_optional": false, - "description": "

Array of allowed extensions. ['png', 'jpg']\nThe default is None, which means all extensions are allowed.

\n", - "default": "None" - }, + "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n

Also note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.

\n

If you decide to turn on HTML anyway, we ask you to please tell us your\nexact use case here:\nhttps://discuss.streamlit.io/t/96 .

\n

This will help us come up with safe APIs that allow you to do what you\nwant.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.11.0/lib/streamlit/elements/write.py#L43" + } + }, + "1.12.0": { + "streamlit.altair_chart": { + "name": "altair_chart", + "signature": "st.altair_chart(altair_chart, use_container_width=False)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a chart using the Altair library.", + "args": [ { - "name": "accept_multiple_files", - "type_name": "bool", + "name": "altair_chart", + "type_name": "altair.vegalite.v2.api.Chart", "is_optional": false, - "description": "

If True, allows the user to upload multiple files at the same time,\nin which case the return value will be a list of files.\nDefault: False

\n", - "default": "False" + "description": "

The Altair chart object to display.

\n", + "default": null }, { - "name": "key", - "type_name": "str or int", + "name": "use_container_width", + "type_name": "bool", "is_optional": false, - "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", "default": null - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/dataframe_selector.py#L379" + }, + "streamlit.area_chart": { + "name": "area_chart", + "signature": "st.area_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ { - "name": "help", - "type_name": "str", + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, or dict", "is_optional": false, - "description": "

A tooltip that gets displayed next to the file uploader.

\n", + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null }, { - "name": "on_change", - "type_name": "callable", + "name": "x", + "type_name": "str or None", "is_optional": false, - "description": "

An optional callback invoked when this file_uploader's value\nchanges.

\n", + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", "default": null }, { - "name": "args", - "type_name": "tuple", + "name": "y", + "type_name": "str, sequence of str, or None", "is_optional": false, - "description": "

An optional tuple of args to pass to the callback.

\n", + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", "default": null }, { - "name": "kwargs", - "type_name": "dict", + "name": "width", + "type_name": "int", "is_optional": false, - "description": "

An optional dict of kwargs to pass to the callback.

\n", + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", "default": null }, { - "name": "disabled", - "type_name": "bool", + "name": "height", + "type_name": "int", "is_optional": false, - "description": "

An optional boolean, which disables the file uploader if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", - "default": "False." + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null }, { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "name": "use_container_width", + "type_name": "bool", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" - } - ], - "returns": [ - { - "type_name": "None or UploadedFile or list of UploadedFile", - "is_generator": false, - "description": "
    \n
  • If accept_multiple_files is False, returns either None or\nan UploadedFile object.
  • \n
  • If accept_multiple_files is True, returns a list with the\nuploaded files as UploadedFile objects. If no files were\nuploaded, returns an empty list.
  • \n
\n

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", - "return_name": null + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/file_uploader.py#L222" + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/dataframe_selector.py#L214" }, - "DeltaGenerator.form": { - "name": "form", - "signature": "element.form(key, clear_on_submit=False)", - "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n\n \n
\n", - "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
  • Within a form, the only widget that can have a callback function is\nst.form_submit_button.
  • \n
\n", + "streamlit.audio": { + "name": "audio", + "signature": "st.audio(data, format=\"audio/wav\", start_time=0)", + "example": "
\n
\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an audio player.", "args": [ { - "name": "key", - "type_name": "str", + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", "is_optional": false, - "description": "

A string that identifies the form. Each form must have its own\nkey. (This key is not displayed to the user in the interface.)

\n", + "description": "

io.open().\nRaw audio data, filename, or a URL pointing to the file to load.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", "default": null }, { - "name": "clear_on_submit", - "type_name": "bool", + "name": "start_time", + "type_name": "int", "is_optional": false, - "description": "

If True, all widgets inside the form will be reset to their default\nvalues after the user presses the Submit button. Defaults to False.\n(Note that Custom Components are unaffected by this flag, and\nwill not be reset to their defaults on form submission.)

\n", - "default": "values" - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/form.py#L118" - }, - "DeltaGenerator.form_submit_button": { - "name": "form_submit_button", - "signature": "element.form_submit_button(label=\"Submit\", help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", - "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", - "args": [ - { - "name": "label", - "type_name": "str", - "is_optional": false, - "description": "

A short label explaining to the user what this button is for.\nDefaults to "Submit".

\n", - "default": "s" - }, - { - "name": "help", - "type_name": "str or None", - "is_optional": false, - "description": "

A tooltip that gets displayed when the button is hovered over.\nDefaults to None.

\n", - "default": "None." - }, - { - "name": "on_click", - "type_name": "callable", - "is_optional": false, - "description": "

An optional callback invoked when this button is clicked.

\n", - "default": null - }, - { - "name": "args", - "type_name": "tuple", - "is_optional": false, - "description": "

An optional tuple of args to pass to the callback.

\n", - "default": null - }, - { - "name": "kwargs", - "type_name": "dict", - "is_optional": false, - "description": "

An optional dict of kwargs to pass to the callback.

\n", + "description": "

The time from which this element should start playing.

\n", "default": null }, { - "name": "type", - "type_name": "\"secondary\" or \"primary\"", + "name": "format", + "type_name": "str", "is_optional": false, - "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", "default": "s" - }, - { - "name": "disabled", - "type_name": "bool", - "is_optional": false, - "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", - "default": "False." - }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", - "default": null - } - ], - "returns": [ - { - "type_name": "bool", - "is_generator": false, - "description": "

True if the button was clicked.

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/form.py#L218" - }, - "DeltaGenerator.graphviz_chart": { - "name": "graphviz_chart", - "signature": "element.graphviz_chart(figure_or_dot, use_container_width=False)", - "example": "
\n
\nimport streamlit as st\nimport graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n
\n", - "description": "

Display a graph using the dagre-d3 library.

\n", - "args": [ - { - "name": "figure_or_dot", - "type_name": "graphviz.dot.Graph, graphviz.dot.Digraph, str", - "is_optional": false, - "description": "

The Graphlib graph object or dot string to display

\n", - "default": null - }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", - "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/graphviz_chart.py#L39" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/media.py#L41" }, - "DeltaGenerator.header": { - "name": "header", - "signature": "element.header(body, anchor=None, *, help=None, divider=False)", - "examples": "
\n
\nimport streamlit as st\n\nst.header('This is a header with a divider', divider='rainbow')\nst.header('_Streamlit_ is :blue[cool] :sunglasses:')\n
\n\n \n
\n", - "description": "

Display text in header formatting.

\n", - "args": [ - { - "name": "body", - "type_name": "str", - "is_optional": false, - "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", - "default": null - }, - { - "name": "anchor", - "type_name": "str or False", - "is_optional": false, - "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", - "default": null - }, - { - "name": "help", - "type_name": "str", - "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the header.

\n", - "default": null - }, - { - "name": "divider", - "type_name": "bool or \u201cblue\u201d, \u201cgreen\u201d, \u201corange\u201d, \u201cred\u201d, \u201cviolet\u201d, \u201cgray\u201d/\"grey\", or \u201crainbow\u201d", - "is_optional": false, - "description": "

Shows a colored divider below the header. If True, successive\nheaders will cycle through divider colors. That is, the first\nheader will have a blue line, the second header will have a\ngreen line, and so on. If a string, the color can be set to one of\nthe following: blue, green, orange, red, violet, gray/grey, or\nrainbow.

\n", - "default": null - } - ], + "streamlit.balloons": { + "name": "balloons", + "signature": "st.balloons()", + "example": "
\n
\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", + "description": "Draw celebratory balloons.", + "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/heading.py#L41" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/balloons.py#L24" }, - "DeltaGenerator.help": { - "name": "help", - "signature": "element.help(obj=)", - "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nimport streamlit as st\nimport pandas\n\nst.help(pandas.DataFrame)\n
\n\n \n

Want to quickly check what data type is output by a certain function?\nTry:

\n
\nimport streamlit as st\n\nx = my_poorly_documented_function()\nst.help(x)\n
\n

Want to quickly inspect an object? No sweat:

\n
\nclass Dog:\n  '''A typical dog.'''\n\n  def __init__(self, breed, color):\n    self.breed = breed\n    self.color = color\n\n  def bark(self):\n    return 'Woof!'\n\n\nfido = Dog('poodle', 'white')\n\nst.help(fido)\n
\n\n \n

And if you're using Magic, you can get help for functions, classes,\nand modules without even typing st.help:

\n
\nimport streamlit as st\nimport pandas\n\n# Get help for Pandas read_csv:\npandas.read_csv\n\n# Get help for Streamlit itself:\nst\n
\n\n \n
\n", - "description": "

Display help and other information for a given object.

\n

Depending on the type of object that is passed in, this displays the\nobject's name, type, value, signature, docstring, and member variables,\nmethods \u2014 as well as the values/docstring of members and methods.

\n", + "streamlit.bar_chart": { + "name": "bar_chart", + "signature": "st.bar_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nchart_data = pd.DataFrame(\n    np.random.randn(50, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", "args": [ { - "name": "obj", - "type_name": "any", + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, or dict", "is_optional": false, - "description": "

The object whose information should be displayed. If left\nunspecified, this call will display help for Streamlit itself.

\n", + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/doc_string.py#L48" - }, - "DeltaGenerator.id": { "name": "id", "signature": "element.id" }, - "DeltaGenerator.image": { - "name": "image", - "signature": "element.image(image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", - "example": "
\n
\nimport streamlit as st\nfrom PIL import Image\n\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n
\n", - "description": "

Display an image or list of images.

\n", - "args": [ + }, { - "name": "image", - "type_name": "numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]", + "name": "x", + "type_name": "str or None", "is_optional": false, - "description": "

Monochrome image of shape (w,h) or (w,h,1)\nOR a color image of shape (w,h,3)\nOR an RGBA image of shape (w,h,4)\nOR a URL to fetch the image from\nOR a path of a local image file\nOR an SVG XML string like <svg xmlns=...</svg>\nOR a list of one of the above, to display multiple images.

\n", + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", "default": null }, { - "name": "caption", - "type_name": "str or list of str", + "name": "y", + "type_name": "str, sequence of str, or None", "is_optional": false, - "description": "

Image caption. If displaying multiple images, caption should be a\nlist of captions (one for each image).

\n", + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", "default": null }, { "name": "width", - "type_name": "int or None", + "type_name": "int", "is_optional": false, - "description": "

Image width. None means use the image width,\nbut do not exceed the width of the column.\nShould be set for SVG images, as they have no default image width.

\n", - "default": "image" + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null }, { - "name": "use_column_width", - "type_name": "\"auto\", \"always\", \"never\", or bool", + "name": "height", + "type_name": "int", "is_optional": false, - "description": "

If "auto", set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf "always" or True, set the image's width to the column width.\nIf "never" or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", "default": null }, { - "name": "clamp", + "name": "use_container_width", "type_name": "bool", "is_optional": false, - "description": "

Clamp image pixel values to a valid range ([0-255] per channel).\nThis is only meaningful for byte array images; the parameter is\nignored for image URLs. If this is not set, and an image has an\nout-of-range value, an error will be thrown.

\n", + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", "default": null - }, - { - "name": "channels", - "type_name": "\"RGB\" or \"BGR\"", - "is_optional": false, - "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to "RGB", meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to "BGR", instead.

\n", - "default": "s" - }, - { - "name": "output_format", - "type_name": "\"JPEG\", \"PNG\", or \"auto\"", - "is_optional": false, - "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to "auto" which identifies the compression type based\non the type and format of the image argument.

\n", - "default": "s" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/image.py#L87" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/dataframe_selector.py#L296" }, - "DeltaGenerator.info": { - "name": "info", - "signature": "element.info(body, *, icon=None)", - "example": "
\n
\nimport streamlit as st\n\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", - "description": "

Display an informational message.

\n", + "streamlit.beta_columns": { + "name": "beta_columns", + "signature": "st.beta_columns(*args, **kwargs)", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put columns inside another column.

\n
\n", "args": [ { - "name": "body", - "type_name": "str", + "name": "spec", + "type_name": "int or list of numbers", "is_optional": false, - "description": "

The info text to display.

\n", + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", "default": null }, { - "name": "icon", - "type_name": "str or None", + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", "is_optional": false, - "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", - "default": "None" + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null } ], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/beta_util.py#L43" + }, + "streamlit.beta_container": { + "name": "beta_container", + "signature": "st.beta_container(*args, **kwargs)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/alert.py#L91" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/beta_util.py#L43" }, - "DeltaGenerator.json": { - "name": "json", - "signature": "element.json(body, *, expanded=True)", - "example": "
\n
\nimport streamlit as st\n\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n
\n", - "description": "

Display object or string as a pretty-printed JSON string.

\n", + "streamlit.beta_expander": { + "name": "beta_expander", + "signature": "st.beta_expander(*args, **kwargs)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write("""\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    """)\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write("""\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n""")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", "args": [ { - "name": "body", - "type_name": "object or str", + "name": "label", + "type_name": "str", "is_optional": false, - "description": "

The object to print as JSON. All referenced objects should be\nserializable to JSON as well. If object is a string, we assume it\ncontains serialized JSON.

\n", + "description": "

A string to use as the header for the expander.

\n", "default": null }, { "name": "expanded", "type_name": "bool", "is_optional": false, - "description": "

An optional boolean that allows the user to set whether the initial\nstate of this json element should be expanded. Defaults to True.\nThis argument can only be supplied by keyword.

\n", - "default": "True." + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/json.py#L35" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/beta_util.py#L43" }, - "DeltaGenerator.latex": { - "name": "latex", - "signature": "element.latex(body, *, help=None)", - "example": "
\n
\nimport streamlit as st\n\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", - "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", + "streamlit.bokeh_chart": { + "name": "bokeh_chart", + "signature": "st.bokeh_chart(figure, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", "args": [ { - "name": "body", - "type_name": "str or SymPy expression", + "name": "figure", + "type_name": "bokeh.plotting.figure.Figure", "is_optional": false, - "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", + "description": "

A Bokeh figure to plot.

\n", "default": null }, { - "name": "help", - "type_name": "str", + "name": "use_container_width", + "type_name": "bool", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the LaTeX expression.

\n", + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Bokeh's native width value.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/markdown.py#L210" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/bokeh_chart.py#L33" }, - "DeltaGenerator.line_chart": { - "name": "line_chart", - "signature": "element.line_chart(data=None, *, x=None, y=None, color=None, width=0, height=0, use_container_width=True)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\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 \n

You can also choose different columns to use for x and y, as well as set\nthe color dynamically based on a 3rd column (assuming your dataframe is in\nlong format):

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame({\n    'col1' : np.random.randn(20),\n    'col2' : np.random.randn(20),\n    'col3' : np.random.choice(['A','B','C'], 20)\n})\n\nst.line_chart(\n    chart_data,\n    x = 'col1',\n    y = 'col2',\n    color = 'col3'\n)\n
\n\n \n

Finally, if your dataframe is in wide format, you can group multiple\ncolumns under the y argument to show multiple lines with different\ncolors:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns = ['col1', 'col2', 'col3'])\n\nst.line_chart(\n    chart_data,\n    x = 'col1',\n    y = ['col2', 'col3'],\n    color = ['#FF0000', '#0000FF']  # Optional\n)\n
\n\n \n
\n", - "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "streamlit.button": { + "name": "button", + "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a button widget.", "args": [ { - "name": "data", - "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict or None", + "name": "label", + "type_name": "str", "is_optional": false, - "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "description": "

A short label explaining to the user what this button is for.

\n", "default": null }, { - "name": "x", - "type_name": "str or None", + "name": "key", + "type_name": "str or int", "is_optional": false, - "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", "default": null }, { - "name": "y", - "type_name": "str, sequence of str, or None", + "name": "help", + "type_name": "str", "is_optional": false, - "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", "default": null }, { - "name": "color", - "type_name": "str, tuple, sequence of str, sequence of tuple, or None", + "name": "on_click", + "type_name": "callable", "is_optional": false, - "description": "

The color to use for different lines in this chart. This argument\ncan only be supplied by keyword.

\n

For a line chart with just one line, this can be:

\n
    \n
  • None, to use the default color.
  • \n
  • A hex string like "#ffaa00" or "#ffaa0088".
  • \n
  • An RGB or RGBA tuple with the red, green, blue, and alpha\ncomponents specified as ints from 0 to 255 or floats from 0.0 to\n1.0.
  • \n
\n

For a line chart with multiple lines, where the dataframe is in\nlong format (that is, y is None or just one column), this can be:

\n
    \n
  • None, to use the default colors.

    \n
  • \n
  • The name of a column in the dataset. Data points will be grouped\ninto lines of the same color based on the value of this column.\nIn addition, if the values in this column match one of the color\nformats above (hex string or color tuple), then that color will\nbe used.

    \n

    For example: if the dataset has 1000 rows, but this column can\nonly contains the values "adult", "child", "baby", then\nthose 1000 datapoints will be grouped into three lines, whose\ncolors will be automatically selected from the default palette.

    \n

    But, if for the same 1000-row dataset, this column contained\nthe values "#ffaa00", "#f0f", "#0000ff", then then those 1000\ndatapoints would still be grouped into three lines, but their\ncolors would be "#ffaa00", "#f0f", "#0000ff" this time around.

    \n
  • \n
\n

For a line chart with multiple lines, where the dataframe is in\nwide format (that is, y is a sequence of columns), this can be:

\n
    \n
  • None, to use the default colors.
  • \n
  • A list of string colors or color tuples to be used for each of\nthe lines in the chart. This list should have the same length\nas the number of y values (e.g. color=["#fd0", "#f0f", "#04f"]\nfor three lines).
  • \n
\n", - "default": "color." + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null }, { - "name": "width", - "type_name": "int", + "name": "args", + "type_name": "tuple", "is_optional": false, - "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "description": "

An optional tuple of args to pass to the callback.

\n", "default": null }, { - "name": "height", - "type_name": "int", + "name": "kwargs", + "type_name": "dict", "is_optional": false, - "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, { - "name": "use_container_width", + "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", - "default": null + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" } ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L231" + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/button.py#L51" }, - "DeltaGenerator.map": { - "name": "map", - "signature": "element.map(data=None, *, latitude=None, longitude=None, color=None, size=None, zoom=None, use_container_width=True)", - "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n

You can also customize the size and color of the datapoints:

\n
\nst.map(df, size=20, color='#0044ff')\n
\n

And finally, you can choose different columns to use for the latitude\nand longitude components, as well as set size and color of each\ndatapoint dynamically based on other columns:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame({\n    "col1": np.random.randn(1000) / 50 + 37.76,\n    "col2": np.random.randn(1000) / 50 + -122.4,\n    "col3": np.random.randn(1000) * 100,\n    "col4": np.random.rand(1000, 4).tolist(),\n})\n\nst.map(df,\n    latitude='col1',\n    longitude='col2',\n    size='col3',\n    color='col4')\n
\n\n \n
\n", - "description": "

Display a map with a scatterplot overlaid onto it.

\n

This is a wrapper around st.pydeck_chart to quickly create\nscatterplot charts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "streamlit.cache": { + "name": "cache", + "signature": "st.cache(func=None, persist=False, allow_output_mutation=False, show_spinner=True, suppress_st_warning=False, hash_funcs=None, max_entries=None, ttl=None)", + "example": "
\n
\n@st.cache\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\n@st.cache(persist=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To disable hashing return values, set the allow_output_mutation parameter to True:

\n
\n@st.cache(allow_output_mutation=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. MongoClient) to a hash function (id) like this:

\n
\n@st.cache(hash_funcs={MongoClient: id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "pymongo.mongo_client.MongoClient") to the hash function instead:

\n
\n@st.cache(hash_funcs={"pymongo.mongo_client.MongoClient": id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n
\n", + "description": "Function decorator to memoize function executions.", "args": [ { - "name": "data", - "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "name": "func", + "type_name": "callable", "is_optional": false, - "description": "

The data to be plotted.

\n", + "description": "

The function to cache. Streamlit hashes the function and dependent code.

\n", "default": null }, { - "name": "latitude", - "type_name": "str or None", + "name": "persist", + "type_name": "boolean", "is_optional": false, - "description": "

The name of the column containing the latitude coordinates of\nthe datapoints in the chart. This argument can only be supplied\nby keyword.

\n

If None, the latitude data will come from any column named 'lat',\n'latitude', 'LAT', or 'LATITUDE'.

\n", + "description": "

Whether to persist the cache on disk.

\n", "default": null }, { - "name": "longitude", - "type_name": "str or None", + "name": "allow_output_mutation", + "type_name": "boolean", "is_optional": false, - "description": "

The name of the column containing the longitude coordinates of\nthe datapoints in the chart. This argument can only be supplied\nby keyword.

\n

If None, the longitude data will come from any column named 'lon',\n'longitude', 'LON', or 'LONGITUDE'.

\n", + "description": "

Streamlit shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.

\n

If you know what you're doing and would like to override this warning, set this to True.

\n", "default": null }, { - "name": "color", - "type_name": "str or tuple or None", + "name": "show_spinner", + "type_name": "boolean", "is_optional": false, - "description": "

The color of the circles representing each datapoint. This argument\ncan only be supplied by keyword.

\n

Can be:

\n
    \n
  • None, to use the default color.
  • \n
  • A hex string like "#ffaa00" or "#ffaa0088".
  • \n
  • An RGB or RGBA tuple with the red, green, blue, and alpha\ncomponents specified as ints from 0 to 255 or floats from 0.0 to\n1.0.
  • \n
  • The name of the column to use for the color. Cells in this column\nshould contain colors represented as a hex string or color tuple,\nas described above.
  • \n
\n", - "default": "color." + "description": "

Enable the spinner. Default is True to show a spinner when there is\na cache miss.

\n", + "default": "True" }, { - "name": "size", - "type_name": "str or float or None", + "name": "suppress_st_warning", + "type_name": "boolean", "is_optional": false, - "description": "

The size of the circles representing each point, in meters. This\nargument can only be supplied by keyword.

\n

This can be:

\n
    \n
  • None, to use the default size.
  • \n
  • A number like 100, to specify a single size to use for all\ndatapoints.
  • \n
  • The name of the column to use for the size. This allows each\ndatapoint to be represented by a circle of a different size.
  • \n
\n", - "default": "size." + "description": "

Suppress warnings about calling Streamlit functions from within\nthe cached function.

\n", + "default": null }, { - "name": "zoom", - "type_name": "int", + "name": "hash_funcs", + "type_name": "dict or None", "is_optional": false, - "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels.\nThis argument can only be supplied by keyword.

\n", + "description": "

Mapping of types or fully qualified names to hash functions. This is used to override\nthe behavior of the hasher inside Streamlit's caching mechanism: when the hasher\nencounters an object, it will first check to see if its type matches a key in this\ndict and, if so, will use the provided function to generate a hash for it. See below\nfor an example of how this can be used.

\n", "default": null }, { - "name": "use_container_width", - "type_name": "bool", + "name": "max_entries", + "type_name": "int or None", "is_optional": false, - "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", - "default": null + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None" + }, + { + "name": "ttl", + "type_name": "float or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.

\n", + "default": "None" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/map.py#L91" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/runtime/legacy_caching/caching.py#L395" }, - "DeltaGenerator.markdown": { - "name": "markdown", - "signature": "element.markdown(body, unsafe_allow_html=False, *, help=None)", - "examples": "
\n
\nimport streamlit as st\n\nst.markdown("*Streamlit* is **really** ***cool***.")\nst.markdown('''\n    :red[Streamlit] :orange[can] :green[write] :blue[text] :violet[in]\n    :gray[pretty] :rainbow[colors].''')\nst.markdown("Here's a bouquet &mdash;\\\n            :tulip::cherry_blossom::rose::hibiscus::sunflower::blossom:")\n\nmulti = '''If you end a line with two spaces,\na soft return is used for the next line.\n\nTwo (or more) newline characters in a row will result in a hard return.\n'''\nst.markdown(multi)\n
\n\n \n
\n", - "description": "

Display string formatted as Markdown.

\n", + "streamlit.camera_input": { + "name": "camera_input", + "signature": "st.camera_input(label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", + "description": "Display a widget that returns pictures from the user's webcam.", "args": [ { - "name": "body", + "name": "label", "type_name": "str", "is_optional": false, - "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", + "description": "

A short label explaining to the user what this widget is used for.

\n", "default": null }, { - "name": "unsafe_allow_html", - "type_name": "bool", + "name": "key", + "type_name": "str or int", "is_optional": false, - "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", "default": null }, { "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the Markdown.

\n", + "description": "

A tooltip that gets displayed next to the camera input.

\n", "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/markdown.py#L31" - }, - "DeltaGenerator.metric": { - "name": "metric", - "signature": "element.metric(label, value, delta=None, delta_color=\"normal\", help=None, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n

st.metric looks especially nice in combination with st.columns:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n

The delta indicator color can also be inverted or turned off:

\n
\nimport streamlit as st\n\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n
\n", - "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", - "args": [ + }, { - "name": "label", - "type_name": "str", + "name": "on_change", + "type_name": "callable", "is_optional": false, - "description": "

The header or title for the metric. The label can optionally contain\nMarkdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "description": "

An optional callback invoked when this camera_input's value\nchanges.

\n", "default": null }, { - "name": "value", - "type_name": "int, float, str, or None", + "name": "args", + "type_name": "tuple", "is_optional": false, - "description": "

Value of the metric. None is rendered as a long dash.

\n", + "description": "

An optional tuple of args to pass to the callback.

\n", "default": null }, { - "name": "delta", - "type_name": "int, float, str, or None", + "name": "kwargs", + "type_name": "dict", "is_optional": false, - "description": "

Indicator of how the metric changed, rendered with an arrow below\nthe metric. If delta is negative (int/float) or starts with a minus\nsign (str), the arrow points down and the text is red; else the\narrow points up and the text is green. If None (default), no delta\nindicator is shown.

\n", + "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, { - "name": "delta_color", - "type_name": "\"normal\", \"inverse\", or \"off\"", + "name": "disabled", + "type_name": "bool", "is_optional": false, - "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", - "default": null - }, + "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + } + ], + "returns": [ { - "name": "help", + "type_name": "None or UploadedFile", + "is_generator": false, + "description": "

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/camera_input.py#L47" + }, + "streamlit.caption": { + "name": "caption", + "signature": "st.caption(body, unsafe_allow_html=False)", + "example": "
\n
\nst.caption('This is a string that explains something above.')\n
\n
\n", + "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", + "args": [ + { + "name": "body", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the metric label.

\n", + "description": "

The text to display.

\n", "default": null }, { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "name": "unsafe_allow_html", + "type_name": "bool", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" + "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n

Also note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.

\n

If you decide to turn on HTML anyway, we ask you to please tell us your\nexact use case here:\nhttps://discuss.streamlit.io/t/96 .

\n

This will help us come up with safe APIs that allow you to do what you\nwant.

\n", + "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/metric.py#L46" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/markdown.py#L193" }, - "DeltaGenerator.multiselect": { - "name": "multiselect", - "signature": "element.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, max_selections=None, placeholder=\"Choose an option\", disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n
\n", - "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", + "streamlit.checkbox": { + "name": "checkbox", + "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a checkbox widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this checkbox is for.

\n", "default": null }, { - "name": "options", - "type_name": "Sequence[V], numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", - "is_optional": false, - "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", - "default": "." - }, - { - "name": "default", - "type_name": "[V], V, or None", - "is_optional": false, - "description": "

List of default values. Can also be a single value.

\n", - "default": "values." - }, - { - "name": "format_func", - "type_name": "function", + "name": "value", + "type_name": "bool", "is_optional": false, - "description": "

Function to modify the display of selectbox options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe multiselect.

\n", + "description": "

Preselect the checkbox when it first renders. This will be\ncast to bool internally.

\n", "default": null }, { @@ -7149,14 +6027,14 @@ "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the multiselect.

\n", + "description": "

An optional tooltip that gets displayed next to the checkbox.

\n", "default": null }, { "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this multiselect's value changes.

\n", + "description": "

An optional callback invoked when this checkbox's value changes.

\n", "default": null }, { @@ -7173,92 +6051,67 @@ "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, - { - "name": "max_selections", - "type_name": "int", - "is_optional": false, - "description": "

The max selections that can be selected at a time.\nThis argument can only be supplied by keyword.

\n", - "default": null - }, - { - "name": "placeholder", - "type_name": "str", - "is_optional": false, - "description": "

A string to display when no options are selected. Defaults to 'Choose an option'.

\n", - "default": "s" - }, { "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

An optional boolean, which disables the multiselect widget if set\nto True. The default is False. This argument can only be supplied\nby keyword.

\n", - "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" + "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" } ], "returns": [ { - "type_name": "list", + "type_name": "bool", "is_generator": false, - "description": "

A list with the selected options

\n", + "description": "

Whether or not the checkbox is checked.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/multiselect.py#L146" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/checkbox.py#L36" }, - "DeltaGenerator.number_input": { - "name": "number_input", - "signature": "element.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n
\n", - "description": "

Display a numeric input widget.

\n
\n

Note

\n

Integer values exceeding +/- (1<<53) - 1 cannot be accurately\nstored or returned by the widget due to serialization contstraints\nbetween the Python server and JavaScript client. You must handle\nsuch numbers as floats, leading to a loss in precision.

\n
\n", + "streamlit.code": { + "name": "code", + "signature": "st.code(body, language=\"python\")", + "example": "
\n
\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", + "description": "

Display a code block with optional syntax highlighting.

\n

(This is a convenience wrapper around st.markdown())

\n", "args": [ { - "name": "label", + "name": "body", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

The string to display as code.

\n", "default": null }, { - "name": "min_value", - "type_name": "int, float, or None", + "name": "language", + "type_name": "str", "is_optional": false, - "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", + "description": "

The language that the code is written in, for syntax highlighting.\nIf omitted, the code will be unstyled.

\n

For a list of available language imports, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", "default": null - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/markdown.py#L132" + }, + "streamlit.color_picker": { + "name": "color_picker", + "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a color picker widget.", + "args": [ { - "name": "max_value", - "type_name": "int, float, or None", + "name": "label", + "type_name": "str", "is_optional": false, - "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", + "description": "

A short label explaining to the user what this input is for.

\n", "default": null }, { "name": "value", - "type_name": "int, float, or None", - "is_optional": false, - "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", - "default": "min_value" - }, - { - "name": "step", - "type_name": "int, float, or None", - "is_optional": false, - "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", - "default": "1" - }, - { - "name": "format", - "type_name": "str or None", + "type_name": "str", "is_optional": false, - "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. Output must be purely numeric. This does not impact\nthe return value. Valid formatters: %d %e %f %g %i %u

\n", - "default": null + "description": "

The hex value of this widget when it first renders. If None,\ndefaults to black.

\n", + "default": "black" }, { "name": "key", @@ -7271,14 +6124,14 @@ "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the input.

\n", + "description": "

An optional tooltip that gets displayed next to the color picker.

\n", "default": null }, { "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this number_input's value changes.

\n", + "description": "

An optional callback invoked when this color_picker's value\nchanges.

\n", "default": null }, { @@ -7299,192 +6152,124 @@ "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

An optional boolean, which disables the number input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", - "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" + "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" } ], "returns": [ { - "type_name": "int or float", + "type_name": "str", "is_generator": false, - "description": "

The current value of the numeric input widget. The return type\nwill match the data type of the value parameter.

\n", + "description": "

The selected color as a hex string.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/number_input.py#L67" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/color_picker.py#L35" }, - "DeltaGenerator.plotly_chart": { - "name": "plotly_chart", - "signature": "element.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", theme=\"streamlit\", **kwargs)", - "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport numpy as np\nimport plotly.figure_factory as ff\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n        hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n
\n", - "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", + "streamlit.columns": { + "name": "columns", + "signature": "st.columns(spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put columns inside another column.

\n
\n", "args": [ { - "name": "figure_or_data", - "type_name": "plotly.graph_objs.Figure, plotly.graph_objs.Data,", - "is_optional": false, - "description": "

dict/list of plotly.graph_objs.Figure/Data

\n

See https://plot.ly/python/ for examples of graph descriptions.

\n", - "default": null - }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", - "default": null - }, - { - "name": "sharing", - "type_name": "\"streamlit\", \"private\", \"secret\", or \"public\"", + "name": "spec", + "type_name": "int or list of numbers", "is_optional": false, - "description": "

Use "streamlit" to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", "default": null }, { - "name": "theme", - "type_name": "\"streamlit\" or None", + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", "is_optional": false, - "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", - "default": "behavior" - }, - { - "name": "**kwargs", - "type_name": null, - "is_optional": null, - "description": "

Any argument accepted by Plotly's plot() function.

\n", - "default": null + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" } ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/plotly_chart.py#L81" - }, - "DeltaGenerator.progress": { - "name": "progress", - "signature": "element.progress(value, text=None)", - "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport streamlit as st\nimport time\n\nprogress_text = "Operation in progress. Please wait."\nmy_bar = st.progress(0, text=progress_text)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1, text=progress_text)\n
\n
\n", - "description": "

Display a progress bar.

\n", - "args": [ - { - "name": "value", - "type_name": "int or float", - "is_optional": false, - "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", - "default": null - }, + "returns": [ { - "name": "text", - "type_name": "str or None", - "is_optional": false, - "description": "

A message to display above the progress bar. The text can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", - "default": null + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null } ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/progress.py#L66" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/layouts.py#L72" }, - "DeltaGenerator.pydeck_chart": { - "name": "pydeck_chart", - "signature": "element.pydeck_chart(pydeck_obj=None, use_container_width=False)", - "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport pydeck as pdk\n\nchart_data = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=chart_data,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=chart_data,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", - "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", - "args": [ - { - "name": "pydeck_obj", - "type_name": "pydeck.Deck or None", - "is_optional": false, - "description": "

Object specifying the PyDeck chart to draw.

\n", - "default": null - }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "", - "default": null - } - ], + "streamlit.container": { + "name": "container", + "signature": "st.container()", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/deck_gl_json_chart.py#L37" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/layouts.py#L28" }, - "DeltaGenerator.pyplot": { - "name": "pyplot", - "signature": "element.pyplot(fig=None, clear_figure=None, use_container_width=True, **kwargs)", - "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", - "example": "
\n
\nimport streamlit as st\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n
\n", - "description": "

Display a matplotlib.pyplot figure.

\n", + "streamlit.dataframe": { + "name": "dataframe", + "signature": "st.dataframe(data=None, width=None, height=None)", + "examples": "
\n
\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\nst.dataframe(df, 200, 100)\n
\n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a dataframe as an interactive table.", "args": [ { - "name": "fig", - "type_name": "Matplotlib Figure", + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", "is_optional": false, - "description": "

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

\n", + "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. (It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.)\nStyler support is experimental!\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null }, { - "name": "clear_figure", - "type_name": "bool", - "is_optional": false, - "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", - "default": "based" - }, - { - "name": "use_container_width", - "type_name": "bool", + "name": "width", + "type_name": "int or None", "is_optional": false, - "description": "

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

\n", - "default": "s" + "description": "

Desired width of the UI element expressed in pixels. If None, a\ndefault width based on the page width is used.

\n", + "default": "width" }, { - "name": "**kwargs", - "type_name": "any", + "name": "height", + "type_name": "int or None", "is_optional": false, - "description": "

Arguments to pass to Matplotlib's savefig function.

\n", - "default": null + "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/pyplot.py#L38" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/dataframe_selector.py#L37" }, - "DeltaGenerator.radio": { - "name": "radio", - "signature": "element.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, captions=None, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\ngenre = st.radio(\n    "What's your favorite movie genre",\n    [":rainbow[Comedy]", "***Drama***", "Documentary :movie_camera:"],\n    captions = ["Laugh out loud.", "Get the popcorn.", "Never stop learning."])\n\nif genre == ':rainbow[Comedy]':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn\\'t select comedy.")\n
\n\n \n
\n", - "description": "

Display a radio button widget.

\n", + "streamlit.date_input": { + "name": "date_input", + "signature": "st.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\nd = st.date_input(\n    "When's your birthday",\n    datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a date input widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this radio group is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this date input is for.

\n", "default": null }, { - "name": "options", - "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "name": "value", + "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", "is_optional": false, - "description": "

Labels for the radio options. Labels can include markdown as\ndescribed in the label parameter and will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", - "default": "." + "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", + "default": "today" }, { - "name": "index", - "type_name": "int", + "name": "min_value", + "type_name": "datetime.date or datetime.datetime", "is_optional": false, - "description": "

The index of the preselected option on first render.

\n", - "default": null + "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", + "default": "value" }, { - "name": "format_func", - "type_name": "function", + "name": "max_value", + "type_name": "datetime.date or datetime.datetime", "is_optional": false, - "description": "

Function to modify the display of radio options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe radio.

\n", - "default": null + "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", + "default": "value" }, { "name": "key", @@ -7497,14 +6282,14 @@ "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the radio.

\n", + "description": "

An optional tooltip that gets displayed next to the input.

\n", "default": null }, { "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this radio's value changes.

\n", + "description": "

An optional callback invoked when this date_input's value changes.

\n", "default": null }, { @@ -7525,74 +6310,53 @@ "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

An optional boolean, which disables the radio button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", - "default": "False." - }, - { - "name": "horizontal", - "type_name": "bool", - "is_optional": false, - "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", - "default": "false" - }, - { - "name": "captions", - "type_name": "iterable of str or None", - "is_optional": false, - "description": "

A list of captions to show below each radio button. If None (default),\nno captions are shown.

\n", - "default": null - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" + "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" } ], "returns": [ { - "type_name": "any", + "type_name": "datetime.date or a tuple with 0-2 dates", "is_generator": false, - "description": "

The selected option.

\n", + "description": "

The current value of the date input widget.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/radio.py#L76" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/time_widgets.py#L305" }, - "DeltaGenerator.select_slider": { - "name": "select_slider", - "signature": "element.select_slider(label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "examples": "
\nimport streamlit as st\n\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nimport streamlit as st\n\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n ", - "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", + "streamlit.download_button": { + "name": "download_button", + "signature": "st.download_button(label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False)", + "examples": "
\n

Download a large DataFrame as a CSV:

\n
\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this button is for.

\n", "default": null }, { - "name": "options", - "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "name": "data", + "type_name": "str or bytes or file", "is_optional": false, - "description": "

Labels for the slider options. All options will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", - "default": "." + "description": "

The contents of the file to be downloaded. See example below for\ncaching techniques to avoid recomputing this data unnecessarily.

\n", + "default": null }, { - "name": "value", - "type_name": "a supported type or a tuple/list of supported types or None", + "name": "file_name", + "type_name": "str", "is_optional": false, - "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to first option.

\n", - "default": "first" + "description": "

An optional string to use as the name of the file to be downloaded,\nsuch as 'my_file.csv'. If not specified, the name will be\nautomatically generated.

\n", + "default": null }, { - "name": "format_func", - "type_name": "function", + "name": "mime", + "type_name": "str or None", "is_optional": false, - "description": "

Function to modify the display of the labels from the options.\nargument. It receives the option as an argument and its output\nwill be cast to str.

\n", - "default": null + "description": "

The MIME type of the data. If None, defaults to "text/plain"\n(if data is of type str or is a textual file) or\n"application/octet-stream" (if data is of type bytes or is a\nbinary file).

\n", + "default": "s" }, { "name": "key", @@ -7605,14 +6369,14 @@ "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the select slider.

\n", + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", "default": null }, { - "name": "on_change", + "name": "on_click", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this select_slider's value changes.

\n", + "description": "

An optional callback invoked when this button is clicked.

\n", "default": null }, { @@ -7633,178 +6397,282 @@ "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

An optional boolean, which disables the select slider if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", - "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" + "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" } ], "returns": [ { - "type_name": "any value or tuple of any value", + "type_name": "bool", "is_generator": false, - "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/select_slider.py#L107" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/button.py#L118" }, - "DeltaGenerator.selectbox": { - "name": "selectbox", - "signature": "element.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=\"Select...\", disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n
\n", - "description": "

Display a select widget.

\n", + "streamlit.echo": { + "name": "echo", + "signature": "st.echo(code_location=\"above\")", + "example": "
\n
\nwith st.echo():\n    st.write('This code will be printed')\n
\n
\n", + "description": "Use in a `with` block to draw some code on the app, then execute it.", "args": [ { - "name": "label", - "type_name": "str", - "is_optional": false, - "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", - "default": null - }, - { - "name": "options", - "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", - "is_optional": false, - "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", - "default": "." - }, - { - "name": "index", - "type_name": "int", - "is_optional": false, - "description": "

The index of the preselected option on first render.

\n", - "default": null - }, - { - "name": "format_func", - "type_name": "function", + "name": "code_location", + "type_name": "\"above\" or \"below\"", "is_optional": false, - "description": "

Function to modify the display of the labels. It receives the option\nas an argument and its output will be cast to str.

\n", + "description": "

Whether to show the echoed code before or after the results of the\nexecuted code block.

\n", "default": null - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/echo.py#L25" + }, + "streamlit.empty": { + "name": "empty", + "signature": "st.empty()", + "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", + "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/empty.py#L24" + }, + "streamlit.error": { + "name": "error", + "signature": "st.error(body, *, icon=None)", + "example": "
\n
\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", + "description": "Display error message.", + "args": [ { - "name": "key", - "type_name": "str or int", + "name": "icon", + "type_name": "None", "is_optional": false, - "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", - "default": null + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" }, { - "name": "help", + "name": "body", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the selectbox.

\n", - "default": null - }, - { - "name": "on_change", - "type_name": "callable", - "is_optional": false, - "description": "

An optional callback invoked when this selectbox's value changes.

\n", - "default": null - }, - { - "name": "args", - "type_name": "tuple", - "is_optional": false, - "description": "

An optional tuple of args to pass to the callback.

\n", + "description": "

The error text to display.

\n", "default": null - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/alert.py#L39" + }, + "streamlit.exception": { + "name": "exception", + "signature": "st.exception(exception)", + "example": "
\n
\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", + "description": "Display an exception.", + "args": [ { - "name": "kwargs", - "type_name": "dict", + "name": "exception", + "type_name": "Exception", "is_optional": false, - "description": "

An optional dict of kwargs to pass to the callback.

\n", + "description": "

The exception to display.

\n", "default": null - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/exception.py#L46" + }, + "streamlit.expander": { + "name": "expander", + "signature": "st.expander(label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write("""\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    """)\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write("""\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n""")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ { - "name": "placeholder", + "name": "label", "type_name": "str", "is_optional": false, - "description": "

A string to display when no options are selected. Defaults to 'Select...'.

\n

A selectbox can't be empty, so a placeholder only displays while a\nuser's cursor is in a selectbox after manually deleting the current\nselection. A future update will allow selectboxes to be empty.

\n", - "default": "s" + "description": "

A string to use as the header for the expander.

\n", + "default": null }, { - "name": "disabled", + "name": "expanded", "type_name": "bool", "is_optional": false, - "description": "

An optional boolean, which disables the selectbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", - "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" } ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/layouts.py#L283" + }, + "streamlit.experimental_get_query_params": { + "name": "experimental_get_query_params", + "signature": "st.experimental_get_query_params()", + "example": "
\n

Let's say the user's web browser is at\nhttp://localhost:8501/?show_map=True&selected=asia&selected=america.\nThen, you can get the query parameters using the following:

\n
\nst.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\n

Note that the values in the returned dict are always lists. This is\nbecause we internally use Python's urllib.parse.parse_qs(), which behaves\nthis way. And this behavior makes sense when you consider that every item\nin a query string is potentially a 1-element array.

\n
\n", + "description": "Return the query parameters that is currently showing in the browser's URL bar.", + "args": [], "returns": [ { - "type_name": "any", + "type_name": "dict", "is_generator": false, - "description": "

The selected option

\n", + "description": "

The current query parameters as a dict. "Query parameters" are the part of the URL that comes\nafter the first "?".

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/selectbox.py#L72" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/__init__.py#L333" }, - "DeltaGenerator.slider": { - "name": "slider", - "signature": "element.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "examples": "
\n
\nimport streamlit as st\n\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nimport streamlit as st\n\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nimport streamlit as st\nfrom datetime import time\n\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nimport streamlit as st\nfrom datetime import datetime\n\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n
\n", - "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n
\n

Note

\n

Integer values exceeding +/- (1<<53) - 1 cannot be accurately\nstored or returned by the widget due to serialization contstraints\nbetween the Python server and JavaScript client. You must handle\nsuch numbers as floats, leading to a loss in precision.

\n
\n", + "streamlit.experimental_memo": { + "name": "experimental_memo", + "signature": "st.experimental_memo(func=None, *, persist=None, show_spinner=True, suppress_st_warning=False, max_entries=None, ttl=None)", + "example": "
\n
\n@st.experimental_memo\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\n@st.experimental_memo(persist="disk")\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

By default, all parameters to a memoized function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\n@st.experimental_memo\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nconnection = make_database_connection()\nd1 = fetch_and_clean_data(connection, num_rows=10)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nanother_connection = make_database_connection()\nd2 = fetch_and_clean_data(another_connection, num_rows=10)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _database_connection parameter was different\n# in both calls.\n
\n

A memoized function's cache can be procedurally cleared:

\n
\n@st.experimental_memo\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nfetch_and_clean_data.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Function decorator to memoize function executions.

\n

Memoized data is stored in "pickled" form, which means that the return\nvalue of a memoized function must be pickleable.

\n

Each caller of a memoized function gets its own copy of the cached data.

\n

You can clear a memoized function's cache with f.clear().

\n", "args": [ { - "name": "label", - "type_name": "str", + "name": "func", + "type_name": "callable", "is_optional": false, - "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

The function to memoize. Streamlit hashes the function's source code.

\n", "default": null }, { - "name": "min_value", - "type_name": "a supported type or None", + "name": "persist", + "type_name": "str or None", "is_optional": false, - "description": "

The minimum permitted value.\nDefaults to 0 if the value is an int, 0.0 if a float,\nvalue - timedelta(days=14) if a date/datetime, time.min if a time

\n", - "default": "0" + "description": "

Optional location to persist cached data to. Currently, the only\nvalid value is "disk", which will persist to the local disk.

\n", + "default": null }, { - "name": "max_value", - "type_name": "a supported type or None", + "name": "show_spinner", + "type_name": "boolean", "is_optional": false, - "description": "

The maximum permitted value.\nDefaults to 100 if the value is an int, 1.0 if a float,\nvalue + timedelta(days=14) if a date/datetime, time.max if a time

\n", - "default": "100" + "description": "

Enable the spinner. Default is True to show a spinner when there is\na cache miss.

\n", + "default": "True" }, { - "name": "value", - "type_name": "a supported type or a tuple/list of supported types or None", + "name": "suppress_st_warning", + "type_name": "boolean", "is_optional": false, - "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to min_value.

\n", - "default": "min_value." + "description": "

Suppress warnings about calling Streamlit functions from within\nthe cached function.

\n", + "default": null }, { - "name": "step", - "type_name": "int, float, timedelta, or None", + "name": "max_entries", + "type_name": "int or None", "is_optional": false, - "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", - "default": "1" + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None" }, { - "name": "format", - "type_name": "str or None", + "name": "ttl", + "type_name": "float or None", "is_optional": false, - "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. This does not impact the return value.\nFormatter for int/float supports: %d %e %f %g %i\nFormatter for date/time/datetime uses Moment.js notation:\nhttps://momentjs.com/docs/#/displaying/format/

\n", - "default": null - }, - { - "name": "key", + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/runtime/caching/memo_decorator.py#L228" + }, + "streamlit.experimental_rerun": { + "name": "experimental_rerun", + "signature": "st.experimental_rerun()", + "description": "

Rerun the script immediately.

\n

When st.experimental_rerun() is called, the script is halted - no\nmore statements will be run, and the script will be queued to re-run\nfrom the top.

\n

If this function is called outside of Streamlit, it will raise an\nException.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/__init__.py#L514" + }, + "streamlit.experimental_set_query_params": { + "name": "experimental_set_query_params", + "signature": "st.experimental_set_query_params(**query_params)", + "example": "
\n

To point the user's web browser to something like\n"http://localhost:8501/?show_map=True&selected=asia&selected=america",\nyou would do the following:

\n
\nst.experimental_set_query_params(\n    show_map=True,\n    selected=["asia", "america"],\n)\n
\n
\n", + "description": "Set the query parameters that are shown in the browser's URL bar.", + "args": [ + { + "name": "**query_params", + "type_name": "dict", + "is_optional": false, + "description": "

The query parameters to set, as key-value pairs.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/__init__.py#L363" + }, + "streamlit.experimental_show": { + "name": "experimental_show", + "signature": "st.experimental_show(*args)", + "notes": "
\n

This is an experimental feature with usage limitations:

\n
    \n
  • The method must be called with the name show.
  • \n
  • Must be called in one line of code, and only once per line.
  • \n
  • \n
    When passing multiple arguments the inclusion of , or ) in a string
    \n
    argument may cause an error.
    \n
    \n
  • \n
\n
\n", + "example": "
\n
\ndataframe = pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n})\nst.experimental_show(dataframe)\n
\n
\n", + "description": "

Write arguments and argument names to your app for debugging purposes.

\n

Show() has similar properties to write():

\n
\n
    \n
  1. You can pass in multiple arguments, all of which will be debugged.
  2. \n
  3. It returns None, so it's "slot" in the app cannot be reused.
  4. \n
\n
\n

Note: This is an experimental feature. See\nhttps://docs.streamlit.io/library/advanced-features/prerelease#experimental for more information.

\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to debug in the App.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/__init__.py#L253" + }, + "streamlit.experimental_singleton": { + "name": "experimental_singleton", + "signature": "st.experimental_singleton(func=None, *, show_spinner=True, suppress_st_warning=False)", + "example": "
\n
\n@st.experimental_singleton\ndef get_database_session(url):\n    # Create a database session object that points to the URL.\n    return session\n\ns1 = get_database_session(SESSION_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(SESSION_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the connection object in s1 is the same as in s2.\n\ns3 = get_database_session(SESSION_URL_2)\n# This is a different URL, so the function executes.\n
\n

By default, all parameters to a singleton function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\n@st.experimental_singleton\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\ns1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _sessionmaker parameter was different\n# in both calls.\n
\n

A singleton function's cache can be procedurally cleared:

\n
\n@st.experimental_singleton\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\nget_database_session.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Function decorator to store singleton objects.

\n

Each singleton object is shared across all users connected to the app.\nSingleton objects must be thread-safe, because they can be accessed from\nmultiple threads concurrently.

\n

(If thread-safety is an issue, consider using st.session_state to\nstore per-session singleton objects instead.)

\n

You can clear a memoized function's cache with f.clear().

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function that creates the singleton. Streamlit hashes the\nfunction's source code.

\n", + "default": null + }, + { + "name": "show_spinner", + "type_name": "boolean", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the singleton is being created.

\n", + "default": "True" + }, + { + "name": "suppress_st_warning", + "type_name": "boolean", + "is_optional": false, + "description": "

Suppress warnings about calling Streamlit functions from within\nthe singleton function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/runtime/caching/singleton_decorator.py#L150" + }, + "streamlit.file_uploader": { + "name": "file_uploader", + "signature": "st.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this file uploader is for.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str or list of str or None", + "is_optional": false, + "description": "

Array of allowed extensions. ['png', 'jpg']\nThe default is None, which means all extensions are allowed.

\n", + "default": "None" + }, + { + "name": "accept_multiple_files", + "type_name": "bool", + "is_optional": false, + "description": "

If True, allows the user to upload multiple files at the same time,\nin which case the return value will be a list of files.\nDefault: False

\n", + "default": "False" + }, + { + "name": "key", "type_name": "str or int", "is_optional": false, "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", @@ -7814,14 +6682,14 @@ "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the slider.

\n", + "description": "

A tooltip that gets displayed next to the file uploader.

\n", "default": null }, { "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this slider's value changes.

\n", + "description": "

An optional callback invoked when this file_uploader's value\nchanges.

\n", "default": null }, { @@ -7842,429 +6710,579 @@ "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

An optional boolean, which disables the slider if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", - "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" + "description": "

An optional boolean, which disables the file uploader if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" } ], "returns": [ { - "type_name": "int/float/date/time/datetime or tuple of int/float/date/time/datetime", + "type_name": "None or UploadedFile or list of UploadedFile", "is_generator": false, - "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "description": "
    \n
  • If accept_multiple_files is False, returns either None or\nan UploadedFile object.
  • \n
  • If accept_multiple_files is True, returns a list with the\nuploaded files as UploadedFile objects. If no files were\nuploaded, returns an empty list.
  • \n
\n

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/slider.py#L173" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/file_uploader.py#L132" }, - "DeltaGenerator.snow": { - "name": "snow", - "signature": "element.snow()", - "example": "
\n
\nimport streamlit as st\n\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", - "description": "

Draw celebratory snowfall.

\n", - "args": [], + "streamlit.form": { + "name": "form", + "signature": "st.form(key, clear_on_submit=False)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n

Inserting elements out of order:

\n
\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n
\n", + "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

A string that identifies the form. Each form must have its own\nkey. (This key is not displayed to the user in the interface.)

\n", + "default": null + }, + { + "name": "clear_on_submit", + "type_name": "bool", + "is_optional": false, + "description": "

If True, all widgets inside the form will be reset to their default\nvalues after the user presses the Submit button. Defaults to False.\n(Note that Custom Components are unaffected by this flag, and\nwill not be reset to their defaults on form submission.)

\n", + "default": "values" + } + ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/snow.py#L25" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/form.py#L112" }, - "DeltaGenerator.status": { - "name": "status", - "signature": "element.status(label, *, expanded=False, state=\"running\")", - "examples": "
\n

You can use with notation to insert any element into an status container:

\n
\nimport time\nimport streamlit as st\n\nwith st.status("Downloading data..."):\n    st.write("Searching for data...")\n    time.sleep(2)\n    st.write("Found URL.")\n    time.sleep(1)\n    st.write("Downloading data...")\n    time.sleep(1)\n\nst.button('Rerun')\n
\n\n \n

You can also use .update() on the container to change the label, state,\nor expanded state:

\n
\nimport time\nimport streamlit as st\n\nwith st.status("Downloading data...", expanded=True) as status:\n    st.write("Searching for data...")\n    time.sleep(2)\n    st.write("Found URL.")\n    time.sleep(1)\n    st.write("Downloading data...")\n    time.sleep(1)\n    status.update(label="Download complete!", state="complete", expanded=False)\n\nst.button('Rerun')\n
\n\n \n
\n", - "description": "

Insert a status container to display output from long-running tasks.

\n

Inserts a container into your app that is typically used to show the status and\ndetails of a process or task. The container can hold multiple elements and can\nbe expanded or collapsed by the user similar to st.expander.\nWhen collapsed, all that is visible is the status icon and label.

\n

The label, state, and expanded state can all be updated by calling .update()\non the returned object. To add elements to the returned container, you can\nuse "with" notation (preferred) or just call methods directly on the returned\nobject.

\n

By default, st.status() initializes in the "running" state. When called using\n"with" notation, it automatically updates to the "complete" state at the end\nof the "with" block. See examples below for more details.

\n", + "streamlit.form_submit_button": { + "name": "form_submit_button", + "signature": "st.form_submit_button(label=\"Submit\", help=None, on_click=None, args=None, kwargs=None)", + "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

The initial label of the status container. The label can optionally\ncontain Markdown and supports the following elements: Bold,\nItalics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents)\nrender. Display unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "description": "

A short label explaining to the user what this button is for.\nDefaults to "Submit".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

A tooltip that gets displayed when the button is hovered over.\nDefaults to None.

\n", + "default": "None" + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", "default": null }, { - "name": "expanded", - "type_name": "bool", + "name": "args", + "type_name": "tuple", "is_optional": false, - "description": "

If True, initializes the status container in "expanded" state. Defaults to\nFalse (collapsed).

\n", - "default": "s" + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null }, { - "name": "state", - "type_name": "\"running\", \"complete\", or \"error\"", + "name": "kwargs", + "type_name": "dict", "is_optional": false, - "description": "

The initial state of the status container which determines which icon is\nshown:

\n
    \n
  • running (default): A spinner icon is shown.
  • \n
  • complete: A checkmark icon is shown.
  • \n
  • error: An error icon is shown.
  • \n
\n", + "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null } ], "returns": [ { - "type_name": "StatusContainer", + "type_name": "bool", "is_generator": false, - "description": "

A mutable status container that can hold multiple elements. The label, state,\nand expanded state can be updated after creation via .update().

\n", + "description": "

True if the button was clicked.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/layouts.py#L414" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/form.py#L200" }, - "DeltaGenerator.subheader": { - "name": "subheader", - "signature": "element.subheader(body, anchor=None, *, help=None, divider=False)", - "examples": "
\n
\nimport streamlit as st\n\nst.subheader('This is a subheader with a divider', divider='rainbow')\nst.subheader('_Streamlit_ is :blue[cool] :sunglasses:')\n
\n\n \n
\n", - "description": "

Display text in subheader formatting.

\n", + "streamlit.get_option": { + "name": "get_option", + "signature": "st.get_option(key)", + "description": "

Return the current value of a given Streamlit config option.

\n

Run streamlit config show in the terminal to see all available options.

\n", "args": [ { - "name": "body", + "name": "key", "type_name": "str", "is_optional": false, - "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", - "default": null - }, - { - "name": "anchor", - "type_name": "str or False", - "is_optional": false, - "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "description": "

The config option key of the form "section.optionName". To see all\navailable options, run streamlit config show on a terminal.

\n", "default": null - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/config.py#L90" + }, + "streamlit.graphviz_chart": { + "name": "graphviz_chart", + "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nimport graphviz as graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a graph using the dagre-d3 library.", + "args": [ { - "name": "help", - "type_name": "str", + "name": "figure_or_dot", + "type_name": "graphviz.dot.Graph, graphviz.dot.Digraph, str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the subheader.

\n", + "description": "

The Graphlib graph object or dot string to display

\n", "default": null }, { - "name": "divider", - "type_name": "bool or \u201cblue\u201d, \u201cgreen\u201d, \u201corange\u201d, \u201cred\u201d, \u201cviolet\u201d, \u201cgray\u201d/\"grey\", or \u201crainbow\u201d", + "name": "use_container_width", + "type_name": "bool", "is_optional": false, - "description": "

Shows a colored divider below the header. If True, successive\nheaders will cycle through divider colors. That is, the first\nheader will have a blue line, the second header will have a\ngreen line, and so on. If a string, the color can be set to one of\nthe following: blue, green, orange, red, violet, gray/grey, or\nrainbow.

\n", + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/heading.py#L111" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/graphviz_chart.py#L30" }, - "DeltaGenerator.success": { - "name": "success", - "signature": "element.success(body, *, icon=None)", - "example": "
\n
\nimport streamlit as st\n\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", - "description": "

Display a success message.

\n", + "streamlit.header": { + "name": "header", + "signature": "st.header(body, anchor=None)", + "example": "
\n
\nst.header('This is a header')\n
\n
\n", + "description": "Display text in header formatting.", "args": [ { "name": "body", "type_name": "str", "is_optional": false, - "description": "

The success text to display.

\n", + "description": "

The text to display.

\n", "default": null }, { - "name": "icon", - "type_name": "str or None", + "name": "anchor", + "type_name": "str", "is_optional": false, - "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", - "default": "None" + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/alert.py#L124" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/markdown.py#L81" }, - "DeltaGenerator.table": { - "name": "table", - "signature": "element.table(data=None)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n
\n", - "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", + "streamlit.help": { + "name": "help", + "signature": "st.help(obj)", + "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nst.help(pandas.DataFrame)\n
\n

Want to quickly check what datatype is output by a certain function?\nTry:

\n
\nx = my_poorly_documented_function()\nst.help(x)\n
\n
\n", + "description": "

Display object's doc string, nicely formatted.

\n

Displays the doc string for this object.

\n", "args": [ { - "name": "data", - "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "name": "obj", + "type_name": "Object", "is_optional": false, - "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "description": "

The object whose docstring should be displayed.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L193" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/doc_string.py#L41" }, - "DeltaGenerator.tabs": { - "name": "tabs", - "signature": "element.tabs(tabs)", - "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\nimport streamlit as st\n\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n
\n", - "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", + "streamlit.image": { + "name": "image", + "signature": "st.image(image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", + "example": "
\n
\nfrom PIL import Image\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an image or list of images.", "args": [ { - "name": "tabs", - "type_name": "list of strings", + "name": "image", + "type_name": "numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]", "is_optional": false, - "description": "

Creates a tab for each string in the list. The first tab is selected by default.\nThe string is used as the name of the tab and can optionally contain Markdown,\nsupporting the following elements: Bold, Italics, Strikethroughs, Inline Code,\nEmojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", - "default": "." - } - ], - "returns": [ + "description": "

Monochrome image of shape (w,h) or (w,h,1)\nOR a color image of shape (w,h,3)\nOR an RGBA image of shape (w,h,4)\nOR a URL to fetch the image from\nOR a path of a local image file\nOR an SVG XML string like <svg xmlns=...</svg>\nOR a list of one of the above, to display multiple images.

\n", + "default": null + }, { - "type_name": "list of containers", - "is_generator": false, - "description": "

A list of container objects.

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/layouts.py#L207" - }, - "DeltaGenerator.text": { - "name": "text", - "signature": "element.text(body, *, help=None)", - "example": "
\n
\nimport streamlit as st\n\nst.text('This is some text.')\n
\n
\n", - "description": "

Write fixed-width and preformatted text.

\n", - "args": [ + "name": "caption", + "type_name": "str or list of str", + "is_optional": false, + "description": "

Image caption. If displaying multiple images, caption should be a\nlist of captions (one for each image).

\n", + "default": null + }, { - "name": "body", - "type_name": "str", + "name": "width", + "type_name": "int or None", "is_optional": false, - "description": "

The string to display.

\n", + "description": "

Image width. None means use the image width,\nbut do not exceed the width of the column.\nShould be set for SVG images, as they have no default image width.

\n", + "default": "image" + }, + { + "name": "use_column_width", + "type_name": "'auto' or 'always' or 'never' or bool", + "is_optional": false, + "description": "

If 'auto', set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf 'always' or True, set the image's width to the column width.\nIf 'never' or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", "default": null }, { - "name": "help", - "type_name": "str", + "name": "clamp", + "type_name": "bool", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the text.

\n", + "description": "

Clamp image pixel values to a valid range ([0-255] per channel).\nThis is only meaningful for byte array images; the parameter is\nignored for image URLs. If this is not set, and an image has an\nout-of-range value, an error will be thrown.

\n", "default": null + }, + { + "name": "channels", + "type_name": "'RGB' or 'BGR'", + "is_optional": false, + "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to 'RGB', meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to 'BGR', instead.

\n", + "default": "s" + }, + { + "name": "output_format", + "type_name": "'JPEG', 'PNG', or 'auto'", + "is_optional": false, + "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to 'auto' which identifies the compression type based\non the type and format of the image argument.

\n", + "default": "s" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/text.py#L27" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/image.py#L60" }, - "DeltaGenerator.text_area": { - "name": "text_area", - "signature": "element.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", - "description": "

Display a multi-line text input widget.

\n", + "streamlit.info": { + "name": "info", + "signature": "st.info(body, *, icon=None)", + "example": "
\n
\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", + "description": "Display an informational message.", "args": [ { - "name": "label", + "name": "icon", + "type_name": "None", + "is_optional": false, + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" + }, + { + "name": "body", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

The info text to display.

\n", "default": null - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/alert.py#L96" + }, + "streamlit.json": { + "name": "json", + "signature": "st.json(body, *, expanded=True)", + "example": "
\n
\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display object or string as a pretty-printed JSON string.", + "args": [ { - "name": "value", - "type_name": "object", + "name": "body", + "type_name": "Object or str", "is_optional": false, - "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "description": "

The object to print as JSON. All referenced objects should be\nserializable to JSON as well. If object is a string, we assume it\ncontains serialized JSON.

\n", "default": null }, { - "name": "height", - "type_name": "int or None", + "name": "expanded", + "type_name": "bool", "is_optional": false, - "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", - "default": "height" - }, + "description": "

An optional boolean that allows the user to set whether the initial\nstate of this json element should be expanded. Defaults to True.\nThis argument can only be supplied by keyword.

\n", + "default": "True" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/json.py#L28" + }, + "streamlit.latex": { + "name": "latex", + "signature": "st.latex(body)", + "example": "
\n
\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", + "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", + "args": [ { - "name": "max_chars", - "type_name": "int or None", + "name": "body", + "type_name": "str or SymPy expression", "is_optional": false, - "description": "

Maximum number of characters allowed in text area.

\n", + "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", "default": null - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/markdown.py#L236" + }, + "streamlit.line_chart": { + "name": "line_chart", + "signature": "st.line_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\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 \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ { - "name": "key", - "type_name": "str or int", + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict or None", "is_optional": false, - "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null }, { - "name": "help", - "type_name": "str", + "name": "x", + "type_name": "str or None", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the textarea.

\n", + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", "default": null }, { - "name": "on_change", - "type_name": "callable", + "name": "y", + "type_name": "str, sequence of str, or None", "is_optional": false, - "description": "

An optional callback invoked when this text_area's value changes.

\n", + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", "default": null }, { - "name": "args", - "type_name": "tuple", + "name": "width", + "type_name": "int", "is_optional": false, - "description": "

An optional tuple of args to pass to the callback.

\n", + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", "default": null }, { - "name": "kwargs", - "type_name": "dict", + "name": "height", + "type_name": "int", "is_optional": false, - "description": "

An optional dict of kwargs to pass to the callback.

\n", + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", "default": null }, { - "name": "placeholder", - "type_name": "str or None", + "name": "use_container_width", + "type_name": "bool", "is_optional": false, - "description": "

An optional string displayed when the text area is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", "default": null - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/dataframe_selector.py#L132" + }, + "streamlit.map": { + "name": "map", + "signature": "st.map(data=None, zoom=None, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a map with points on it.

\n

This is a wrapper around st.pydeck_chart to quickly create scatterplot\ncharts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more\ninfo on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ { - "name": "disabled", - "type_name": "bool", + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,", "is_optional": false, - "description": "

An optional boolean, which disables the text area if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", - "default": "False." + "description": "

or None\nThe data to be plotted. Must have columns called 'lat', 'lon',\n'latitude', or 'longitude'.

\n", + "default": null }, { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "name": "zoom", + "type_name": "int", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" + "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels

\n", + "default": null } ], - "returns": [ + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/map.py#L30" + }, + "streamlit.markdown": { + "name": "markdown", + "signature": "st.markdown(body, unsafe_allow_html=False)", + "example": "
\n
\nst.markdown('Streamlit is **_really_ cool**.')\n
\n
\n", + "description": "Display string formatted as Markdown.", + "args": [ { + "name": "body", "type_name": "str", - "is_generator": false, - "description": "

The current value of the text input widget.

\n", - "return_name": null + "is_optional": false, + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n

Also note that ``unsafe_allow_html`` is a temporary measure and may\nbe removed from Streamlit at any time.

\n

If you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:

\n

https://discuss.streamlit.io/t/96

\n

This will help us come up with safe APIs that allow you to do what\nyou want.

\n", + "default": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/text_widgets.py#L288" + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/markdown.py#L28" }, - "DeltaGenerator.text_input": { - "name": "text_input", - "signature": "element.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n
\n", - "description": "

Display a single-line text input widget.

\n", + "streamlit.metric": { + "name": "metric", + "signature": "st.metric(label, value, delta=None, delta_color=\"normal\", help=None)", + "example": "
\n
\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n \n (view standalone Streamlit app)\n \n

st.metric looks especially nice in combination with st.columns:

\n
\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n \n (view standalone Streamlit app)\n \n

The delta indicator color can also be inverted or turned off:

\n
\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

The header or Title for the metric

\n", "default": null }, { "name": "value", - "type_name": "object", + "type_name": "int, float, str, or None", "is_optional": false, - "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "description": "

Value of the metric. None is rendered as a long dash.

\n", "default": null }, { - "name": "max_chars", - "type_name": "int or None", + "name": "delta", + "type_name": "int, float, str, or None", "is_optional": false, - "description": "

Max number of characters allowed in text input.

\n", + "description": "

Indicator of how the metric changed, rendered with an arrow below\nthe metric. If delta is negative (int/float) or starts with a minus\nsign (str), the arrow points down and the text is red; else the\narrow points up and the text is green. If None (default), no delta\nindicator is shown.

\n", "default": null }, { - "name": "key", - "type_name": "str or int", + "name": "delta_color", + "type_name": "str", "is_optional": false, - "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", "default": null }, - { - "name": "type", - "type_name": "\"default\" or \"password\"", - "is_optional": false, - "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", - "default": "s" - }, { "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the input.

\n", + "description": "

An optional tooltip that gets displayed next to the metric label.

\n", "default": null - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/metric.py#L43" + }, + "streamlit.multiselect": { + "name": "multiselect", + "signature": "st.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", + "args": [ { - "name": "autocomplete", + "name": "label", "type_name": "str", "is_optional": false, - "description": "

An optional value that will be passed to the <input> element's\nautocomplete property. If unspecified, this value will be set to\n"new-password" for "password" inputs, and the empty string for\n"default" inputs. For more details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

\n", + "description": "

A short label explaining to the user what this select widget is for.

\n", "default": null }, { - "name": "on_change", - "type_name": "callable", + "name": "options", + "type_name": "Sequence[V], numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", "is_optional": false, - "description": "

An optional callback invoked when this text input's value changes.

\n", + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", "default": null }, { - "name": "args", - "type_name": "tuple", + "name": "default", + "type_name": "[V], V, or None", "is_optional": false, - "description": "

An optional tuple of args to pass to the callback.

\n", - "default": null + "description": "

List of default values. Can also be a single value.

\n", + "default": "values" }, { - "name": "kwargs", - "type_name": "dict", + "name": "format_func", + "type_name": "function", "is_optional": false, - "description": "

An optional dict of kwargs to pass to the callback.

\n", + "description": "

Function to modify the display of selectbox options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe multiselect.

\n", "default": null }, { - "name": "placeholder", - "type_name": "str or None", + "name": "key", + "type_name": "str or int", "is_optional": false, - "description": "

An optional string displayed when the text input is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", "default": null }, { - "name": "disabled", - "type_name": "bool", + "name": "help", + "type_name": "str", "is_optional": false, - "description": "

An optional boolean, which disables the text input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", - "default": "False." + "description": "

An optional tooltip that gets displayed next to the multiselect.

\n", + "default": null }, { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "name": "on_change", + "type_name": "callable", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" + "description": "

An optional callback invoked when this multiselect's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the multiselect widget if set\nto True. The default is False. This argument can only be supplied\nby keyword.

\n", + "default": "False" } ], "returns": [ { - "type_name": "str", + "type_name": "list", "is_generator": false, - "description": "

The current value of the text input widget.

\n", + "description": "

A list with the selected options

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/text_widgets.py#L72" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/multiselect.py#L83" }, - "DeltaGenerator.time_input": { - "name": "time_input", - "signature": "element.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", step=0:15:00)", - "example": "
\n
\nimport datetime\nimport streamlit as st\n\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n
\n", - "description": "

Display a time input widget.

\n", + "streamlit.number_input": { + "name": "number_input", + "signature": "st.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a numeric input widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this time input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this input is for.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", "default": null }, { "name": "value", - "type_name": "datetime.time/datetime.datetime", + "type_name": "int or float or None", "is_optional": false, - "description": "

The value of this widget when it first renders. This will be\ncast to str internally. Defaults to the current time.

\n", - "default": "the" + "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. Output must be purely numeric. This does not impact\nthe return value. Valid formatters: %d %e %f %g %i %u

\n", + "default": null }, { "name": "key", @@ -8284,7 +7302,7 @@ "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this time_input's value changes.

\n", + "description": "

An optional callback invoked when this number_input's value changes.

\n", "default": null }, { @@ -8305,107 +7323,156 @@ "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

An optional boolean, which disables the time input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", - "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" - }, - { - "name": "step", - "type_name": "int or timedelta", - "is_optional": false, - "description": "

The stepping interval in seconds. Defaults to 900, i.e. 15 minutes.\nYou can also pass a datetime.timedelta object.

\n", - "default": "900" + "description": "

An optional boolean, which disables the number input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" } ], "returns": [ { - "type_name": "datetime.time", + "type_name": "int or float", "is_generator": false, - "description": "

The current value of the time input widget.

\n", + "description": "

The current value of the numeric input widget. The return type\nwill match the data type of the value parameter.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/time_widgets.py#L219" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/number_input.py#L39" }, - "DeltaGenerator.title": { - "name": "title", - "signature": "element.title(body, anchor=None, *, help=None)", - "examples": "
\n
\nimport streamlit as st\n\nst.title('This is a title')\nst.title('_Streamlit_ is :blue[cool] :sunglasses:')\n
\n\n \n
\n", - "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", + "streamlit.plotly_chart": { + "name": "plotly_chart", + "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)", + "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport plotly.figure_factory as ff\nimport numpy as np\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n        hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", "args": [ { - "name": "body", - "type_name": "str", + "name": "figure_or_data", + "type_name": "plotly.graph_objs.Figure, plotly.graph_objs.Data,", "is_optional": false, - "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", + "description": "

dict/list of plotly.graph_objs.Figure/Data

\n

See https://plot.ly/python/ for examples of graph descriptions.

\n", "default": null }, { - "name": "anchor", - "type_name": "str or False", + "name": "use_container_width", + "type_name": "bool", "is_optional": false, - "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", "default": null }, { - "name": "help", - "type_name": "str", + "name": "sharing", + "type_name": "{'streamlit', 'private', 'secret', 'public'}", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the title.

\n", + "description": "

Use 'streamlit' to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", + "default": null + }, + { + "name": "**kwargs", + "type_name": null, + "is_optional": null, + "description": "

Any argument accepted by Plotly's plot() function.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/heading.py#L181" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/plotly_chart.py#L67" }, - "DeltaGenerator.toast": { - "name": "toast", - "signature": "element.toast(body, *, icon=None)", - "example": "
\n
\nimport streamlit as st\n\nst.toast('Your edited image was saved!', icon='\ud83d\ude0d')\n
\n
\n", - "description": "

Display a short message, known as a notification "toast".

\n

The toast appears in the app's bottom-right corner and disappears after four seconds.

\n
\n

Warning

\n

st.toast is not compatible with Streamlit's caching and\ncannot be called within a cached function.

\n
\n", + "streamlit.progress": { + "name": "progress", + "signature": "st.progress(value)", + "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport time\n\nmy_bar = st.progress(0)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1)\n
\n
\n", + "description": "Display a progress bar.", "args": [ { - "name": "body", - "type_name": "str", + "name": "value", + "type_name": "int or float", "is_optional": false, - "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", + "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/progress.py#L31" + }, + "streamlit.pydeck_chart": { + "name": "pydeck_chart", + "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)", + "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\ndf = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=df,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=df,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", + "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "spec", + "type_name": "pydeck.Deck or None", + "is_optional": false, + "description": "

Object specifying the PyDeck chart to draw.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/deck_gl_json_chart.py#L23" + }, + "streamlit.pyplot": { + "name": "pyplot", + "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)", + "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", + "example": "
\n
\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a matplotlib.pyplot figure.", + "args": [ + { + "name": "fig", + "type_name": "Matplotlib Figure", + "is_optional": false, + "description": "

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

\n", "default": null }, { - "name": "icon", - "type_name": "str or None", + "name": "clear_figure", + "type_name": "bool", "is_optional": false, - "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the toast. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", - "default": "None" + "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", + "default": "based" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Arguments to pass to Matplotlib's savefig function.

\n", + "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/toast.py#L37" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/pyplot.py#L36" }, - "DeltaGenerator.toggle": { - "name": "toggle", - "signature": "element.toggle(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\non = st.toggle('Activate feature')\n\nif on:\n    st.write('Feature activated!')\n
\n\n \n
\n", - "description": "

Display a toggle widget.

\n", + "streamlit.radio": { + "name": "radio", + "signature": "st.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False)", + "example": "
\n
\ngenre = st.radio(\n    "What's your favorite movie genre",\n    ('Comedy', 'Drama', 'Documentary'))\n\nif genre == 'Comedy':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn't select comedy.")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a radio button widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this toggle is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this radio group is for.

\n", "default": null }, { - "name": "value", - "type_name": "bool", + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", "is_optional": false, - "description": "

Preselect the toggle when it first renders. This will be\ncast to bool internally.

\n", + "description": "

Labels for the radio options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of radio options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe radio.

\n", "default": null }, { @@ -8419,14 +7486,14 @@ "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the toggle.

\n", + "description": "

An optional tooltip that gets displayed next to the radio.

\n", "default": null }, { "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this toggle's value changes.

\n", + "description": "

An optional callback invoked when this radio's value changes.

\n", "default": null }, { @@ -8447,406 +7514,315 @@ "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

An optional boolean, which disables the toggle if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", - "default": "False." + "description": "

An optional boolean, which disables the radio button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" }, { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "name": "horizontal", + "type_name": "bool", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" + "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", + "default": "false" } ], "returns": [ { - "type_name": "bool", + "type_name": "any", "is_generator": false, - "description": "

Whether or not the toggle is checked.

\n", + "description": "

The selected option.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/checkbox.py#L156" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/radio.py#L35" }, - "DeltaGenerator.vega_lite_chart": { - "name": "vega_lite_chart", - "signature": "element.vega_lite_chart(data=None, spec=None, use_container_width=False, theme=\"streamlit\", **kwargs)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(chart_data, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", - "description": "

Display a chart using the Vega-Lite library.

\n", + "streamlit.select_slider": { + "name": "select_slider", + "signature": "st.select_slider(label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "examples": "
\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n \n (view standalone Streamlit app)\n \n ", + "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", "args": [ { - "name": "data", - "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", - "is_optional": false, - "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", - "default": null - }, - { - "name": "spec", - "type_name": "dict or None", + "name": "label", + "type_name": "str", "is_optional": false, - "description": "

The Vega-Lite spec for the chart. If the spec was already passed in\nthe previous argument, this must be set to None. See\nhttps://vega.github.io/vega-lite/docs/ for more info.

\n", + "description": "

A short label explaining to the user what this slider is for.

\n", "default": null }, { - "name": "use_container_width", - "type_name": "bool", + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", "is_optional": false, - "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", + "description": "

Labels for the slider options. All options will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", "default": null }, { - "name": "theme", - "type_name": "\"streamlit\" or None", + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", "is_optional": false, - "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", - "default": "behavior" + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to first option.

\n", + "default": "first" }, { - "name": "**kwargs", - "type_name": "any", + "name": "format_func", + "type_name": "function", "is_optional": false, - "description": "

Same as spec, but as keywords.

\n", + "description": "

Function to modify the display of the labels from the options.\nargument. It receives the option as an argument and its output\nwill be cast to str.

\n", "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L819" - }, - "DeltaGenerator.video": { - "name": "video", - "signature": "element.video(data, format=\"video/mp4\", start_time=0)", - "example": "
\n
\nimport streamlit as st\n\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", - "description": "

Display a video player.

\n", - "args": [ + }, { - "name": "data", - "type_name": "str, bytes, BytesIO, numpy.ndarray, or file", + "name": "key", + "type_name": "str or int", "is_optional": false, - "description": "

Raw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", "default": null }, { - "name": "format", + "name": "help", "type_name": "str", "is_optional": false, - "description": "

The mime type for the video file. Defaults to 'video/mp4'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", - "default": "s" + "description": "

An optional tooltip that gets displayed next to the select slider.

\n", + "default": null }, { - "name": "start_time", - "type_name": "int", + "name": "on_change", + "type_name": "callable", "is_optional": false, - "description": "

The time from which this element should start playing.

\n", + "description": "

An optional callback invoked when this select_slider's value changes.

\n", "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/media.py#L115" - }, - "DeltaGenerator.warning": { - "name": "warning", - "signature": "element.warning(body, *, icon=None)", - "example": "
\n
\nimport streamlit as st\n\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", - "description": "

Display warning message.

\n", - "args": [ + }, { - "name": "body", - "type_name": "str", + "name": "args", + "type_name": "tuple", "is_optional": false, - "description": "

The warning text to display.

\n", + "description": "

An optional tuple of args to pass to the callback.

\n", "default": null }, { - "name": "icon", - "type_name": "str or None", - "is_optional": false, - "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", - "default": "None" - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/alert.py#L59" - }, - "DeltaGenerator.write": { - "name": "write", - "signature": "element.write(*args, unsafe_allow_html=False, **kwargs)", - "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nimport streamlit as st\n\nst.write('Hello, *World!* :sunglasses:')\n
\n\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nimport streamlit as st\nimport pandas as pd\n\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nimport streamlit as st\n\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n
\n", - "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", - "args": [ - { - "name": "*args", - "type_name": "any", + "name": "kwargs", + "type_name": "dict", "is_optional": false, - "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression, emoji shortcodes, and colored text.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(class) : Displays information about a class.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", + "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, { - "name": "unsafe_allow_html", + "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", - "default": "False." + "description": "

An optional boolean, which disables the select slider if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" } ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/write.py#L49" - }, - "StatusContainer.add_rows": { - "name": "add_rows", - "signature": "StatusContainer.add_rows(data=None, **kwargs)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf1 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table = st.table(df1)\n\ndf2 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table.add_rows(df2)\n# Now the table shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

You can do the same thing with plots. For example, if you want to add\nmore data to a line chart:

\n
\n# Assuming df1 and df2 from the example above still exist...\nmy_chart = st.line_chart(df1)\nmy_chart.add_rows(df2)\n# Now the chart shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

And for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:

\n
\nmy_chart = st.vega_lite_chart({\n    'mark': 'line',\n    'encoding': {'x': 'a', 'y': 'b'},\n    'datasets': {\n      'some_fancy_name': df1,  # <-- named dataset\n     },\n    'data': {'name': 'some_fancy_name'},\n}),\nmy_chart.add_rows(some_fancy_name=df2)  # <-- name used as keyword\n
\n
\n", - "description": "

Concatenate a dataframe to the bottom of the current one.

\n", - "args": [ - { - "name": "data", - "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, Iterable, dict, or None", - "is_optional": false, - "description": "

Table to concat. Optional.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", - "default": null - }, + "returns": [ { - "name": "**kwargs", - "type_name": "pandas.DataFrame, numpy.ndarray, Iterable, dict, or None", - "is_optional": false, - "description": "

The named dataset to concat. Optional. You can only pass in 1\ndataset (including the one in the data parameter).

\n", - "default": null + "type_name": "any value or tuple of any value", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null } ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L894" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/select_slider.py#L35" }, - "StatusContainer.altair_chart": { - "name": "altair_chart", - "signature": "StatusContainer.altair_chart(altair_chart, use_container_width=False, theme=\"streamlit\")", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(chart_data).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n
\n", - "description": "

Display a chart using the Altair library.

\n", + "streamlit.selectbox": { + "name": "selectbox", + "signature": "st.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a select widget.", "args": [ { - "name": "altair_chart", - "type_name": "altair.Chart", + "name": "label", + "type_name": "str", "is_optional": false, - "description": "

The Altair chart object to display.

\n", + "description": "

A short label explaining to the user what this select widget is for.

\n", "default": null }, { - "name": "use_container_width", - "type_name": "bool", + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", "is_optional": false, - "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", "default": null }, { - "name": "theme", - "type_name": "\"streamlit\" or None", + "name": "index", + "type_name": "int", "is_optional": false, - "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", - "default": "behavior" - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L766" - }, - "StatusContainer.area_chart": { - "name": "area_chart", - "signature": "StatusContainer.area_chart(data=None, *, x=None, y=None, color=None, width=0, height=0, use_container_width=True)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns = ['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n

You can also choose different columns to use for x and y, as well as set\nthe color dynamically based on a 3rd column (assuming your dataframe is in\nlong format):

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame({\n    'col1' : np.random.randn(20),\n    'col2' : np.random.randn(20),\n    'col3' : np.random.choice(['A', 'B', 'C'], 20)\n})\n\nst.area_chart(\n    chart_data,\n    x = 'col1',\n    y = 'col2',\n    color = 'col3'\n)\n
\n\n \n

Finally, if your dataframe is in wide format, you can group multiple\ncolumns under the y argument to show multiple series with different\ncolors:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['col1', 'col2', 'col3'])\n\nst.area_chart(\n    chart_data,\n    x='col1',\n    y=['col2', 'col3'],\n    color=['#FF0000','#0000FF']  # Optional\n)\n
\n\n \n
\n", - "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", - "args": [ + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, { - "name": "data", - "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "name": "format_func", + "type_name": "function", "is_optional": false, - "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "description": "

Function to modify the display of the labels. It receives the option\nas an argument and its output will be cast to str.

\n", "default": null }, { - "name": "x", - "type_name": "str or None", + "name": "key", + "type_name": "str or int", "is_optional": false, - "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", "default": null }, { - "name": "y", - "type_name": "str, sequence of str, or None", + "name": "help", + "type_name": "str", "is_optional": false, - "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "description": "

An optional tooltip that gets displayed next to the selectbox.

\n", "default": null }, { - "name": "color", - "type_name": "str, tuple, sequence of str, sequence of tuple, or None", + "name": "on_change", + "type_name": "callable", "is_optional": false, - "description": "

The color to use for different series in this chart. This argument\ncan only be supplied by keyword.

\n

For an area chart with just 1 series, this can be:

\n
    \n
  • None, to use the default color.
  • \n
  • A hex string like "#ffaa00" or "#ffaa0088".
  • \n
  • An RGB or RGBA tuple with the red, green, blue, and alpha\ncomponents specified as ints from 0 to 255 or floats from 0.0 to\n1.0.
  • \n
\n

For an area chart with multiple series, where the dataframe is in\nlong format (that is, y is None or just one column), this can be:

\n
    \n
  • None, to use the default colors.

    \n
  • \n
  • The name of a column in the dataset. Data points will be grouped\ninto series of the same color based on the value of this column.\nIn addition, if the values in this column match one of the color\nformats above (hex string or color tuple), then that color will\nbe used.

    \n

    For example: if the dataset has 1000 rows, but this column can\nonly contains the values "adult", "child", "baby",\nthen those 1000 datapoints will be grouped into 3 series, whose\ncolors will be automatically selected from the default palette.

    \n

    But, if for the same 1000-row dataset, this column contained\nthe values "#ffaa00", "#f0f", "#0000ff", then then those 1000\ndatapoints would still be grouped into 3 series, but their\ncolors would be "#ffaa00", "#f0f", "#0000ff" this time around.

    \n
  • \n
\n

For an area chart with multiple series, where the dataframe is in\nwide format (that is, y is a sequence of columns), this can be:

\n
    \n
  • None, to use the default colors.
  • \n
  • A list of string colors or color tuples to be used for each of\nthe series in the chart. This list should have the same length\nas the number of y values (e.g. color=["#fd0", "#f0f", "#04f"]\nfor three lines).
  • \n
\n", - "default": "color." + "description": "

An optional callback invoked when this selectbox's value changes.

\n", + "default": null }, { - "name": "width", - "type_name": "int", + "name": "args", + "type_name": "tuple", "is_optional": false, - "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "description": "

An optional tuple of args to pass to the callback.

\n", "default": null }, { - "name": "height", - "type_name": "int", + "name": "kwargs", + "type_name": "dict", "is_optional": false, - "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, { - "name": "use_container_width", + "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", - "default": null + "description": "

An optional boolean, which disables the selectbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" } ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L409" + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/selectbox.py#L35" }, - "StatusContainer.audio": { - "name": "audio", - "signature": "StatusContainer.audio(data, format=\"audio/wav\", start_time=0, *, sample_rate=None)", - "example": "
\n
\nimport streamlit as st\nimport numpy as np\n\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n\nsample_rate = 44100  # 44100 samples per second\nseconds = 2  # Note duration of 2 seconds\nfrequency_la = 440  # Our played note will be 440 Hz\n# Generate array with seconds*sample_rate steps, ranging between 0 and seconds\nt = np.linspace(0, seconds, seconds * sample_rate, False)\n# Generate a 440 Hz sine wave\nnote_la = np.sin(frequency_la * t * 2 * np.pi)\n\nst.audio(note_la, sample_rate=sample_rate)\n
\n\n \n
\n", - "description": "

Display an audio player.

\n", + "streamlit.set_option": { + "name": "set_option", + "signature": "st.set_option(key, value)", + "description": "

Set config option.

\n
\n
Currently, only the following config options can be set within the script itself:
\n
    \n
  • client.caching
  • \n
  • client.displayEnabled
  • \n
  • deprecation.*
  • \n
\n
\n
\n

Calling with any other options will raise StreamlitAPIException.

\n

Run streamlit config show in the terminal to see all available options.

\n", "args": [ { - "name": "data", - "type_name": "str, bytes, BytesIO, numpy.ndarray, or file", - "is_optional": false, - "description": "

Raw audio data, filename, or a URL pointing to the file to load.\nRaw data formats must include all necessary file headers to match the file\nformat specified via format.\nIf data is a numpy array, it must either be a 1D array of the waveform\nor a 2D array of shape (num_channels, num_samples) with waveforms\nfor all channels. See the default channel order at\nhttp://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx

\n", - "default": "channel" - }, - { - "name": "format", + "name": "key", "type_name": "str", "is_optional": false, - "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", - "default": "s" + "description": "

The config option key of the form "section.optionName". To see all\navailable options, run streamlit config show on a terminal.

\n", + "default": null }, { - "name": "start_time", - "type_name": "int", - "is_optional": false, - "description": "

The time from which this element should start playing.

\n", - "default": null - }, - { - "name": "sample_rate", - "type_name": "int or None", - "is_optional": false, - "description": "

The sample rate of the audio data in samples per second. Only required if\ndata is a numpy array.

\n", + "name": "value", + "type_name": null, + "is_optional": null, + "description": "

The new value to assign to this config option.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/media.py#L42" - }, - "StatusContainer.balloons": { - "name": "balloons", - "signature": "StatusContainer.balloons()", - "example": "
\n
\nimport streamlit as st\n\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", - "description": "

Draw celebratory balloons.

\n", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/balloons.py#L25" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/__init__.py#L214" }, - "StatusContainer.bar_chart": { - "name": "bar_chart", - "signature": "StatusContainer.bar_chart(data=None, *, x=None, y=None, color=None, width=0, height=0, use_container_width=True)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n

You can also choose different columns to use for x and y, as well as set\nthe color dynamically based on a 3rd column (assuming your dataframe is in\nlong format):

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame({\n    'col1' : np.random.randn(20),\n    'col2' : np.random.randn(20),\n    'col3' : np.random.choice(['A','B','C'],20)\n})\n\nst.bar_chart(\n    chart_data,\n    x='col1',\n    y='col2',\n    color='col3'\n)\n
\n\n \n

Finally, if your dataframe is in wide format, you can group multiple\ncolumns under the y argument to show multiple series with different\ncolors:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['col1', 'col2', 'col3'])\n\nst.bar_chart(\n    chart_data,\n    x='col1',\n    y=['col2', 'col3'],\n    color=['#FF0000','#0000FF']  # Optional\n)\n
\n\n \n
\n", - "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "streamlit.set_page_config": { + "name": "set_page_config", + "signature": "st.set_page_config(page_title=None, page_icon=None, layout=\"centered\", initial_sidebar_state=\"auto\", menu_items=None)", + "example": "
\nst.set_page_config(\n    page_title="Ex-stream-ly Cool App",\n    page_icon="\ud83e\uddca",\n    layout="wide",\n    initial_sidebar_state="expanded",\n    menu_items={\n        'Get Help': 'https://www.extremelycoolapp.com/help',\n        'Report a bug': "https://www.extremelycoolapp.com/bug",\n        'About': "# This is a header. This is an *extremely* cool app!"\n    }\n)\n
\n", + "description": "

Configures the default settings of the page.

\n
\n

Note

\n

This must be the first Streamlit command used in your app, and must only\nbe set once.

\n
\n", "args": [ { - "name": "data", - "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", - "is_optional": false, - "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", - "default": null - }, - { - "name": "x", + "name": "page_title", "type_name": "str or None", "is_optional": false, - "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", - "default": null + "description": "

The page title, shown in the browser tab. If None, defaults to the\nfilename of the script ("app.py" would show "app \u2022 Streamlit").

\n", + "default": "the" }, { - "name": "y", - "type_name": "str, sequence of str, or None", + "name": "page_icon", + "type_name": "Anything supported by st.image or str or None", "is_optional": false, - "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "description": "

The page favicon.\nBesides the types supported by st.image (like URLs or numpy arrays),\nyou can pass in an emoji as a string ("\ud83e\udd88") or a shortcode (":shark:").\nIf you're feeling lucky, try "random" for a random emoji!\nEmoji icons are courtesy of Twemoji and loaded from MaxCDN.

\n", "default": null }, { - "name": "color", - "type_name": "str, tuple, sequence of str, sequence of tuple, or None", - "is_optional": false, - "description": "

The color to use for different series in this chart. This argument\ncan only be supplied by keyword.

\n

For a bar chart with just 1 series, this can be:

\n
    \n
  • None, to use the default color.
  • \n
  • A hex string like "#ffaa00" or "#ffaa0088".
  • \n
  • An RGB or RGBA tuple with the red, green, blue, and alpha\ncomponents specified as ints from 0 to 255 or floats from 0.0 to\n1.0.
  • \n
\n

For a bar chart with multiple series, where the dataframe is in\nlong format (that is, y is None or just one column), this can be:

\n
    \n
  • None, to use the default colors.

    \n
  • \n
  • The name of a column in the dataset. Data points will be grouped\ninto series of the same color based on the value of this column.\nIn addition, if the values in this column match one of the color\nformats above (hex string or color tuple), then that color will\nbe used.

    \n

    For example: if the dataset has 1000 rows, but this column can\nonly contains the values "adult", "child", "baby",\nthen those 1000 datapoints will be grouped into 3 series, whose\ncolors will be automatically selected from the default palette.

    \n

    But, if for the same 1000-row dataset, this column contained\nthe values "#ffaa00", "#f0f", "#0000ff", then then those 1000\ndatapoints would still be grouped into 3 series, but their\ncolors would be "#ffaa00", "#f0f", "#0000ff" this time around.

    \n
  • \n
\n

For a bar chart with multiple series, where the dataframe is in\nwide format (that is, y is a sequence of columns), this can be:

\n
    \n
  • None, to use the default colors.
  • \n
  • A list of string colors or color tuples to be used for each of\nthe series in the chart. This list should have the same length\nas the number of y values (e.g. color=["#fd0", "#f0f", "#04f"]\nfor three lines).
  • \n
\n", - "default": "color." - }, - { - "name": "width", - "type_name": "int", + "name": "layout", + "type_name": "\"centered\" or \"wide\"", "is_optional": false, - "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", - "default": null + "description": "

How the page content should be laid out. Defaults to "centered",\nwhich constrains the elements into a centered column of fixed width;\n"wide" uses the entire screen.

\n", + "default": "s" }, { - "name": "height", - "type_name": "int", + "name": "initial_sidebar_state", + "type_name": "\"auto\" or \"expanded\" or \"collapsed\"", "is_optional": false, - "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", - "default": null + "description": "

How the sidebar should start out. Defaults to "auto",\nwhich hides the sidebar on mobile-sized devices, and shows it otherwise.\n"expanded" shows the sidebar initially; "collapsed" hides it.

\n", + "default": "s" }, { - "name": "use_container_width", - "type_name": "bool", + "name": "menu_items", + "type_name": "dict", "is_optional": false, - "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", - "default": null + "description": "

Configure the menu that appears on the top-right side of this app.\nThe keys in this dict denote the menu item you'd like to configure:

\n
    \n
  • \n
    "Get help": str or None
    \n
    The URL this menu item should point to.\nIf None, hides this menu item.
    \n
    \n
  • \n
  • \n
    "Report a Bug": str or None
    \n
    The URL this menu item should point to.\nIf None, hides this menu item.
    \n
    \n
  • \n
  • \n
    "About": str or None
    \n
    A markdown string to show in the About dialog.\nIf None, only shows Streamlit's default About text.
    \n
    \n
  • \n
\n", + "default": "About" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L587" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/commands/page_config.py#L45" }, - "StatusContainer.bokeh_chart": { - "name": "bokeh_chart", - "signature": "StatusContainer.bokeh_chart(figure, use_container_width=False)", - "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n
\n", - "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", + "streamlit.slider": { + "name": "slider", + "signature": "st.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "examples": "
\n
\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nfrom datetime import time\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nfrom datetime import datetime\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n", "args": [ { - "name": "figure", - "type_name": "bokeh.plotting.figure.Figure", + "name": "label", + "type_name": "str", "is_optional": false, - "description": "

A Bokeh figure to plot.

\n", + "description": "

A short label explaining to the user what this slider is for.

\n", "default": null }, { - "name": "use_container_width", - "type_name": "bool", + "name": "min_value", + "type_name": "a supported type or None", "is_optional": false, - "description": "

If True, set the chart width to the column width. This takes\nprecedence over Bokeh's native width value.

\n", - "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/bokeh_chart.py#L36" - }, - "StatusContainer.button": { - "name": "button", - "signature": "StatusContainer.button(label, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", - "example": "
\n
\nimport streamlit as st\n\nst.button("Reset", type="primary")\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n
\n", - "description": "

Display a button widget.

\n", - "args": [ + "description": "

The minimum permitted value.\nDefaults to 0 if the value is an int, 0.0 if a float,\nvalue - timedelta(days=14) if a date/datetime, time.min if a time

\n", + "default": "0" + }, { - "name": "label", - "type_name": "str", + "name": "max_value", + "type_name": "a supported type or None", "is_optional": false, - "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "description": "

The maximum permitted value.\nDefaults to 100 if the value is an int, 1.0 if a float,\nvalue + timedelta(days=14) if a date/datetime, time.max if a time

\n", + "default": "100" + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to min_value.

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int/float/timedelta or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. This does not impact the return value.\nFormatter for int/float supports: %d %e %f %g %i\nFormatter for date/time/datetime uses Moment.js notation:\nhttps://momentjs.com/docs/#/displaying/format/

\n", "default": null }, { @@ -8860,14 +7836,14 @@ "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "description": "

An optional tooltip that gets displayed next to the slider.

\n", "default": null }, { - "name": "on_click", + "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this button is clicked.

\n", + "description": "

An optional callback invoked when this slider's value changes.

\n", "default": null }, { @@ -8884,181 +7860,218 @@ "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, - { - "name": "type", - "type_name": "\"secondary\" or \"primary\"", - "is_optional": false, - "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", - "default": "s" - }, { "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", - "default": "False." - }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", - "default": null + "description": "

An optional boolean, which disables the slider if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" } ], "returns": [ { - "type_name": "bool", + "type_name": "int/float/date/time/datetime or tuple of int/float/date/time/datetime", "is_generator": false, - "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/button.py#L61" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/slider.py#L38" }, - "StatusContainer.camera_input": { - "name": "camera_input", - "signature": "StatusContainer.camera_input(label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", - "description": "

Display a widget that returns pictures from the user's webcam.

\n", + "streamlit.snow": { + "name": "snow", + "signature": "st.snow()", + "example": "
\n
\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", + "description": "Draw celebratory snowfall.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/snow.py#L24" + }, + "streamlit.spinner": { + "name": "spinner", + "signature": "st.spinner(text=\"In progress...\")", + "example": "
\n
\nwith st.spinner('Wait for it...'):\n    time.sleep(5)\nst.success('Done!')\n
\n
\n", + "description": "Temporarily displays a message while executing a block of code.", "args": [ { - "name": "label", + "name": "text", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this widget is used for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A message to display while executing that block

\n", "default": null - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/__init__.py#L393" + }, + "streamlit.stop": { + "name": "stop", + "signature": "st.stop()", + "example": "
\n
\nname = st.text_input('Name')\nif not name:\n  st.warning('Please input a name.')\n  st.stop()\nst.success('Thank you for inputting a name.')\n
\n
\n", + "description": "

Stops execution immediately.

\n

Streamlit will not run any statements after st.stop().\nWe recommend rendering a message to explain why the script has stopped.\nWhen run outside of Streamlit, this will raise an Exception.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/__init__.py#L494" + }, + "streamlit.subheader": { + "name": "subheader", + "signature": "st.subheader(body, anchor=None)", + "example": "
\n
\nst.subheader('This is a subheader')\n
\n
\n", + "description": "Display text in subheader formatting.", + "args": [ { - "name": "key", - "type_name": "str or int", + "name": "body", + "type_name": "str", "is_optional": false, - "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "description": "

The text to display.

\n", "default": null }, { - "name": "help", + "name": "anchor", "type_name": "str", "is_optional": false, - "description": "

A tooltip that gets displayed next to the camera input.

\n", + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", "default": null - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/markdown.py#L106" + }, + "streamlit.success": { + "name": "success", + "signature": "st.success(body, *, icon=None)", + "example": "
\n
\nst.success('This is a success message!', icon:"\u2705")\n
\n
\n", + "description": "Display a success message.", + "args": [ { - "name": "on_change", - "type_name": "callable", + "name": "icon", + "type_name": "None", "is_optional": false, - "description": "

An optional callback invoked when this camera_input's value\nchanges.

\n", - "default": null + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" }, { - "name": "args", - "type_name": "tuple", + "name": "body", + "type_name": "str", "is_optional": false, - "description": "

An optional tuple of args to pass to the callback.

\n", + "description": "

The success text to display.

\n", "default": null - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/alert.py#L126" + }, + "streamlit.table": { + "name": "table", + "signature": "st.table(data=None)", + "example": "
\n
\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", + "args": [ { - "name": "kwargs", - "type_name": "dict", + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", "is_optional": false, - "description": "

An optional dict of kwargs to pass to the callback.

\n", + "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null - }, - { - "name": "disabled", - "type_name": "bool", - "is_optional": false, - "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", - "default": "False." - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/dataframe_selector.py#L99" + }, + "streamlit.tabs": { + "name": "tabs", + "signature": "st.tabs(tabs)", + "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", + "args": [ { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "name": "tabs", + "type_name": "list of strings", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" + "description": "

Creates a tab for each string in the list. The string is used as the name of the tab.\nThe first tab is selected by default.

\n", + "default": null } ], "returns": [ { - "type_name": "None or UploadedFile", + "type_name": "list of containers", "is_generator": false, - "description": "

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "description": "

A list of container objects.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/camera_input.py#L78" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/layouts.py#L196" }, - "StatusContainer.caption": { - "name": "caption", - "signature": "StatusContainer.caption(body, unsafe_allow_html=False, *, help=None)", - "examples": "
\n
\nimport streamlit as st\n\nst.caption('This is a string that explains something above.')\nst.caption('A caption with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", - "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", + "streamlit.text": { + "name": "text", + "signature": "st.text(body)", + "example": "
\n
\nst.text('This is some text.')\n
\n
\n", + "description": "Write fixed-width and preformatted text.", "args": [ { "name": "body", "type_name": "str", "is_optional": false, - "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", - "default": null - }, - { - "name": "unsafe_allow_html", - "type_name": "bool", - "is_optional": false, - "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", - "default": null - }, - { - "name": "help", - "type_name": "str", - "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the caption.

\n", + "description": "

The string to display.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/markdown.py#L146" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/text.py#L26" }, - "StatusContainer.chat_input": { - "name": "chat_input", - "signature": "StatusContainer.chat_input(placeholder=\"Your message\", *, key=None, max_chars=None, disabled=False, on_submit=None, args=None, kwargs=None)", - "examples": "
\n
\nimport streamlit as st\n\nprompt = st.chat_input("Say something")\nif prompt:\n    st.write(f"User has sent the following prompt: {prompt}")\n
\n\n \n
\n", - "description": "

Display a chat input widget.

\n
\n

Warning

\n

Chat input can only be used once per app page and inside the main area of the app.\nIt cannot be used in the sidebar, columns, expanders, forms or tabs.\nWe plan to support this in the future.

\n
\n", + "streamlit.text_area": { + "name": "text_area", + "signature": "st.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False)", + "example": "
\n
\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", + "description": "Display a multi-line text input widget.", "args": [ { - "name": "placeholder", + "name": "label", "type_name": "str", "is_optional": false, - "description": "

A placeholder text shown when the chat input is empty. Defaults to\n"Your message". For accessibility reasons, you should not use an\nempty string.

\n", - "default": "s" + "description": "

A short label explaining to the user what this input is for.

\n", + "default": null }, { - "name": "key", - "type_name": "str or int", + "name": "value", + "type_name": "object", "is_optional": false, - "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget based on\nits content. Multiple widgets of the same type may not share the same key.

\n", + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", "default": null }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, { "name": "max_chars", "type_name": "int or None", "is_optional": false, - "description": "

The maximum number of characters that can be entered. If None\n(default), there will be no maximum.

\n", + "description": "

Maximum number of characters allowed in text area.

\n", "default": null }, { - "name": "disabled", - "type_name": "bool", + "name": "key", + "type_name": "str or int", "is_optional": false, - "description": "

Whether the chat input should be disabled. Defaults to False.

\n", - "default": "False." + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null }, { - "name": "on_submit", + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the textarea.

\n", + "default": null + }, + { + "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when the chat input's value is submitted.

\n", + "description": "

An optional callback invoked when this text_area's value changes.

\n", "default": null }, { @@ -9074,67 +8087,57 @@ "is_optional": false, "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null - } - ], - "returns": [ + }, { + "name": "placeholder", "type_name": "str or None", - "is_generator": false, - "description": "

The current (non-empty) value of the text input widget on the last\nrun of the app, None otherwise.

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/chat.py#L214" - }, - "StatusContainer.chat_message": { - "name": "chat_message", - "signature": "StatusContainer.chat_message(name, *, avatar=None)", - "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\nimport numpy as np\n\nwith st.chat_message("user"):\n    st.write("Hello \ud83d\udc4b")\n    st.line_chart(np.random.randn(30, 3))\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\nmessage = st.chat_message("assistant")\nmessage.write("Hello human")\nmessage.bar_chart(np.random.randn(30, 3))\n
\n\n \n
\n", - "description": "

Insert a chat message container.

\n

To add elements to the returned container, you can use with notation\n(preferred) or just call methods directly on the returned object. See the\nexamples below.

\n", - "args": [ - { - "name": "name", - "type_name": "\"user\", \"assistant\", \"ai\", \"human\", or str", "is_optional": false, - "description": "

The name of the message author. Can be "human"/"user" or\n"ai"/"assistant" to enable preset styling and avatars.

\n

Currently, the name is not shown in the UI but is only set as an\naccessibility label. For accessibility reasons, you should not use\nan empty string.

\n", + "description": "

An optional string displayed when the text area is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", "default": null }, { - "name": "avatar", - "type_name": "str, numpy.ndarray, or BytesIO", + "name": "disabled", + "type_name": "bool", "is_optional": false, - "description": "

The avatar shown next to the message. Can be one of:

\n
    \n
  • A single emoji, e.g. "\ud83e\uddd1\u200d\ud83d\udcbb", "\ud83e\udd16", "\ud83e\udd96". Shortcodes are not supported.
  • \n
  • \n
    An image using one of the formats allowed for st.image: path of a local
    \n
    image file; URL to fetch the image from; array of shape (w,h) or (w,h,1)\nfor a monochrome image, (w,h,3) for a color image, or (w,h,4) for an RGBA image.
    \n
    \n
  • \n
\n

If None (default), uses default icons if name is "user",\n"assistant", "ai", "human" or the first letter of the name value.

\n", - "default": "icons" + "description": "

An optional boolean, which disables the text area if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" } ], "returns": [ { - "type_name": "Container", + "type_name": "str", "is_generator": false, - "description": "

A single container that can hold multiple elements.

\n", + "description": "

The current value of the text input widget.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/chat.py#L121" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/text_widgets.py#L201" }, - "StatusContainer.checkbox": { - "name": "checkbox", - "signature": "StatusContainer.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n
\n", - "description": "

Display a checkbox widget.

\n", + "streamlit.text_input": { + "name": "text_input", + "signature": "st.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False)", + "example": "
\n
\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a single-line text input widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this checkbox is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this input is for.

\n", "default": null }, { "name": "value", - "type_name": "bool", + "type_name": "object", "is_optional": false, - "description": "

Preselect the checkbox when it first renders. This will be\ncast to bool internally.

\n", + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Max number of characters allowed in text input.

\n", "default": null }, { @@ -9144,18 +8147,32 @@ "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", "default": null }, + { + "name": "type", + "type_name": "str", + "is_optional": false, + "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", + "default": "s" + }, { "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the checkbox.

\n", + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "autocomplete", + "type_name": "str", + "is_optional": false, + "description": "

An optional value that will be passed to the <input> element's\nautocomplete property. If unspecified, this value will be set to\n"new-password" for "password" inputs, and the empty string for\n"default" inputs. For more details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

\n", "default": null }, { "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this checkbox's value changes.

\n", + "description": "

An optional callback invoked when this text_input's value changes.

\n", "default": null }, { @@ -9173,80 +8190,49 @@ "default": null }, { - "name": "disabled", - "type_name": "bool", + "name": "placeholder", + "type_name": "str or None", "is_optional": false, - "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", - "default": "False." + "description": "

An optional string displayed when the text input is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null }, { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "name": "disabled", + "type_name": "bool", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" + "description": "

An optional boolean, which disables the text input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" } ], "returns": [ { - "type_name": "bool", + "type_name": "str", "is_generator": false, - "description": "

Whether or not the checkbox is checked.

\n", + "description": "

The current value of the text input widget.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/checkbox.py#L53" - }, - "StatusContainer.code": { - "name": "code", - "signature": "StatusContainer.code(body, language=\"python\", line_numbers=False)", - "example": "
\n
\nimport streamlit as st\n\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", - "description": "

Display a code block with optional syntax highlighting.

\n", - "args": [ - { - "name": "body", - "type_name": "str", - "is_optional": false, - "description": "

The string to display as code.

\n", - "default": null - }, - { - "name": "language", - "type_name": "str or None", - "is_optional": false, - "description": "

The language that the code is written in, for syntax highlighting.\nIf None, the code will be unstyled. Defaults to "python".

\n

For a list of available language values, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", - "default": "s" - }, - { - "name": "line_numbers", - "type_name": "bool", - "is_optional": false, - "description": "

An optional boolean indicating whether to show line numbers to the\nleft of the code block. Defaults to False.

\n", - "default": "s" - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/code.py#L27" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/text_widgets.py#L37" }, - "StatusContainer.color_picker": { - "name": "color_picker", - "signature": "StatusContainer.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n
\n", - "description": "

Display a color picker widget.

\n", + "streamlit.time_input": { + "name": "time_input", + "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a time input widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this time input is for.

\n", "default": null }, { "name": "value", - "type_name": "str", + "type_name": "datetime.time/datetime.datetime", "is_optional": false, - "description": "

The hex value of this widget when it first renders. If None,\ndefaults to black.

\n", - "default": "black." + "description": "

The value of this widget when it first renders. This will be\ncast to str internally. Defaults to the current time.

\n", + "default": "the" }, { "name": "key", @@ -9259,14 +8245,14 @@ "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the color picker.

\n", + "description": "

An optional tooltip that gets displayed next to the input.

\n", "default": null }, { "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this color_picker's value\nchanges.

\n", + "description": "

An optional callback invoked when this time_input's value changes.

\n", "default": null }, { @@ -9287,385 +8273,580 @@ "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", - "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" + "description": "

An optional boolean, which disables the time input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" } ], "returns": [ { - "type_name": "str", + "type_name": "datetime.time", "is_generator": false, - "description": "

The selected color as a hex string.

\n", + "description": "

The current value of the time input widget.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/color_picker.py#L53" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/time_widgets.py#L165" }, - "StatusContainer.columns": { - "name": "columns", - "signature": "StatusContainer.columns(spec, *, gap=\"small\")", - "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n
\n", - "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", + "streamlit.title": { + "name": "title", + "signature": "st.title(body, anchor=None)", + "example": "
\n
\nst.title('This is a title')\n
\n
\n", + "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", "args": [ { - "name": "spec", - "type_name": "int or iterable of numbers", + "name": "body", + "type_name": "str", "is_optional": false, - "description": "

Controls the number and width of columns to insert. Can be one of:

\n
    \n
  • An integer that specifies the number of columns. All columns have equal\nwidth in this case.
  • \n
  • An iterable of numbers (int or float) that specify the relative width of\neach column. E.g. [0.7, 0.3] creates two columns where the first\none takes up 70% of the available with and the second one takes up 30%.\nOr [1, 2, 3] creates three columns where the second one is two times\nthe width of the first one, and the third one is three times that width.
  • \n
\n", + "description": "

The text to display.

\n", "default": null }, { - "name": "gap", - "type_name": "\"small\", \"medium\", or \"large\"", + "name": "anchor", + "type_name": "str", "is_optional": false, - "description": "

The size of the gap between the columns. Defaults to "small". This\nargument can only be supplied by keyword.

\n", - "default": "s" - } - ], - "returns": [ - { - "type_name": "list of containers", - "is_generator": false, - "description": "

A list of container objects.

\n", - "return_name": null + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/layouts.py#L79" - }, - "StatusContainer.container": { - "name": "container", - "signature": "StatusContainer.container()", - "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n
\n", - "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", - "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/layouts.py#L31" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/markdown.py#L165" }, - "StatusContainer.data_editor": { - "name": "data_editor", - "signature": "StatusContainer.data_editor(data, *, width=None, height=None, use_container_width=False, hide_index=None, column_order=None, column_config=None, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", - "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

Or you can customize the data editor via column_config, hide_index, column_order, or disabled:

\n
\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    [\n        {"command": "st.selectbox", "rating": 4, "is_widget": True},\n        {"command": "st.balloons", "rating": 5, "is_widget": False},\n        {"command": "st.time_input", "rating": 3, "is_widget": True},\n    ]\n)\nedited_df = st.data_editor(\n    df,\n    column_config={\n        "command": "Streamlit Command",\n        "rating": st.column_config.NumberColumn(\n            "Your rating",\n            help="How much do you like this command (1-5)?",\n            min_value=1,\n            max_value=5,\n            step=1,\n            format="%d \u2b50",\n        ),\n        "is_widget": "Widget ?",\n    },\n    disabled=["command", "is_widget"],\n    hide_index=True,\n)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n
\n", - "description": "

Display a data editor widget.

\n

The data editor widget allows you to edit dataframes and many other data structures in a table-like UI.

\n
\n

Warning

\n

When going from st.experimental_data_editor to st.data_editor in\n1.23.0, the data editor's representation in st.session_state was changed.\nThe edited_cells dictionary is now called edited_rows and uses a\ndifferent format ({0: {"column name": "edited value"}} instead of\n{"0:1": "edited value"}). You may need to adjust the code if your app uses\nst.experimental_data_editor in combination with st.session_state."

\n
\n", + "streamlit.vega_lite_chart": { + "name": "vega_lite_chart", + "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, **kwargs)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(df, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", + "description": "Display a chart using the Vega-Lite library.", "args": [ { "name": "data", - "type_name": "pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None", - "is_optional": false, - "description": "

The data to edit in the data editor.

\n
\n

Note

\n
    \n
  • Styles from pandas.Styler will only be applied to non-editable columns.
  • \n
  • Mixing data types within a column can make the column uneditable.
  • \n
  • Additionally, the following data types are not yet supported for editing:\ncomplex, list, tuple, bytes, bytearray, memoryview, dict, set, frozenset,\ndatetime.timedelta, decimal.Decimal, fractions.Fraction, pandas.Interval,\npandas.Period, pandas.Timedelta.
  • \n
\n
\n", - "default": null - }, - { - "name": "width", - "type_name": "int or None", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", "is_optional": false, - "description": "

Desired width of the data editor expressed in pixels. If None, the width will\nbe automatically determined.

\n", + "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null }, { - "name": "height", - "type_name": "int or None", + "name": "spec", + "type_name": "dict or None", "is_optional": false, - "description": "

Desired height of the data editor expressed in pixels. If None, the height will\nbe automatically determined.

\n", + "description": "

The Vega-Lite spec for the chart. If the spec was already passed in\nthe previous argument, this must be set to None. See\nhttps://vega.github.io/vega-lite/docs/ for more info.

\n", "default": null }, { "name": "use_container_width", "type_name": "bool", "is_optional": false, - "description": "

If True, set the data editor width to the width of the parent container.\nThis takes precedence over the width argument. Defaults to False.

\n", - "default": "False." - }, - { - "name": "hide_index", - "type_name": "bool or None", - "is_optional": false, - "description": "

Whether to hide the index column(s). If None (default), the visibility of\nindex columns is automatically determined based on the data.

\n", + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", "default": null }, { - "name": "column_order", - "type_name": "iterable of str or None", + "name": "**kwargs", + "type_name": "any", "is_optional": false, - "description": "

Specifies the display order of columns. This also affects which columns are\nvisible. For example, column_order=("col2", "col1") will display 'col2'\nfirst, followed by 'col1', and will hide all other non-index columns. If\nNone (default), the order is inherited from the original data structure.

\n", + "description": "

Same as spec, but as keywords.

\n", "default": null - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/dataframe_selector.py#L425" + }, + "streamlit.video": { + "name": "video", + "signature": "st.video(data, format=\"video/mp4\", start_time=0)", + "example": "
\n
\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", + "description": "Display a video player.", + "args": [ { - "name": "column_config", - "type_name": "dict or None", + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", "is_optional": false, - "description": "

Configures how columns are displayed, e.g. their title, visibility, type, or\nformat, as well as editing properties such as min/max value or step.\nThis needs to be a dictionary where each key is a column name and the value\nis one of:

\n
    \n
  • None to hide the column.
  • \n
  • A string to set the display label of the column.
  • \n
  • One of the column types defined under st.column_config, e.g.\nst.column_config.NumberColumn("Dollar values\u201d, format=\u201d$ %d") to show\na column as dollar amounts. See more info on the available column types\nand config options here.
  • \n
\n

To configure the index column(s), use _index as the column name.

\n", + "description": "

io.open().\nRaw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", "default": null }, { - "name": "num_rows", - "type_name": "\"fixed\" or \"dynamic\"", + "name": "format", + "type_name": "str", "is_optional": false, - "description": "

Specifies if the user can add and delete rows in the data editor.\nIf "fixed", the user cannot add or delete rows. If "dynamic", the user can\nadd and delete rows in the data editor, but column sorting is disabled.\nDefaults to "fixed".

\n", + "description": "

The mime type for the video file. Defaults to 'video/mp4'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", "default": "s" }, { - "name": "disabled", - "type_name": "bool or iterable of str", + "name": "start_time", + "type_name": "int", "is_optional": false, - "description": "

Controls the editing of columns. If True, editing is disabled for all columns.\nIf an iterable of column names is provided (e.g., disabled=("col1", "col2")),\nonly the specified columns will be disabled for editing. If False (default),\nall columns that support editing are editable.

\n", + "description": "

The time from which this element should start playing.

\n", "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/media.py#L79" + }, + "streamlit.warning": { + "name": "warning", + "signature": "st.warning(body, *, icon=None)", + "example": "
\n
\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", + "description": "Display warning message.", + "args": [ + { + "name": "icon", + "type_name": "None", + "is_optional": false, + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" }, { - "name": "key", + "name": "body", "type_name": "str", "is_optional": false, - "description": "

An optional string to use as the unique key for this widget. If this\nis omitted, a key will be generated for the widget based on its\ncontent. Multiple widgets of the same type may not share the same\nkey.

\n", + "description": "

The warning text to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/alert.py#L67" + }, + "streamlit.write": { + "name": "write", + "signature": "st.write(*args, **kwargs)", + "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nwrite('Hello, *World!* :sunglasses:')\n
\n\n \n \n (view standalone Streamlit app)\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n \n (view standalone Streamlit app)\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n \n (view standalone Streamlit app)\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression and emoji shortcodes.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", "default": null }, { - "name": "on_change", - "type_name": "callable", + "name": "unsafe_allow_html", + "type_name": "bool", "is_optional": false, - "description": "

An optional callback invoked when this data_editor's value changes.

\n", + "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n

Also note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.

\n

If you decide to turn on HTML anyway, we ask you to please tell us your\nexact use case here:\nhttps://discuss.streamlit.io/t/96 .

\n

This will help us come up with safe APIs that allow you to do what you\nwant.

\n", + "default": "False" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/write.py#L43" + }, + "streamlit.experimental_memo.clear": { + "name": "experimental_memo.clear", + "signature": "st.experimental_memo.clear()", + "description": "Clear all in-memory and on-disk memo caches.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/runtime/caching/memo_decorator.py#L361" + }, + "streamlit.experimental_singleton.clear": { + "name": "experimental_singleton.clear", + "signature": "st.experimental_singleton.clear()", + "description": "Clear all singleton caches.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/runtime/caching/singleton_decorator.py#L248" + }, + "streamlit.components.v1.declare_component": { + "name": "declare_component", + "signature": "st.components.v1.declare_component(name, path=None, url=None)", + "description": "Create and register a custom component.", + "args": [ + { + "name": "name", + "type_name": "str", + "is_optional": false, + "description": "

A short, descriptive name for the component. Like, "slider".

\n", "default": null }, { - "name": "args", - "type_name": "tuple", + "name": "path", + "type_name": "str or None", "is_optional": false, - "description": "

An optional tuple of args to pass to the callback.

\n", + "description": "

The path to serve the component's frontend files from. Either\npath or url must be specified, but not both.

\n", "default": null }, { - "name": "kwargs", - "type_name": "dict", + "name": "url", + "type_name": "str or None", "is_optional": false, - "description": "

An optional dict of kwargs to pass to the callback.

\n", + "description": "

The URL that the component is served from. Either path or url\nmust be specified, but not both.

\n", "default": null } ], "returns": [ { - "type_name": "pandas.DataFrame, pandas.Series, pyarrow.Table, numpy.ndarray, list, set, tuple, or dict.", + "type_name": "CustomComponent", "is_generator": false, - "description": "

The edited data. The edited data is returned in its original data type if\nit corresponds to any of the supported return types. All other data types\nare returned as a pd.DataFrame.

\n", + "description": "

A CustomComponent that can be called like a function.\nCalling the component will create a new instance of the component\nin the Streamlit app.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/data_editor.py#L529" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/components/v1/components.py#L243" }, - "StatusContainer.dataframe": { - "name": "dataframe", - "signature": "StatusContainer.dataframe(data=None, width=None, height=None, *, use_container_width=False, hide_index=None, column_order=None, column_config=None)", - "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n

Or you can customize the dataframe via column_config, hide_index, or column_order:

\n
\nimport random\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    {\n        "name": ["Roadmap", "Extras", "Issues"],\n        "url": ["https://roadmap.streamlit.app", "https://extras.streamlit.app", "https://issues.streamlit.app"],\n        "stars": [random.randint(0, 1000) for _ in range(3)],\n        "views_history": [[random.randint(0, 5000) for _ in range(30)] for _ in range(3)],\n    }\n)\nst.dataframe(\n    df,\n    column_config={\n        "name": "App name",\n        "stars": st.column_config.NumberColumn(\n            "Github Stars",\n            help="Number of stars on GitHub",\n            format="%d \u2b50",\n        ),\n        "url": st.column_config.LinkColumn("App URL"),\n        "views_history": st.column_config.LineChartColumn(\n            "Views (past 30 days)", y_min=0, y_max=5000\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Display a dataframe as an interactive table.

\n

This command works with dataframes from Pandas, PyArrow, Snowpark, and PySpark.\nIt can also display several other types that can be converted to dataframes,\ne.g. numpy arrays, lists, sets and dictionaries.

\n", + "streamlit.components.v1.html": { + "name": "html", + "signature": "st.components.v1.html(html, width=None, height=None, scrolling=False)", + "description": "Display an HTML string in an iframe.", "args": [ { - "name": "data", - "type_name": "pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "name": "html", + "type_name": "str", "is_optional": false, - "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.

\n", + "description": "

The HTML string to embed in the iframe.

\n", "default": null }, { "name": "width", - "type_name": "int or None", + "type_name": "int", "is_optional": false, - "description": "

Desired width of the dataframe expressed in pixels. If None, the width\nwill be automatically calculated based on the column content.

\n", - "default": null + "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", + "default": "the" }, { "name": "height", - "type_name": "int or None", + "type_name": "int", "is_optional": false, - "description": "

Desired height of the dataframe expressed in pixels. If None, a\ndefault height is used.

\n", - "default": "height" + "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", + "default": "150" }, { - "name": "use_container_width", + "name": "scrolling", "type_name": "bool", "is_optional": false, - "description": "

If True, set the dataframe width to the width of the parent container.\nThis takes precedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", + "default": "False" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/iframe.py#L57" + }, + "streamlit.components.v1.iframe": { + "name": "iframe", + "signature": "st.components.v1.iframe(src, width=None, height=None, scrolling=False)", + "description": "Load a remote URL in an iframe.", + "args": [ + { + "name": "src", + "type_name": "str", + "is_optional": false, + "description": "

The URL of the page to embed.

\n", "default": null }, { - "name": "hide_index", - "type_name": "bool or None", + "name": "width", + "type_name": "int", "is_optional": false, - "description": "

Whether to hide the index column(s). If None (default), the visibility of\nindex columns is automatically determined based on the data.

\n", + "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", + "default": "the" + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", + "default": "150" + }, + { + "name": "scrolling", + "type_name": "bool", + "is_optional": false, + "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", + "default": "False" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/iframe.py#L24" + }, + "DeltaGenerator.add_rows": { + "name": "add_rows", + "signature": "element.add_rows(self, data=None, **kwargs)", + "example": "
\n
\ndf1 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table = st.table(df1)\n\ndf2 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table.add_rows(df2)\n# Now the table shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

You can do the same thing with plots. For example, if you want to add\nmore data to a line chart:

\n
\n# Assuming df1 and df2 from the example above still exist...\nmy_chart = st.line_chart(df1)\nmy_chart.add_rows(df2)\n# Now the chart shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

And for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:

\n
\nmy_chart = st.vega_lite_chart({\n    'mark': 'line',\n    'encoding': {'x': 'a', 'y': 'b'},\n    'datasets': {\n      'some_fancy_name': df1,  # <-- named dataset\n     },\n    'data': {'name': 'some_fancy_name'},\n}),\nmy_chart.add_rows(some_fancy_name=df2)  # <-- name used as keyword\n
\n
\n", + "description": "Concatenate a dataframe to the bottom of the current one.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

Table to concat. Optional.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null }, { - "name": "column_order", - "type_name": "iterable of str or None", + "name": "**kwargs", + "type_name": "pandas.DataFrame, numpy.ndarray, Iterable, dict, or None", "is_optional": false, - "description": "

Specifies the display order of columns. This also affects which columns are\nvisible. For example, column_order=("col2", "col1") will display 'col2'\nfirst, followed by 'col1', and will hide all other non-index columns. If\nNone (default), the order is inherited from the original data structure.

\n", + "description": "

The named dataset to concat. Optional. You can only pass in 1\ndataset (including the one in the data parameter).

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/dataframe_selector.py#L494" + }, + "DeltaGenerator.altair_chart": { + "name": "altair_chart", + "signature": "element.altair_chart(self, altair_chart, use_container_width=False)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a chart using the Altair library.", + "args": [ + { + "name": "altair_chart", + "type_name": "altair.vegalite.v2.api.Chart", + "is_optional": false, + "description": "

The Altair chart object to display.

\n", "default": null }, { - "name": "column_config", - "type_name": "dict or None", + "name": "use_container_width", + "type_name": "bool", "is_optional": false, - "description": "

Configures how columns are displayed, e.g. their title, visibility, type, or\nformat. This needs to be a dictionary where each key is a column name and\nthe value is one of:

\n
    \n
  • None to hide the column.
  • \n
  • A string to set the display label of the column.
  • \n
  • One of the column types defined under st.column_config, e.g.\nst.column_config.NumberColumn("Dollar values\u201d, format=\u201d$ %d") to show\na column as dollar amounts. See more info on the available column types\nand config options here.
  • \n
\n

To configure the index column(s), use _index as the column name.

\n", + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L44" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/dataframe_selector.py#L379" }, - "StatusContainer.date_input": { - "name": "date_input", - "signature": "StatusContainer.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, format=\"YYYY/MM/DD\", disabled=False, label_visibility=\"visible\")", - "examples": "
\n
\nimport datetime\nimport streamlit as st\n\nd = st.date_input("When's your birthday", datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n
\nimport datetime\nimport streamlit as st\n\ntoday = datetime.datetime.now()\nnext_year = today.year + 1\njan_1 = datetime.date(next_year, 1, 1)\ndec_31 = datetime.date(next_year, 12, 31)\n\nd = st.date_input(\n    "Select your vacation for next year",\n    (jan_1, datetime.date(next_year, 1, 7)),\n    jan_1,\n    dec_31,\n    format="MM.DD.YYYY",\n)\nd\n
\n\n \n
\n", - "description": "

Display a date input widget.

\n", + "DeltaGenerator.area_chart": { + "name": "area_chart", + "signature": "element.area_chart(self, data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", "args": [ { - "name": "label", - "type_name": "str", + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, or dict", "is_optional": false, - "description": "

A short label explaining to the user what this date input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null }, { - "name": "value", - "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", + "name": "x", + "type_name": "str or None", "is_optional": false, - "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", - "default": "today" + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null }, { - "name": "min_value", - "type_name": "datetime.date or datetime.datetime", + "name": "y", + "type_name": "str, sequence of str, or None", "is_optional": false, - "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", - "default": "value" + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null }, { - "name": "max_value", - "type_name": "datetime.date or datetime.datetime", + "name": "width", + "type_name": "int", "is_optional": false, - "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", - "default": "value" + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null }, { - "name": "key", - "type_name": "str or int", + "name": "height", + "type_name": "int", "is_optional": false, - "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", "default": null }, { - "name": "help", + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/dataframe_selector.py#L214" + }, + "DeltaGenerator.audio": { + "name": "audio", + "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0)", + "example": "
\n
\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an audio player.", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw audio data, filename, or a URL pointing to the file to load.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "default": null + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + }, + { + "name": "format", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the input.

\n", + "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/media.py#L41" + }, + "DeltaGenerator.balloons": { + "name": "balloons", + "signature": "element.balloons(self)", + "example": "
\n
\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", + "description": "Draw celebratory balloons.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/balloons.py#L24" + }, + "DeltaGenerator.bar_chart": { + "name": "bar_chart", + "signature": "element.bar_chart(self, data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nchart_data = pd.DataFrame(\n    np.random.randn(50, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null }, { - "name": "on_change", - "type_name": "callable", + "name": "x", + "type_name": "str or None", "is_optional": false, - "description": "

An optional callback invoked when this date_input's value changes.

\n", + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", "default": null }, { - "name": "args", - "type_name": "tuple", + "name": "y", + "type_name": "str, sequence of str, or None", "is_optional": false, - "description": "

An optional tuple of args to pass to the callback.

\n", + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", "default": null }, { - "name": "kwargs", - "type_name": "dict", + "name": "width", + "type_name": "int", "is_optional": false, - "description": "

An optional dict of kwargs to pass to the callback.

\n", + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", "default": null }, { - "name": "format", - "type_name": "str", + "name": "height", + "type_name": "int", "is_optional": false, - "description": "

A format string controlling how the interface should display dates.\nSupports \u201cYYYY/MM/DD\u201d (default), \u201cDD/MM/YYYY\u201d, or \u201cMM/DD/YYYY\u201d.\nYou may also use a period (.) or hyphen (-) as separators.

\n", + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", "default": null }, { - "name": "disabled", + "name": "use_container_width", "type_name": "bool", "is_optional": false, - "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", - "default": "False." + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/dataframe_selector.py#L296" + }, + "DeltaGenerator.beta_columns": { + "name": "beta_columns", + "signature": "element.beta_columns(*args, **kwargs)", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put columns inside another column.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null }, { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" } ], "returns": [ { - "type_name": "datetime.date or a tuple with 0-2 dates", + "type_name": "list of containers", "is_generator": false, - "description": "

The current value of the date input widget.

\n", + "description": "

A list of container objects.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/time_widgets.py#L415" - }, - "StatusContainer.dg": { - "name": "dg", - "signature": "StatusContainer.dg", - "description": "

Get our DeltaGenerator.

\n", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/alert.py#L156" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/beta_util.py#L43" }, - "StatusContainer.divider": { - "name": "divider", - "signature": "StatusContainer.divider()", - "example": "
\n
\nimport streamlit as st\n\nst.divider()\n
\n
\n", - "description": "

Display a horizontal rule.

\n
\n

Note

\n

You can achieve the same effect with st.write("---") or\neven just "---" in your script (via magic).

\n
\n", + "DeltaGenerator.beta_container": { + "name": "beta_container", + "signature": "element.beta_container(*args, **kwargs)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/markdown.py#L258" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/beta_util.py#L43" }, - "StatusContainer.download_button": { - "name": "download_button", - "signature": "StatusContainer.download_button(label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", - "examples": "
\n

Download a large DataFrame as a CSV:

\n
\nimport streamlit as st\n\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\nimport streamlit as st\n\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nimport streamlit as st\n\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nimport streamlit as st\n\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n
\n", - "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", + "DeltaGenerator.beta_expander": { + "name": "beta_expander", + "signature": "element.beta_expander(*args, **kwargs)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write("""\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    """)\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write("""\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n""")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "description": "

A string to use as the header for the expander.

\n", "default": null }, { - "name": "data", - "type_name": "str or bytes or file", + "name": "expanded", + "type_name": "bool", "is_optional": false, - "description": "

The contents of the file to be downloaded. See example below for\ncaching techniques to avoid recomputing this data unnecessarily.

\n", + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/beta_util.py#L43" + }, + "DeltaGenerator.bokeh_chart": { + "name": "bokeh_chart", + "signature": "element.bokeh_chart(self, figure, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", + "args": [ + { + "name": "figure", + "type_name": "bokeh.plotting.figure.Figure", + "is_optional": false, + "description": "

A Bokeh figure to plot.

\n", "default": null }, { - "name": "file_name", - "type_name": "str", + "name": "use_container_width", + "type_name": "bool", "is_optional": false, - "description": "

An optional string to use as the name of the file to be downloaded,\nsuch as 'my_file.csv'. If not specified, the name will be\nautomatically generated.

\n", + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Bokeh's native width value.

\n", "default": null - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/bokeh_chart.py#L33" + }, + "DeltaGenerator.button": { + "name": "button", + "signature": "element.button(self, label, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a button widget.", + "args": [ { - "name": "mime", - "type_name": "str or None", + "name": "label", + "type_name": "str", "is_optional": false, - "description": "

The MIME type of the data. If None, defaults to "text/plain"\n(if data is of type str or is a textual file) or\n"application/octet-stream" (if data is of type bytes or is a\nbinary file).

\n", - "default": "s" + "description": "

A short label explaining to the user what this button is for.

\n", + "default": null }, { "name": "key", @@ -9702,26 +8883,12 @@ "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, - { - "name": "type", - "type_name": "\"secondary\" or \"primary\"", - "is_optional": false, - "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", - "default": "s" - }, { "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", - "default": "False." - }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", - "default": null + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" } ], "returns": [ @@ -9732,163 +8899,483 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/button.py#L170" - }, - "StatusContainer.empty": { - "name": "empty", - "signature": "StatusContainer.empty()", - "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport streamlit as st\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nimport streamlit as st\n\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", - "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/empty.py#L24" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/button.py#L51" }, - "StatusContainer.error": { - "name": "error", - "signature": "StatusContainer.error(body, *, icon=None)", - "example": "
\n
\nimport streamlit as st\n\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", - "description": "

Display error message.

\n", + "DeltaGenerator.camera_input": { + "name": "camera_input", + "signature": "element.camera_input(self, label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", + "description": "Display a widget that returns pictures from the user's webcam.", "args": [ { - "name": "body", + "name": "label", "type_name": "str", "is_optional": false, - "description": "

The error text to display.

\n", + "description": "

A short label explaining to the user what this widget is used for.

\n", "default": null }, { - "name": "icon", - "type_name": "str or None", + "name": "key", + "type_name": "str or int", "is_optional": false, - "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", - "default": "None" + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the camera input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this camera_input's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile", + "is_generator": false, + "description": "

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/camera_input.py#L47" + }, + "DeltaGenerator.caption": { + "name": "caption", + "signature": "element.caption(self, body, unsafe_allow_html=False)", + "example": "
\n
\nst.caption('This is a string that explains something above.')\n
\n
\n", + "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display.

\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n

Also note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.

\n

If you decide to turn on HTML anyway, we ask you to please tell us your\nexact use case here:\nhttps://discuss.streamlit.io/t/96 .

\n

This will help us come up with safe APIs that allow you to do what you\nwant.

\n", + "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/alert.py#L27" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/markdown.py#L193" }, - "StatusContainer.exception": { - "name": "exception", - "signature": "StatusContainer.exception(exception)", - "example": "
\n
\nimport streamlit as st\n\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", - "description": "

Display an exception.

\n", + "DeltaGenerator.checkbox": { + "name": "checkbox", + "signature": "element.checkbox(self, label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a checkbox widget.", "args": [ { - "name": "exception", - "type_name": "Exception", + "name": "label", + "type_name": "str", "is_optional": false, - "description": "

The exception to display.

\n", + "description": "

A short label explaining to the user what this checkbox is for.

\n", + "default": null + }, + { + "name": "value", + "type_name": "bool", + "is_optional": false, + "description": "

Preselect the checkbox when it first renders. This will be\ncast to bool internally.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the checkbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this checkbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

Whether or not the checkbox is checked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/checkbox.py#L36" + }, + "DeltaGenerator.code": { + "name": "code", + "signature": "element.code(self, body, language=\"python\")", + "example": "
\n
\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", + "description": "

Display a code block with optional syntax highlighting.

\n

(This is a convenience wrapper around st.markdown())

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as code.

\n", + "default": null + }, + { + "name": "language", + "type_name": "str", + "is_optional": false, + "description": "

The language that the code is written in, for syntax highlighting.\nIf omitted, the code will be unstyled.

\n

For a list of available language imports, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/exception.py#L50" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/markdown.py#L132" }, - "StatusContainer.expander": { - "name": "expander", - "signature": "StatusContainer.expander(label, expanded=False)", - "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n
\n", - "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "DeltaGenerator.color_picker": { + "name": "color_picker", + "signature": "element.color_picker(self, label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a color picker widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "description": "

A short label explaining to the user what this input is for.

\n", "default": null }, { - "name": "expanded", + "name": "value", + "type_name": "str", + "is_optional": false, + "description": "

The hex value of this widget when it first renders. If None,\ndefaults to black.

\n", + "default": "black" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the color picker.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this color_picker's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", - "default": "s" + "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The selected color as a hex string.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/color_picker.py#L35" + }, + "DeltaGenerator.columns": { + "name": "columns", + "signature": "element.columns(self, spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put columns inside another column.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null } ], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/layouts.py#L72" + }, + "DeltaGenerator.container": { + "name": "container", + "signature": "element.container(self)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/layouts.py#L319" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/layouts.py#L28" }, - "StatusContainer.experimental_data_editor": { - "name": "experimental_data_editor", - "signature": "StatusContainer.experimental_data_editor(data, *, width=None, height=None, use_container_width=False, hide_index=None, column_order=None, column_config=None, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", - "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

Or you can customize the data editor via column_config, hide_index, column_order, or disabled:

\n
\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    [\n        {"command": "st.selectbox", "rating": 4, "is_widget": True},\n        {"command": "st.balloons", "rating": 5, "is_widget": False},\n        {"command": "st.time_input", "rating": 3, "is_widget": True},\n    ]\n)\nedited_df = st.data_editor(\n    df,\n    column_config={\n        "command": "Streamlit Command",\n        "rating": st.column_config.NumberColumn(\n            "Your rating",\n            help="How much do you like this command (1-5)?",\n            min_value=1,\n            max_value=5,\n            step=1,\n            format="%d \u2b50",\n        ),\n        "is_widget": "Widget ?",\n    },\n    disabled=["command", "is_widget"],\n    hide_index=True,\n)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n
\n", - "description": "

Display a data editor widget.

\n

The data editor widget allows you to edit dataframes and many other data structures in a table-like UI.

\n
\n

Warning

\n

When going from st.experimental_data_editor to st.data_editor in\n1.23.0, the data editor's representation in st.session_state was changed.\nThe edited_cells dictionary is now called edited_rows and uses a\ndifferent format ({0: {"column name": "edited value"}} instead of\n{"0:1": "edited value"}). You may need to adjust the code if your app uses\nst.experimental_data_editor in combination with st.session_state."

\n
\n", + "DeltaGenerator.dataframe": { + "name": "dataframe", + "signature": "element.dataframe(self, data=None, width=None, height=None)", + "examples": "
\n
\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\nst.dataframe(df, 200, 100)\n
\n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a dataframe as an interactive table.", "args": [ { "name": "data", - "type_name": "pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", "is_optional": false, - "description": "

The data to edit in the data editor.

\n
\n

Note

\n
    \n
  • Styles from pandas.Styler will only be applied to non-editable columns.
  • \n
  • Mixing data types within a column can make the column uneditable.
  • \n
  • Additionally, the following data types are not yet supported for editing:\ncomplex, list, tuple, bytes, bytearray, memoryview, dict, set, frozenset,\ndatetime.timedelta, decimal.Decimal, fractions.Fraction, pandas.Interval,\npandas.Period, pandas.Timedelta.
  • \n
\n
\n", + "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. (It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.)\nStyler support is experimental!\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null }, { "name": "width", "type_name": "int or None", "is_optional": false, - "description": "

Desired width of the data editor expressed in pixels. If None, the width will\nbe automatically determined.

\n", - "default": null + "description": "

Desired width of the UI element expressed in pixels. If None, a\ndefault width based on the page width is used.

\n", + "default": "width" }, { "name": "height", "type_name": "int or None", "is_optional": false, - "description": "

Desired height of the data editor expressed in pixels. If None, the height will\nbe automatically determined.

\n", + "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/dataframe_selector.py#L37" + }, + "DeltaGenerator.date_input": { + "name": "date_input", + "signature": "element.date_input(self, label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\nd = st.date_input(\n    "When's your birthday",\n    datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a date input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this date input is for.

\n", "default": null }, { - "name": "use_container_width", - "type_name": "bool", + "name": "value", + "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", "is_optional": false, - "description": "

If True, set the data editor width to the width of the parent container.\nThis takes precedence over the width argument. Defaults to False.

\n", - "default": "False." + "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", + "default": "today" }, { - "name": "hide_index", - "type_name": "bool or None", + "name": "min_value", + "type_name": "datetime.date or datetime.datetime", "is_optional": false, - "description": "

Whether to hide the index column(s). If None (default), the visibility of\nindex columns is automatically determined based on the data.

\n", + "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", + "default": "value" + }, + { + "name": "max_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", + "default": "value" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", "default": null }, { - "name": "column_order", - "type_name": "iterable of str or None", + "name": "help", + "type_name": "str", "is_optional": false, - "description": "

Specifies the display order of columns. This also affects which columns are\nvisible. For example, column_order=("col2", "col1") will display 'col2'\nfirst, followed by 'col1', and will hide all other non-index columns. If\nNone (default), the order is inherited from the original data structure.

\n", + "description": "

An optional tooltip that gets displayed next to the input.

\n", "default": null }, { - "name": "column_config", - "type_name": "dict or None", + "name": "on_change", + "type_name": "callable", "is_optional": false, - "description": "

Configures how columns are displayed, e.g. their title, visibility, type, or\nformat, as well as editing properties such as min/max value or step.\nThis needs to be a dictionary where each key is a column name and the value\nis one of:

\n
    \n
  • None to hide the column.
  • \n
  • A string to set the display label of the column.
  • \n
  • One of the column types defined under st.column_config, e.g.\nst.column_config.NumberColumn("Dollar values\u201d, format=\u201d$ %d") to show\na column as dollar amounts. See more info on the available column types\nand config options here.
  • \n
\n

To configure the index column(s), use _index as the column name.

\n", + "description": "

An optional callback invoked when this date_input's value changes.

\n", "default": null }, { - "name": "num_rows", - "type_name": "\"fixed\" or \"dynamic\"", + "name": "args", + "type_name": "tuple", "is_optional": false, - "description": "

Specifies if the user can add and delete rows in the data editor.\nIf "fixed", the user cannot add or delete rows. If "dynamic", the user can\nadd and delete rows in the data editor, but column sorting is disabled.\nDefaults to "fixed".

\n", - "default": "s" + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null }, { "name": "disabled", - "type_name": "bool or iterable of str", + "type_name": "bool", "is_optional": false, - "description": "

Controls the editing of columns. If True, editing is disabled for all columns.\nIf an iterable of column names is provided (e.g., disabled=("col1", "col2")),\nonly the specified columns will be disabled for editing. If False (default),\nall columns that support editing are editable.

\n", + "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + } + ], + "returns": [ + { + "type_name": "datetime.date or a tuple with 0-2 dates", + "is_generator": false, + "description": "

The current value of the date input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/time_widgets.py#L305" + }, + "DeltaGenerator.determine_delta_color_and_direction": { + "name": "determine_delta_color_and_direction", + "signature": "element.determine_delta_color_and_direction(self, delta_color, delta)" + }, + "DeltaGenerator.download_button": { + "name": "download_button", + "signature": "element.download_button(self, label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False)", + "examples": "
\n

Download a large DataFrame as a CSV:

\n
\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.

\n", + "default": null + }, + { + "name": "data", + "type_name": "str or bytes or file", + "is_optional": false, + "description": "

The contents of the file to be downloaded. See example below for\ncaching techniques to avoid recomputing this data unnecessarily.

\n", + "default": null + }, + { + "name": "file_name", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the name of the file to be downloaded,\nsuch as 'my_file.csv'. If not specified, the name will be\nautomatically generated.

\n", "default": null }, + { + "name": "mime", + "type_name": "str or None", + "is_optional": false, + "description": "

The MIME type of the data. If None, defaults to "text/plain"\n(if data is of type str or is a textual file) or\n"application/octet-stream" (if data is of type bytes or is a\nbinary file).

\n", + "default": "s" + }, { "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional string to use as the unique key for this widget. If this\nis omitted, a key will be generated for the widget based on its\ncontent. Multiple widgets of the same type may not share the same\nkey.

\n", + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", "default": null }, { - "name": "on_change", + "name": "on_click", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this data_editor's value changes.

\n", + "description": "

An optional callback invoked when this button is clicked.

\n", "default": null }, { @@ -9904,29 +9391,110 @@ "is_optional": false, "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" } ], "returns": [ { - "type_name": "pandas.DataFrame, pandas.Series, pyarrow.Table, numpy.ndarray, list, set, tuple, or dict.", + "type_name": "bool", "is_generator": false, - "description": "

The edited data. The edited data is returned in its original data type if\nit corresponds to any of the supported return types. All other data types\nare returned as a pd.DataFrame.

\n", + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/data_editor.py#L529" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/button.py#L118" }, - "StatusContainer.file_uploader": { + "DeltaGenerator.empty": { + "name": "empty", + "signature": "element.empty(self)", + "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", + "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/empty.py#L24" + }, + "DeltaGenerator.error": { + "name": "error", + "signature": "element.error(self, body, *, icon=None)", + "example": "
\n
\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", + "description": "Display error message.", + "args": [ + { + "name": "icon", + "type_name": "None", + "is_optional": false, + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" + }, + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The error text to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/alert.py#L39" + }, + "DeltaGenerator.exception": { + "name": "exception", + "signature": "element.exception(self, exception)", + "example": "
\n
\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", + "description": "Display an exception.", + "args": [ + { + "name": "exception", + "type_name": "Exception", + "is_optional": false, + "description": "

The exception to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/exception.py#L46" + }, + "DeltaGenerator.expander": { + "name": "expander", + "signature": "element.expander(self, label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write("""\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    """)\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write("""\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n""")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/layouts.py#L283" + }, + "DeltaGenerator.file_uploader": { "name": "file_uploader", - "signature": "StatusContainer.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nimport streamlit as st\nimport pandas as pd\nfrom io import StringIO\n\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nimport streamlit as st\n\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n
\n", + "signature": "element.file_uploader(self, label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this file uploader is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this file uploader is for.

\n", "default": null }, { @@ -9983,14 +9551,7 @@ "type_name": "bool", "is_optional": false, "description": "

An optional boolean, which disables the file uploader if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", - "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" + "default": "False" } ], "returns": [ @@ -10001,13 +9562,13 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/file_uploader.py#L222" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/file_uploader.py#L132" }, - "StatusContainer.form": { + "DeltaGenerator.form": { "name": "form", - "signature": "StatusContainer.form(key, clear_on_submit=False)", - "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n\n \n
\n", - "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
  • Within a form, the only widget that can have a callback function is\nst.form_submit_button.
  • \n
\n", + "signature": "element.form(self, key, clear_on_submit=False)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n

Inserting elements out of order:

\n
\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n
\n", + "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
\n

For more information about forms, check out our\nblog post.

\n", "args": [ { "name": "key", @@ -10025,11 +9586,11 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/form.py#L118" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/form.py#L112" }, - "StatusContainer.form_submit_button": { + "DeltaGenerator.form_submit_button": { "name": "form_submit_button", - "signature": "StatusContainer.form_submit_button(label=\"Submit\", help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "signature": "element.form_submit_button(self, label=\"Submit\", help=None, on_click=None, args=None, kwargs=None)", "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", "args": [ { @@ -10044,7 +9605,7 @@ "type_name": "str or None", "is_optional": false, "description": "

A tooltip that gets displayed when the button is hovered over.\nDefaults to None.

\n", - "default": "None." + "default": "None" }, { "name": "on_click", @@ -10066,27 +9627,6 @@ "is_optional": false, "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null - }, - { - "name": "type", - "type_name": "\"secondary\" or \"primary\"", - "is_optional": false, - "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", - "default": "s" - }, - { - "name": "disabled", - "type_name": "bool", - "is_optional": false, - "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", - "default": "False." - }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", - "default": null } ], "returns": [ @@ -10097,13 +9637,13 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/form.py#L218" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/form.py#L200" }, - "StatusContainer.graphviz_chart": { + "DeltaGenerator.graphviz_chart": { "name": "graphviz_chart", - "signature": "StatusContainer.graphviz_chart(figure_or_dot, use_container_width=False)", - "example": "
\n
\nimport streamlit as st\nimport graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n
\n", - "description": "

Display a graph using the dagre-d3 library.

\n", + "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nimport graphviz as graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a graph using the dagre-d3 library.", "args": [ { "name": "figure_or_dot", @@ -10121,69 +9661,54 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/graphviz_chart.py#L39" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/graphviz_chart.py#L30" }, - "StatusContainer.header": { + "DeltaGenerator.header": { "name": "header", - "signature": "StatusContainer.header(body, anchor=None, *, help=None, divider=False)", - "examples": "
\n
\nimport streamlit as st\n\nst.header('This is a header with a divider', divider='rainbow')\nst.header('_Streamlit_ is :blue[cool] :sunglasses:')\n
\n\n \n
\n", - "description": "

Display text in header formatting.

\n", + "signature": "element.header(self, body, anchor=None)", + "example": "
\n
\nst.header('This is a header')\n
\n
\n", + "description": "Display text in header formatting.", "args": [ { "name": "body", "type_name": "str", "is_optional": false, - "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", + "description": "

The text to display.

\n", "default": null }, { "name": "anchor", - "type_name": "str or False", - "is_optional": false, - "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", - "default": null - }, - { - "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the header.

\n", - "default": null - }, - { - "name": "divider", - "type_name": "bool or \u201cblue\u201d, \u201cgreen\u201d, \u201corange\u201d, \u201cred\u201d, \u201cviolet\u201d, \u201cgray\u201d/\"grey\", or \u201crainbow\u201d", - "is_optional": false, - "description": "

Shows a colored divider below the header. If True, successive\nheaders will cycle through divider colors. That is, the first\nheader will have a blue line, the second header will have a\ngreen line, and so on. If a string, the color can be set to one of\nthe following: blue, green, orange, red, violet, gray/grey, or\nrainbow.

\n", + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/heading.py#L41" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/markdown.py#L81" }, - "StatusContainer.help": { + "DeltaGenerator.help": { "name": "help", - "signature": "StatusContainer.help(obj=)", - "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nimport streamlit as st\nimport pandas\n\nst.help(pandas.DataFrame)\n
\n\n \n

Want to quickly check what data type is output by a certain function?\nTry:

\n
\nimport streamlit as st\n\nx = my_poorly_documented_function()\nst.help(x)\n
\n

Want to quickly inspect an object? No sweat:

\n
\nclass Dog:\n  '''A typical dog.'''\n\n  def __init__(self, breed, color):\n    self.breed = breed\n    self.color = color\n\n  def bark(self):\n    return 'Woof!'\n\n\nfido = Dog('poodle', 'white')\n\nst.help(fido)\n
\n\n \n

And if you're using Magic, you can get help for functions, classes,\nand modules without even typing st.help:

\n
\nimport streamlit as st\nimport pandas\n\n# Get help for Pandas read_csv:\npandas.read_csv\n\n# Get help for Streamlit itself:\nst\n
\n\n \n
\n", - "description": "

Display help and other information for a given object.

\n

Depending on the type of object that is passed in, this displays the\nobject's name, type, value, signature, docstring, and member variables,\nmethods \u2014 as well as the values/docstring of members and methods.

\n", + "signature": "element.help(self, obj)", + "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nst.help(pandas.DataFrame)\n
\n

Want to quickly check what datatype is output by a certain function?\nTry:

\n
\nx = my_poorly_documented_function()\nst.help(x)\n
\n
\n", + "description": "

Display object's doc string, nicely formatted.

\n

Displays the doc string for this object.

\n", "args": [ { "name": "obj", - "type_name": "any", + "type_name": "Object", "is_optional": false, - "description": "

The object whose information should be displayed. If left\nunspecified, this call will display help for Streamlit itself.

\n", + "description": "

The object whose docstring should be displayed.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/doc_string.py#L48" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/doc_string.py#L41" }, - "StatusContainer.id": { "name": "id", "signature": "StatusContainer.id" }, - "StatusContainer.image": { + "DeltaGenerator.image": { "name": "image", - "signature": "StatusContainer.image(image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", - "example": "
\n
\nimport streamlit as st\nfrom PIL import Image\n\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n
\n", - "description": "

Display an image or list of images.

\n", + "signature": "element.image(self, image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", + "example": "
\n
\nfrom PIL import Image\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an image or list of images.", "args": [ { "name": "image", @@ -10208,9 +9733,9 @@ }, { "name": "use_column_width", - "type_name": "\"auto\", \"always\", \"never\", or bool", + "type_name": "'auto' or 'always' or 'never' or bool", "is_optional": false, - "description": "

If "auto", set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf "always" or True, set the image's width to the column width.\nIf "never" or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", + "description": "

If 'auto', set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf 'always' or True, set the image's width to the column width.\nIf 'never' or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", "default": null }, { @@ -10222,55 +9747,59 @@ }, { "name": "channels", - "type_name": "\"RGB\" or \"BGR\"", + "type_name": "'RGB' or 'BGR'", "is_optional": false, - "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to "RGB", meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to "BGR", instead.

\n", + "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to 'RGB', meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to 'BGR', instead.

\n", "default": "s" }, { "name": "output_format", - "type_name": "\"JPEG\", \"PNG\", or \"auto\"", + "type_name": "'JPEG', 'PNG', or 'auto'", "is_optional": false, - "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to "auto" which identifies the compression type based\non the type and format of the image argument.

\n", + "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to 'auto' which identifies the compression type based\non the type and format of the image argument.

\n", "default": "s" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/image.py#L87" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/image.py#L60" }, - "StatusContainer.info": { + "DeltaGenerator.info": { "name": "info", - "signature": "StatusContainer.info(body, *, icon=None)", - "example": "
\n
\nimport streamlit as st\n\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", - "description": "

Display an informational message.

\n", + "signature": "element.info(self, body, *, icon=None)", + "example": "
\n
\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", + "description": "Display an informational message.", "args": [ + { + "name": "icon", + "type_name": "None", + "is_optional": false, + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" + }, { "name": "body", "type_name": "str", "is_optional": false, "description": "

The info text to display.

\n", "default": null - }, - { - "name": "icon", - "type_name": "str or None", - "is_optional": false, - "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", - "default": "None" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/alert.py#L91" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/alert.py#L96" }, - "StatusContainer.json": { + "DeltaGenerator.is_negative": { + "name": "is_negative", + "signature": "element.is_negative(delta)" + }, + "DeltaGenerator.json": { "name": "json", - "signature": "StatusContainer.json(body, *, expanded=True)", - "example": "
\n
\nimport streamlit as st\n\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n
\n", - "description": "

Display object or string as a pretty-printed JSON string.

\n", + "signature": "element.json(self, body, *, expanded=True)", + "example": "
\n
\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display object or string as a pretty-printed JSON string.", "args": [ { "name": "body", - "type_name": "object or str", + "type_name": "Object or str", "is_optional": false, "description": "

The object to print as JSON. All referenced objects should be\nserializable to JSON as well. If object is a string, we assume it\ncontains serialized JSON.

\n", "default": null @@ -10280,16 +9809,16 @@ "type_name": "bool", "is_optional": false, "description": "

An optional boolean that allows the user to set whether the initial\nstate of this json element should be expanded. Defaults to True.\nThis argument can only be supplied by keyword.

\n", - "default": "True." + "default": "True" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/json.py#L35" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/json.py#L28" }, - "StatusContainer.latex": { + "DeltaGenerator.latex": { "name": "latex", - "signature": "StatusContainer.latex(body, *, help=None)", - "example": "
\n
\nimport streamlit as st\n\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", + "signature": "element.latex(self, body)", + "example": "
\n
\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", "args": [ { @@ -10298,29 +9827,22 @@ "is_optional": false, "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", "default": null - }, - { - "name": "help", - "type_name": "str", - "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the LaTeX expression.

\n", - "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/markdown.py#L210" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/markdown.py#L236" }, - "StatusContainer.line_chart": { + "DeltaGenerator.line_chart": { "name": "line_chart", - "signature": "StatusContainer.line_chart(data=None, *, x=None, y=None, color=None, width=0, height=0, use_container_width=True)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\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 \n

You can also choose different columns to use for x and y, as well as set\nthe color dynamically based on a 3rd column (assuming your dataframe is in\nlong format):

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame({\n    'col1' : np.random.randn(20),\n    'col2' : np.random.randn(20),\n    'col3' : np.random.choice(['A','B','C'], 20)\n})\n\nst.line_chart(\n    chart_data,\n    x = 'col1',\n    y = 'col2',\n    color = 'col3'\n)\n
\n\n \n

Finally, if your dataframe is in wide format, you can group multiple\ncolumns under the y argument to show multiple lines with different\ncolors:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns = ['col1', 'col2', 'col3'])\n\nst.line_chart(\n    chart_data,\n    x = 'col1',\n    y = ['col2', 'col3'],\n    color = ['#FF0000', '#0000FF']  # Optional\n)\n
\n\n \n
\n", + "signature": "element.line_chart(self, data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\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 \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", "args": [ { "name": "data", - "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict or None", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict or None", "is_optional": false, - "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null }, { @@ -10337,13 +9859,6 @@ "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", "default": null }, - { - "name": "color", - "type_name": "str, tuple, sequence of str, sequence of tuple, or None", - "is_optional": false, - "description": "

The color to use for different lines in this chart. This argument\ncan only be supplied by keyword.

\n

For a line chart with just one line, this can be:

\n
    \n
  • None, to use the default color.
  • \n
  • A hex string like "#ffaa00" or "#ffaa0088".
  • \n
  • An RGB or RGBA tuple with the red, green, blue, and alpha\ncomponents specified as ints from 0 to 255 or floats from 0.0 to\n1.0.
  • \n
\n

For a line chart with multiple lines, where the dataframe is in\nlong format (that is, y is None or just one column), this can be:

\n
    \n
  • None, to use the default colors.

    \n
  • \n
  • The name of a column in the dataset. Data points will be grouped\ninto lines of the same color based on the value of this column.\nIn addition, if the values in this column match one of the color\nformats above (hex string or color tuple), then that color will\nbe used.

    \n

    For example: if the dataset has 1000 rows, but this column can\nonly contains the values "adult", "child", "baby", then\nthose 1000 datapoints will be grouped into three lines, whose\ncolors will be automatically selected from the default palette.

    \n

    But, if for the same 1000-row dataset, this column contained\nthe values "#ffaa00", "#f0f", "#0000ff", then then those 1000\ndatapoints would still be grouped into three lines, but their\ncolors would be "#ffaa00", "#f0f", "#0000ff" this time around.

    \n
  • \n
\n

For a line chart with multiple lines, where the dataframe is in\nwide format (that is, y is a sequence of columns), this can be:

\n
    \n
  • None, to use the default colors.
  • \n
  • A list of string colors or color tuples to be used for each of\nthe lines in the chart. This list should have the same length\nas the number of y values (e.g. color=["#fd0", "#f0f", "#04f"]\nfor three lines).
  • \n
\n", - "default": "color." - }, { "name": "width", "type_name": "int", @@ -10367,109 +9882,67 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L231" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/dataframe_selector.py#L132" }, - "StatusContainer.map": { + "DeltaGenerator.map": { "name": "map", - "signature": "StatusContainer.map(data=None, *, latitude=None, longitude=None, color=None, size=None, zoom=None, use_container_width=True)", - "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n

You can also customize the size and color of the datapoints:

\n
\nst.map(df, size=20, color='#0044ff')\n
\n

And finally, you can choose different columns to use for the latitude\nand longitude components, as well as set size and color of each\ndatapoint dynamically based on other columns:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame({\n    "col1": np.random.randn(1000) / 50 + 37.76,\n    "col2": np.random.randn(1000) / 50 + -122.4,\n    "col3": np.random.randn(1000) * 100,\n    "col4": np.random.rand(1000, 4).tolist(),\n})\n\nst.map(df,\n    latitude='col1',\n    longitude='col2',\n    size='col3',\n    color='col4')\n
\n\n \n
\n", - "description": "

Display a map with a scatterplot overlaid onto it.

\n

This is a wrapper around st.pydeck_chart to quickly create\nscatterplot charts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "signature": "element.map(self, data=None, zoom=None, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a map with points on it.

\n

This is a wrapper around st.pydeck_chart to quickly create scatterplot\ncharts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more\ninfo on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", "args": [ { "name": "data", - "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", - "is_optional": false, - "description": "

The data to be plotted.

\n", - "default": null - }, - { - "name": "latitude", - "type_name": "str or None", - "is_optional": false, - "description": "

The name of the column containing the latitude coordinates of\nthe datapoints in the chart. This argument can only be supplied\nby keyword.

\n

If None, the latitude data will come from any column named 'lat',\n'latitude', 'LAT', or 'LATITUDE'.

\n", - "default": null - }, - { - "name": "longitude", - "type_name": "str or None", + "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,", "is_optional": false, - "description": "

The name of the column containing the longitude coordinates of\nthe datapoints in the chart. This argument can only be supplied\nby keyword.

\n

If None, the longitude data will come from any column named 'lon',\n'longitude', 'LON', or 'LONGITUDE'.

\n", + "description": "

or None\nThe data to be plotted. Must have columns called 'lat', 'lon',\n'latitude', or 'longitude'.

\n", "default": null }, - { - "name": "color", - "type_name": "str or tuple or None", - "is_optional": false, - "description": "

The color of the circles representing each datapoint. This argument\ncan only be supplied by keyword.

\n

Can be:

\n
    \n
  • None, to use the default color.
  • \n
  • A hex string like "#ffaa00" or "#ffaa0088".
  • \n
  • An RGB or RGBA tuple with the red, green, blue, and alpha\ncomponents specified as ints from 0 to 255 or floats from 0.0 to\n1.0.
  • \n
  • The name of the column to use for the color. Cells in this column\nshould contain colors represented as a hex string or color tuple,\nas described above.
  • \n
\n", - "default": "color." - }, - { - "name": "size", - "type_name": "str or float or None", - "is_optional": false, - "description": "

The size of the circles representing each point, in meters. This\nargument can only be supplied by keyword.

\n

This can be:

\n
    \n
  • None, to use the default size.
  • \n
  • A number like 100, to specify a single size to use for all\ndatapoints.
  • \n
  • The name of the column to use for the size. This allows each\ndatapoint to be represented by a circle of a different size.
  • \n
\n", - "default": "size." - }, { "name": "zoom", "type_name": "int", "is_optional": false, - "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels.\nThis argument can only be supplied by keyword.

\n", - "default": null - }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/map.py#L91" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/map.py#L30" }, - "StatusContainer.markdown": { + "DeltaGenerator.markdown": { "name": "markdown", - "signature": "StatusContainer.markdown(body, unsafe_allow_html=False, *, help=None)", - "examples": "
\n
\nimport streamlit as st\n\nst.markdown("*Streamlit* is **really** ***cool***.")\nst.markdown('''\n    :red[Streamlit] :orange[can] :green[write] :blue[text] :violet[in]\n    :gray[pretty] :rainbow[colors].''')\nst.markdown("Here's a bouquet &mdash;\\\n            :tulip::cherry_blossom::rose::hibiscus::sunflower::blossom:")\n\nmulti = '''If you end a line with two spaces,\na soft return is used for the next line.\n\nTwo (or more) newline characters in a row will result in a hard return.\n'''\nst.markdown(multi)\n
\n\n \n
\n", - "description": "

Display string formatted as Markdown.

\n", + "signature": "element.markdown(self, body, unsafe_allow_html=False)", + "example": "
\n
\nst.markdown('Streamlit is **_really_ cool**.')\n
\n
\n", + "description": "Display string formatted as Markdown.", "args": [ { "name": "body", "type_name": "str", "is_optional": false, - "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n\n", "default": null }, { "name": "unsafe_allow_html", "type_name": "bool", "is_optional": false, - "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", - "default": null - }, - { - "name": "help", - "type_name": "str", - "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the Markdown.

\n", + "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n

Also note that ``unsafe_allow_html`` is a temporary measure and may\nbe removed from Streamlit at any time.

\n

If you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:

\n

https://discuss.streamlit.io/t/96

\n

This will help us come up with safe APIs that allow you to do what\nyou want.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/markdown.py#L31" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/markdown.py#L28" }, - "StatusContainer.metric": { + "DeltaGenerator.metric": { "name": "metric", - "signature": "StatusContainer.metric(label, value, delta=None, delta_color=\"normal\", help=None, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n

st.metric looks especially nice in combination with st.columns:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n

The delta indicator color can also be inverted or turned off:

\n
\nimport streamlit as st\n\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n
\n", + "signature": "element.metric(self, label, value, delta=None, delta_color=\"normal\", help=None)", + "example": "
\n
\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n \n (view standalone Streamlit app)\n \n

st.metric looks especially nice in combination with st.columns:

\n
\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n \n (view standalone Streamlit app)\n \n

The delta indicator color can also be inverted or turned off:

\n
\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

The header or title for the metric. The label can optionally contain\nMarkdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "description": "

The header or Title for the metric

\n", "default": null }, { @@ -10488,7 +9961,7 @@ }, { "name": "delta_color", - "type_name": "\"normal\", \"inverse\", or \"off\"", + "type_name": "str", "is_optional": false, "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", "default": null @@ -10499,29 +9972,22 @@ "is_optional": false, "description": "

An optional tooltip that gets displayed next to the metric label.

\n", "default": null - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/metric.py#L46" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/metric.py#L43" }, - "StatusContainer.multiselect": { + "DeltaGenerator.multiselect": { "name": "multiselect", - "signature": "StatusContainer.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, max_selections=None, placeholder=\"Choose an option\", disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n
\n", + "signature": "element.multiselect(self, label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this select widget is for.

\n", "default": null }, { @@ -10529,14 +9995,14 @@ "type_name": "Sequence[V], numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", "is_optional": false, "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", - "default": "." + "default": null }, { "name": "default", "type_name": "[V], V, or None", "is_optional": false, "description": "

List of default values. Can also be a single value.

\n", - "default": "values." + "default": "values" }, { "name": "format_func", @@ -10580,33 +10046,12 @@ "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, - { - "name": "max_selections", - "type_name": "int", - "is_optional": false, - "description": "

The max selections that can be selected at a time.\nThis argument can only be supplied by keyword.

\n", - "default": null - }, - { - "name": "placeholder", - "type_name": "str", - "is_optional": false, - "description": "

A string to display when no options are selected. Defaults to 'Choose an option'.

\n", - "default": "s" - }, { "name": "disabled", "type_name": "bool", "is_optional": false, "description": "

An optional boolean, which disables the multiselect widget if set\nto True. The default is False. This argument can only be supplied\nby keyword.

\n", - "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" + "default": "False" } ], "returns": [ @@ -10617,45 +10062,45 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/multiselect.py#L146" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/multiselect.py#L83" }, - "StatusContainer.number_input": { + "DeltaGenerator.number_input": { "name": "number_input", - "signature": "StatusContainer.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n
\n", - "description": "

Display a numeric input widget.

\n
\n

Note

\n

Integer values exceeding +/- (1<<53) - 1 cannot be accurately\nstored or returned by the widget due to serialization contstraints\nbetween the Python server and JavaScript client. You must handle\nsuch numbers as floats, leading to a loss in precision.

\n
\n", + "signature": "element.number_input(self, label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a numeric input widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this input is for.

\n", "default": null }, { "name": "min_value", - "type_name": "int, float, or None", + "type_name": "int or float or None", "is_optional": false, "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", "default": null }, { "name": "max_value", - "type_name": "int, float, or None", + "type_name": "int or float or None", "is_optional": false, "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", "default": null }, { "name": "value", - "type_name": "int, float, or None", + "type_name": "int or float or None", "is_optional": false, "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", "default": "min_value" }, { "name": "step", - "type_name": "int, float, or None", + "type_name": "int or float or None", "is_optional": false, "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", "default": "1" @@ -10707,14 +10152,7 @@ "type_name": "bool", "is_optional": false, "description": "

An optional boolean, which disables the number input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", - "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" + "default": "False" } ], "returns": [ @@ -10725,12 +10163,24 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/number_input.py#L67" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/number_input.py#L39" }, - "StatusContainer.plotly_chart": { + "DeltaGenerator.parse_delta": { + "name": "parse_delta", + "signature": "element.parse_delta(delta)" + }, + "DeltaGenerator.parse_label": { + "name": "parse_label", + "signature": "element.parse_label(label)" + }, + "DeltaGenerator.parse_value": { + "name": "parse_value", + "signature": "element.parse_value(value)" + }, + "DeltaGenerator.plotly_chart": { "name": "plotly_chart", - "signature": "StatusContainer.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", theme=\"streamlit\", **kwargs)", - "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport numpy as np\nimport plotly.figure_factory as ff\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n        hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n
\n", + "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)", + "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport plotly.figure_factory as ff\nimport numpy as np\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n        hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", "args": [ { @@ -10749,18 +10199,11 @@ }, { "name": "sharing", - "type_name": "\"streamlit\", \"private\", \"secret\", or \"public\"", + "type_name": "{'streamlit', 'private', 'secret', 'public'}", "is_optional": false, - "description": "

Use "streamlit" to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", + "description": "

Use 'streamlit' to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", "default": null }, - { - "name": "theme", - "type_name": "\"streamlit\" or None", - "is_optional": false, - "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", - "default": "behavior" - }, { "name": "**kwargs", "type_name": null, @@ -10770,13 +10213,13 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/plotly_chart.py#L81" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/plotly_chart.py#L67" }, - "StatusContainer.progress": { + "DeltaGenerator.progress": { "name": "progress", - "signature": "StatusContainer.progress(value, text=None)", - "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport streamlit as st\nimport time\n\nprogress_text = "Operation in progress. Please wait."\nmy_bar = st.progress(0, text=progress_text)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1, text=progress_text)\n
\n
\n", - "description": "

Display a progress bar.

\n", + "signature": "element.progress(self, value)", + "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport time\n\nmy_bar = st.progress(0)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1)\n
\n
\n", + "description": "Display a progress bar.", "args": [ { "name": "value", @@ -10784,48 +10227,34 @@ "is_optional": false, "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", "default": null - }, - { - "name": "text", - "type_name": "str or None", - "is_optional": false, - "description": "

A message to display above the progress bar. The text can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", - "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/progress.py#L66" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/progress.py#L31" }, - "StatusContainer.pydeck_chart": { + "DeltaGenerator.pydeck_chart": { "name": "pydeck_chart", - "signature": "StatusContainer.pydeck_chart(pydeck_obj=None, use_container_width=False)", - "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport pydeck as pdk\n\nchart_data = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=chart_data,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=chart_data,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", - "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)", + "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\ndf = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=df,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=df,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", + "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", "args": [ { - "name": "pydeck_obj", + "name": "spec", "type_name": "pydeck.Deck or None", "is_optional": false, "description": "

Object specifying the PyDeck chart to draw.

\n", "default": null - }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "", - "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/deck_gl_json_chart.py#L37" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/deck_gl_json_chart.py#L23" }, - "StatusContainer.pyplot": { + "DeltaGenerator.pyplot": { "name": "pyplot", - "signature": "StatusContainer.pyplot(fig=None, clear_figure=None, use_container_width=True, **kwargs)", + "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)", "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", - "example": "
\n
\nimport streamlit as st\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n
\n", - "description": "

Display a matplotlib.pyplot figure.

\n", + "example": "
\n
\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a matplotlib.pyplot figure.", "args": [ { "name": "fig", @@ -10841,13 +10270,6 @@ "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", "default": "based" }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "

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

\n", - "default": "s" - }, { "name": "**kwargs", "type_name": "any", @@ -10857,27 +10279,27 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/pyplot.py#L38" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/pyplot.py#L36" }, - "StatusContainer.radio": { + "DeltaGenerator.radio": { "name": "radio", - "signature": "StatusContainer.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, captions=None, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\ngenre = st.radio(\n    "What's your favorite movie genre",\n    [":rainbow[Comedy]", "***Drama***", "Documentary :movie_camera:"],\n    captions = ["Laugh out loud.", "Get the popcorn.", "Never stop learning."])\n\nif genre == ':rainbow[Comedy]':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn\\'t select comedy.")\n
\n\n \n
\n", - "description": "

Display a radio button widget.

\n", + "signature": "element.radio(self, label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False)", + "example": "
\n
\ngenre = st.radio(\n    "What's your favorite movie genre",\n    ('Comedy', 'Drama', 'Documentary'))\n\nif genre == 'Comedy':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn't select comedy.")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a radio button widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this radio group is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this radio group is for.

\n", "default": null }, { "name": "options", "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", "is_optional": false, - "description": "

Labels for the radio options. Labels can include markdown as\ndescribed in the label parameter and will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", - "default": "." + "description": "

Labels for the radio options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null }, { "name": "index", @@ -10933,7 +10355,7 @@ "type_name": "bool", "is_optional": false, "description": "

An optional boolean, which disables the radio button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", - "default": "False." + "default": "False" }, { "name": "horizontal", @@ -10941,20 +10363,6 @@ "is_optional": false, "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", "default": "false" - }, - { - "name": "captions", - "type_name": "iterable of str or None", - "is_optional": false, - "description": "

A list of captions to show below each radio button. If None (default),\nno captions are shown.

\n", - "default": null - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" } ], "returns": [ @@ -10965,19 +10373,19 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/radio.py#L76" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/radio.py#L35" }, - "StatusContainer.select_slider": { + "DeltaGenerator.select_slider": { "name": "select_slider", - "signature": "StatusContainer.select_slider(label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "examples": "
\nimport streamlit as st\n\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nimport streamlit as st\n\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n ", + "signature": "element.select_slider(self, label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "examples": "
\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n \n (view standalone Streamlit app)\n \n ", "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this slider is for.

\n", "default": null }, { @@ -10985,7 +10393,7 @@ "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", "is_optional": false, "description": "

Labels for the slider options. All options will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", - "default": "." + "default": null }, { "name": "value", @@ -11041,14 +10449,7 @@ "type_name": "bool", "is_optional": false, "description": "

An optional boolean, which disables the select slider if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", - "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" + "default": "False" } ], "returns": [ @@ -11059,19 +10460,19 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/select_slider.py#L107" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/select_slider.py#L35" }, - "StatusContainer.selectbox": { + "DeltaGenerator.selectbox": { "name": "selectbox", - "signature": "StatusContainer.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=\"Select...\", disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n
\n", - "description": "

Display a select widget.

\n", + "signature": "element.selectbox(self, label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a select widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this select widget is for.

\n", "default": null }, { @@ -11079,7 +10480,7 @@ "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", "is_optional": false, "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", - "default": "." + "default": null }, { "name": "index", @@ -11130,26 +10531,12 @@ "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, - { - "name": "placeholder", - "type_name": "str", - "is_optional": false, - "description": "

A string to display when no options are selected. Defaults to 'Select...'.

\n

A selectbox can't be empty, so a placeholder only displays while a\nuser's cursor is in a selectbox after manually deleting the current\nselection. A future update will allow selectboxes to be empty.

\n", - "default": "s" - }, { "name": "disabled", "type_name": "bool", "is_optional": false, "description": "

An optional boolean, which disables the selectbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", - "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" + "default": "False" } ], "returns": [ @@ -11160,19 +10547,19 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/selectbox.py#L72" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/selectbox.py#L35" }, - "StatusContainer.slider": { + "DeltaGenerator.slider": { "name": "slider", - "signature": "StatusContainer.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "examples": "
\n
\nimport streamlit as st\n\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nimport streamlit as st\n\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nimport streamlit as st\nfrom datetime import time\n\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nimport streamlit as st\nfrom datetime import datetime\n\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n
\n", - "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n
\n

Note

\n

Integer values exceeding +/- (1<<53) - 1 cannot be accurately\nstored or returned by the widget due to serialization contstraints\nbetween the Python server and JavaScript client. You must handle\nsuch numbers as floats, leading to a loss in precision.

\n
\n", + "signature": "element.slider(self, label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "examples": "
\n
\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nfrom datetime import time\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nfrom datetime import datetime\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this slider is for.

\n", "default": null }, { @@ -11194,11 +10581,11 @@ "type_name": "a supported type or a tuple/list of supported types or None", "is_optional": false, "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to min_value.

\n", - "default": "min_value." + "default": "min_value" }, { "name": "step", - "type_name": "int, float, timedelta, or None", + "type_name": "int/float/timedelta or None", "is_optional": false, "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", "default": "1" @@ -11250,14 +10637,7 @@ "type_name": "bool", "is_optional": false, "description": "

An optional boolean, which disables the slider if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", - "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" + "default": "False" } ], "returns": [ @@ -11268,146 +10648,94 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/slider.py#L173" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/slider.py#L38" }, - "StatusContainer.snow": { + "DeltaGenerator.snow": { "name": "snow", - "signature": "StatusContainer.snow()", - "example": "
\n
\nimport streamlit as st\n\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", - "description": "

Draw celebratory snowfall.

\n", + "signature": "element.snow(self)", + "example": "
\n
\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", + "description": "Draw celebratory snowfall.", "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/snow.py#L25" - }, - "StatusContainer.status": { - "name": "status", - "signature": "StatusContainer.status(label, *, expanded=False, state=\"running\")", - "examples": "
\n

You can use with notation to insert any element into an status container:

\n
\nimport time\nimport streamlit as st\n\nwith st.status("Downloading data..."):\n    st.write("Searching for data...")\n    time.sleep(2)\n    st.write("Found URL.")\n    time.sleep(1)\n    st.write("Downloading data...")\n    time.sleep(1)\n\nst.button('Rerun')\n
\n\n \n

You can also use .update() on the container to change the label, state,\nor expanded state:

\n
\nimport time\nimport streamlit as st\n\nwith st.status("Downloading data...", expanded=True) as status:\n    st.write("Searching for data...")\n    time.sleep(2)\n    st.write("Found URL.")\n    time.sleep(1)\n    st.write("Downloading data...")\n    time.sleep(1)\n    status.update(label="Download complete!", state="complete", expanded=False)\n\nst.button('Rerun')\n
\n\n \n
\n", - "description": "

Insert a status container to display output from long-running tasks.

\n

Inserts a container into your app that is typically used to show the status and\ndetails of a process or task. The container can hold multiple elements and can\nbe expanded or collapsed by the user similar to st.expander.\nWhen collapsed, all that is visible is the status icon and label.

\n

The label, state, and expanded state can all be updated by calling .update()\non the returned object. To add elements to the returned container, you can\nuse "with" notation (preferred) or just call methods directly on the returned\nobject.

\n

By default, st.status() initializes in the "running" state. When called using\n"with" notation, it automatically updates to the "complete" state at the end\nof the "with" block. See examples below for more details.

\n", - "args": [ - { - "name": "label", - "type_name": "str", - "is_optional": false, - "description": "

The initial label of the status container. The label can optionally\ncontain Markdown and supports the following elements: Bold,\nItalics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents)\nrender. Display unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", - "default": null - }, - { - "name": "expanded", - "type_name": "bool", - "is_optional": false, - "description": "

If True, initializes the status container in "expanded" state. Defaults to\nFalse (collapsed).

\n", - "default": "s" - }, - { - "name": "state", - "type_name": "\"running\", \"complete\", or \"error\"", - "is_optional": false, - "description": "

The initial state of the status container which determines which icon is\nshown:

\n
    \n
  • running (default): A spinner icon is shown.
  • \n
  • complete: A checkmark icon is shown.
  • \n
  • error: An error icon is shown.
  • \n
\n", - "default": null - } - ], - "returns": [ - { - "type_name": "StatusContainer", - "is_generator": false, - "description": "

A mutable status container that can hold multiple elements. The label, state,\nand expanded state can be updated after creation via .update().

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/layouts.py#L414" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/snow.py#L24" }, - "StatusContainer.subheader": { + "DeltaGenerator.subheader": { "name": "subheader", - "signature": "StatusContainer.subheader(body, anchor=None, *, help=None, divider=False)", - "examples": "
\n
\nimport streamlit as st\n\nst.subheader('This is a subheader with a divider', divider='rainbow')\nst.subheader('_Streamlit_ is :blue[cool] :sunglasses:')\n
\n\n \n
\n", - "description": "

Display text in subheader formatting.

\n", + "signature": "element.subheader(self, body, anchor=None)", + "example": "
\n
\nst.subheader('This is a subheader')\n
\n
\n", + "description": "Display text in subheader formatting.", "args": [ { "name": "body", "type_name": "str", "is_optional": false, - "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", + "description": "

The text to display.

\n", "default": null }, { "name": "anchor", - "type_name": "str or False", - "is_optional": false, - "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", - "default": null - }, - { - "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the subheader.

\n", - "default": null - }, - { - "name": "divider", - "type_name": "bool or \u201cblue\u201d, \u201cgreen\u201d, \u201corange\u201d, \u201cred\u201d, \u201cviolet\u201d, \u201cgray\u201d/\"grey\", or \u201crainbow\u201d", - "is_optional": false, - "description": "

Shows a colored divider below the header. If True, successive\nheaders will cycle through divider colors. That is, the first\nheader will have a blue line, the second header will have a\ngreen line, and so on. If a string, the color can be set to one of\nthe following: blue, green, orange, red, violet, gray/grey, or\nrainbow.

\n", + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/heading.py#L111" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/markdown.py#L106" }, - "StatusContainer.success": { + "DeltaGenerator.success": { "name": "success", - "signature": "StatusContainer.success(body, *, icon=None)", - "example": "
\n
\nimport streamlit as st\n\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", - "description": "

Display a success message.

\n", + "signature": "element.success(self, body, *, icon=None)", + "example": "
\n
\nst.success('This is a success message!', icon:"\u2705")\n
\n
\n", + "description": "Display a success message.", "args": [ + { + "name": "icon", + "type_name": "None", + "is_optional": false, + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" + }, { "name": "body", "type_name": "str", "is_optional": false, "description": "

The success text to display.

\n", "default": null - }, - { - "name": "icon", - "type_name": "str or None", - "is_optional": false, - "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", - "default": "None" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/alert.py#L124" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/alert.py#L126" }, - "StatusContainer.table": { + "DeltaGenerator.table": { "name": "table", - "signature": "StatusContainer.table(data=None)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n
\n", + "signature": "element.table(self, data=None)", + "example": "
\n
\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", "args": [ { "name": "data", - "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", "is_optional": false, - "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L193" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/dataframe_selector.py#L99" }, - "StatusContainer.tabs": { + "DeltaGenerator.tabs": { "name": "tabs", - "signature": "StatusContainer.tabs(tabs)", - "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\nimport streamlit as st\n\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n
\n", + "signature": "element.tabs(self, tabs)", + "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", "args": [ { "name": "tabs", "type_name": "list of strings", "is_optional": false, - "description": "

Creates a tab for each string in the list. The first tab is selected by default.\nThe string is used as the name of the tab and can optionally contain Markdown,\nsupporting the following elements: Bold, Italics, Strikethroughs, Inline Code,\nEmojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", - "default": "." + "description": "

Creates a tab for each string in the list. The string is used as the name of the tab.\nThe first tab is selected by default.

\n", + "default": null } ], "returns": [ @@ -11418,13 +10746,13 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/layouts.py#L207" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/layouts.py#L196" }, - "StatusContainer.text": { + "DeltaGenerator.text": { "name": "text", - "signature": "StatusContainer.text(body, *, help=None)", - "example": "
\n
\nimport streamlit as st\n\nst.text('This is some text.')\n
\n
\n", - "description": "

Write fixed-width and preformatted text.

\n", + "signature": "element.text(self, body)", + "example": "
\n
\nst.text('This is some text.')\n
\n
\n", + "description": "Write fixed-width and preformatted text.", "args": [ { "name": "body", @@ -11432,29 +10760,22 @@ "is_optional": false, "description": "

The string to display.

\n", "default": null - }, - { - "name": "help", - "type_name": "str", - "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the text.

\n", - "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/text.py#L27" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/text.py#L26" }, - "StatusContainer.text_area": { + "DeltaGenerator.text_area": { "name": "text_area", - "signature": "StatusContainer.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", - "description": "

Display a multi-line text input widget.

\n", + "signature": "element.text_area(self, label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False)", + "example": "
\n
\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", + "description": "Display a multi-line text input widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this input is for.

\n", "default": null }, { @@ -11525,14 +10846,7 @@ "type_name": "bool", "is_optional": false, "description": "

An optional boolean, which disables the text area if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", - "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" + "default": "False" } ], "returns": [ @@ -11543,19 +10857,19 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/text_widgets.py#L288" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/text_widgets.py#L201" }, - "StatusContainer.text_input": { + "DeltaGenerator.text_input": { "name": "text_input", - "signature": "StatusContainer.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n
\n", - "description": "

Display a single-line text input widget.

\n", + "signature": "element.text_input(self, label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False)", + "example": "
\n
\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a single-line text input widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this input is for.

\n", "default": null }, { @@ -11581,7 +10895,7 @@ }, { "name": "type", - "type_name": "\"default\" or \"password\"", + "type_name": "str", "is_optional": false, "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", "default": "s" @@ -11604,7 +10918,7 @@ "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this text input's value changes.

\n", + "description": "

An optional callback invoked when this text_input's value changes.

\n", "default": null }, { @@ -11633,14 +10947,7 @@ "type_name": "bool", "is_optional": false, "description": "

An optional boolean, which disables the text input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", - "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" + "default": "False" } ], "returns": [ @@ -11651,19 +10958,19 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/text_widgets.py#L72" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/text_widgets.py#L37" }, - "StatusContainer.time_input": { + "DeltaGenerator.time_input": { "name": "time_input", - "signature": "StatusContainer.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", step=0:15:00)", - "example": "
\n
\nimport datetime\nimport streamlit as st\n\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n
\n", - "description": "

Display a time input widget.

\n", + "signature": "element.time_input(self, label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a time input widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this time input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this time input is for.

\n", "default": null }, { @@ -11713,21 +11020,7 @@ "type_name": "bool", "is_optional": false, "description": "

An optional boolean, which disables the time input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", - "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" - }, - { - "name": "step", - "type_name": "int or timedelta", - "is_optional": false, - "description": "

The stepping interval in seconds. Defaults to 900, i.e. 15 minutes.\nYou can also pass a datetime.timedelta object.

\n", - "default": "900" + "default": "False" } ], "returns": [ @@ -11738,184 +11031,43 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/time_widgets.py#L219" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/time_widgets.py#L165" }, - "StatusContainer.title": { + "DeltaGenerator.title": { "name": "title", - "signature": "StatusContainer.title(body, anchor=None, *, help=None)", - "examples": "
\n
\nimport streamlit as st\n\nst.title('This is a title')\nst.title('_Streamlit_ is :blue[cool] :sunglasses:')\n
\n\n \n
\n", + "signature": "element.title(self, body, anchor=None)", + "example": "
\n
\nst.title('This is a title')\n
\n
\n", "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", "args": [ { "name": "body", "type_name": "str", "is_optional": false, - "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", + "description": "

The text to display.

\n", "default": null }, { "name": "anchor", - "type_name": "str or False", - "is_optional": false, - "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", - "default": null - }, - { - "name": "help", - "type_name": "str", - "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the title.

\n", - "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/heading.py#L181" - }, - "StatusContainer.toast": { - "name": "toast", - "signature": "StatusContainer.toast(body, *, icon=None)", - "example": "
\n
\nimport streamlit as st\n\nst.toast('Your edited image was saved!', icon='\ud83d\ude0d')\n
\n
\n", - "description": "

Display a short message, known as a notification "toast".

\n

The toast appears in the app's bottom-right corner and disappears after four seconds.

\n
\n

Warning

\n

st.toast is not compatible with Streamlit's caching and\ncannot be called within a cached function.

\n
\n", - "args": [ - { - "name": "body", - "type_name": "str", - "is_optional": false, - "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", - "default": null - }, - { - "name": "icon", - "type_name": "str or None", - "is_optional": false, - "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the toast. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", - "default": "None" - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/toast.py#L37" - }, - "StatusContainer.toggle": { - "name": "toggle", - "signature": "StatusContainer.toggle(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\non = st.toggle('Activate feature')\n\nif on:\n    st.write('Feature activated!')\n
\n\n \n
\n", - "description": "

Display a toggle widget.

\n", - "args": [ - { - "name": "label", - "type_name": "str", - "is_optional": false, - "description": "

A short label explaining to the user what this toggle is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", - "default": null - }, - { - "name": "value", - "type_name": "bool", - "is_optional": false, - "description": "

Preselect the toggle when it first renders. This will be\ncast to bool internally.

\n", - "default": null - }, - { - "name": "key", - "type_name": "str or int", - "is_optional": false, - "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", - "default": null - }, - { - "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the toggle.

\n", - "default": null - }, - { - "name": "on_change", - "type_name": "callable", - "is_optional": false, - "description": "

An optional callback invoked when this toggle's value changes.

\n", - "default": null - }, - { - "name": "args", - "type_name": "tuple", - "is_optional": false, - "description": "

An optional tuple of args to pass to the callback.

\n", - "default": null - }, - { - "name": "kwargs", - "type_name": "dict", - "is_optional": false, - "description": "

An optional dict of kwargs to pass to the callback.

\n", - "default": null - }, - { - "name": "disabled", - "type_name": "bool", - "is_optional": false, - "description": "

An optional boolean, which disables the toggle if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", - "default": "False." - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" - } - ], - "returns": [ - { - "type_name": "bool", - "is_generator": false, - "description": "

Whether or not the toggle is checked.

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/checkbox.py#L156" - }, - "StatusContainer.update": { - "name": "update", - "signature": "StatusContainer.update(*, label=None, expanded=None, state=None)", - "description": "

Update the status container.

\n

Only specified arguments are updated. Container contents and unspecified\narguments remain unchanged.

\n", - "args": [ - { - "name": "label", - "type_name": "str or None", - "is_optional": false, - "description": "

A new label of the status container. If None, the label is not\nchanged.

\n", - "default": null - }, - { - "name": "expanded", - "type_name": "bool or None", - "is_optional": false, - "description": "

The new expanded state of the status container. If None,\nthe expanded state is not changed.

\n", - "default": null - }, - { - "name": "state", - "type_name": "\"running\", \"complete\", \"error\", or None", - "is_optional": false, - "description": "

The new state of the status container. This mainly changes the\nicon. If None, the state is not changed.

\n", + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/lib/mutable_status_container.py#L95" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/markdown.py#L165" }, - "StatusContainer.vega_lite_chart": { + "DeltaGenerator.vega_lite_chart": { "name": "vega_lite_chart", - "signature": "StatusContainer.vega_lite_chart(data=None, spec=None, use_container_width=False, theme=\"streamlit\", **kwargs)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(chart_data, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", - "description": "

Display a chart using the Vega-Lite library.

\n", + "signature": "element.vega_lite_chart(self, data=None, spec=None, use_container_width=False, **kwargs)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(df, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", + "description": "Display a chart using the Vega-Lite library.", "args": [ { "name": "data", "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", "is_optional": false, - "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null }, { @@ -11932,13 +11084,6 @@ "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", "default": null }, - { - "name": "theme", - "type_name": "\"streamlit\" or None", - "is_optional": false, - "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", - "default": "behavior" - }, { "name": "**kwargs", "type_name": "any", @@ -11948,19 +11093,19 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L819" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/dataframe_selector.py#L425" }, - "StatusContainer.video": { + "DeltaGenerator.video": { "name": "video", - "signature": "StatusContainer.video(data, format=\"video/mp4\", start_time=0)", - "example": "
\n
\nimport streamlit as st\n\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", - "description": "

Display a video player.

\n", + "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)", + "example": "
\n
\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", + "description": "Display a video player.", "args": [ { "name": "data", - "type_name": "str, bytes, BytesIO, numpy.ndarray, or file", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", "is_optional": false, - "description": "

Raw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "description": "

io.open().\nRaw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", "default": null }, { @@ -11979,67 +11124,67 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/media.py#L115" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/media.py#L79" }, - "StatusContainer.warning": { + "DeltaGenerator.warning": { "name": "warning", - "signature": "StatusContainer.warning(body, *, icon=None)", - "example": "
\n
\nimport streamlit as st\n\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", - "description": "

Display warning message.

\n", + "signature": "element.warning(self, body, *, icon=None)", + "example": "
\n
\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", + "description": "Display warning message.", "args": [ + { + "name": "icon", + "type_name": "None", + "is_optional": false, + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" + }, { "name": "body", "type_name": "str", "is_optional": false, "description": "

The warning text to display.

\n", "default": null - }, - { - "name": "icon", - "type_name": "str or None", - "is_optional": false, - "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", - "default": "None" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/alert.py#L59" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/alert.py#L67" }, - "StatusContainer.write": { + "DeltaGenerator.write": { "name": "write", - "signature": "StatusContainer.write(*args, unsafe_allow_html=False, **kwargs)", - "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nimport streamlit as st\n\nst.write('Hello, *World!* :sunglasses:')\n
\n\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nimport streamlit as st\nimport pandas as pd\n\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nimport streamlit as st\n\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n
\n", + "signature": "element.write(self, *args, **kwargs)", + "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nwrite('Hello, *World!* :sunglasses:')\n
\n\n \n \n (view standalone Streamlit app)\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n \n (view standalone Streamlit app)\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n \n (view standalone Streamlit app)\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", "args": [ { "name": "*args", "type_name": "any", "is_optional": false, - "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression, emoji shortcodes, and colored text.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(class) : Displays information about a class.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", + "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression and emoji shortcodes.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", "default": null }, { "name": "unsafe_allow_html", "type_name": "bool", "is_optional": false, - "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", - "default": "False." + "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n

Also note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.

\n

If you decide to turn on HTML anyway, we ask you to please tell us your\nexact use case here:\nhttps://discuss.streamlit.io/t/96 .

\n

This will help us come up with safe APIs that allow you to do what you\nwant.

\n", + "default": "False" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/write.py#L49" + "source": "https://github.com/streamlit/streamlit/blob/1.12.0/lib/streamlit/elements/write.py#L43" } }, - "1.26.0": { + "1.13.0": { "streamlit.altair_chart": { "name": "altair_chart", - "signature": "st.altair_chart(altair_chart, use_container_width=False, theme=\"streamlit\")", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(chart_data).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n
\n", - "description": "

Display a chart using the Altair library.

\n", + "signature": "st.altair_chart(altair_chart, use_container_width=False)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a chart using the Altair library.", "args": [ { "name": "altair_chart", - "type_name": "altair.Chart", + "type_name": "altair.vegalite.v2.api.Chart", "is_optional": false, "description": "

The Altair chart object to display.

\n", "default": null @@ -12050,29 +11195,22 @@ "is_optional": false, "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", "default": null - }, - { - "name": "theme", - "type_name": "\"streamlit\" or None", - "is_optional": false, - "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", - "default": "behavior" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L766" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/dataframe_selector.py#L396" }, "streamlit.area_chart": { "name": "area_chart", - "signature": "st.area_chart(data=None, *, x=None, y=None, color=None, width=0, height=0, use_container_width=True)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns = ['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n

You can also choose different columns to use for x and y, as well as set\nthe color dynamically based on a 3rd column (assuming your dataframe is in\nlong format):

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame({\n    'col1' : np.random.randn(20),\n    'col2' : np.random.randn(20),\n    'col3' : np.random.choice(['A', 'B', 'C'], 20)\n})\n\nst.area_chart(\n    chart_data,\n    x = 'col1',\n    y = 'col2',\n    color = 'col3'\n)\n
\n\n \n

Finally, if your dataframe is in wide format, you can group multiple\ncolumns under the y argument to show multiple series with different\ncolors:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['col1', 'col2', 'col3'])\n\nst.area_chart(\n    chart_data,\n    x='col1',\n    y=['col2', 'col3'],\n    color=['#FF0000','#0000FF']  # Optional\n)\n
\n\n \n
\n", + "signature": "st.area_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", "args": [ { "name": "data", - "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, or dict", "is_optional": false, - "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null }, { @@ -12089,13 +11227,6 @@ "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", "default": null }, - { - "name": "color", - "type_name": "str, tuple, sequence of str, sequence of tuple, or None", - "is_optional": false, - "description": "

The color to use for different series in this chart. This argument\ncan only be supplied by keyword.

\n

For an area chart with just 1 series, this can be:

\n
    \n
  • None, to use the default color.
  • \n
  • A hex string like "#ffaa00" or "#ffaa0088".
  • \n
  • An RGB or RGBA tuple with the red, green, blue, and alpha\ncomponents specified as ints from 0 to 255 or floats from 0.0 to\n1.0.
  • \n
\n

For an area chart with multiple series, where the dataframe is in\nlong format (that is, y is None or just one column), this can be:

\n
    \n
  • None, to use the default colors.

    \n
  • \n
  • The name of a column in the dataset. Data points will be grouped\ninto series of the same color based on the value of this column.\nIn addition, if the values in this column match one of the color\nformats above (hex string or color tuple), then that color will\nbe used.

    \n

    For example: if the dataset has 1000 rows, but this column can\nonly contains the values "adult", "child", "baby",\nthen those 1000 datapoints will be grouped into 3 series, whose\ncolors will be automatically selected from the default palette.

    \n

    But, if for the same 1000-row dataset, this column contained\nthe values "#ffaa00", "#f0f", "#0000ff", then then those 1000\ndatapoints would still be grouped into 3 series, but their\ncolors would be "#ffaa00", "#f0f", "#0000ff" this time around.

    \n
  • \n
\n

For an area chart with multiple series, where the dataframe is in\nwide format (that is, y is a sequence of columns), this can be:

\n
    \n
  • None, to use the default colors.
  • \n
  • A list of string colors or color tuples to be used for each of\nthe series in the chart. This list should have the same length\nas the number of y values (e.g. color=["#fd0", "#f0f", "#04f"]\nfor three lines).
  • \n
\n", - "default": "color" - }, { "name": "width", "type_name": "int", @@ -12119,27 +11250,20 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L409" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/dataframe_selector.py#L229" }, "streamlit.audio": { "name": "audio", - "signature": "st.audio(data, format=\"audio/wav\", start_time=0, *, sample_rate=None)", - "example": "
\n
\nimport streamlit as st\nimport numpy as np\n\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n\nsample_rate = 44100  # 44100 samples per second\nseconds = 2  # Note duration of 2 seconds\nfrequency_la = 440  # Our played note will be 440 Hz\n# Generate array with seconds*sample_rate steps, ranging between 0 and seconds\nt = np.linspace(0, seconds, seconds * sample_rate, False)\n# Generate a 440 Hz sine wave\nnote_la = np.sin(frequency_la * t * 2 * np.pi)\n\nst.audio(note_la, sample_rate=sample_rate)\n
\n\n \n
\n", - "description": "

Display an audio player.

\n", + "signature": "st.audio(data, format=\"audio/wav\", start_time=0)", + "example": "
\n
\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an audio player.", "args": [ { "name": "data", - "type_name": "str, bytes, BytesIO, numpy.ndarray, or file", - "is_optional": false, - "description": "

Raw audio data, filename, or a URL pointing to the file to load.\nRaw data formats must include all necessary file headers to match the file\nformat specified via format.\nIf data is a numpy array, it must either be a 1D array of the waveform\nor a 2D array of shape (num_channels, num_samples) with waveforms\nfor all channels. See the default channel order at\nhttp://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx

\n", - "default": "channel" - }, - { - "name": "format", - "type_name": "str", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", "is_optional": false, - "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", - "default": "s" + "description": "

io.open().\nRaw audio data, filename, or a URL pointing to the file to load.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "default": null }, { "name": "start_time", @@ -12149,36 +11273,36 @@ "default": null }, { - "name": "sample_rate", - "type_name": "int or None", + "name": "format", + "type_name": "str", "is_optional": false, - "description": "

The sample rate of the audio data in samples per second. Only required if\ndata is a numpy array.

\n", - "default": null + "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/media.py#L42" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/media.py#L42" }, "streamlit.balloons": { "name": "balloons", "signature": "st.balloons()", - "example": "
\n
\nimport streamlit as st\n\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", - "description": "

Draw celebratory balloons.

\n", + "example": "
\n
\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", + "description": "Draw celebratory balloons.", "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/balloons.py#L25" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/balloons.py#L25" }, "streamlit.bar_chart": { "name": "bar_chart", - "signature": "st.bar_chart(data=None, *, x=None, y=None, color=None, width=0, height=0, use_container_width=True)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n

You can also choose different columns to use for x and y, as well as set\nthe color dynamically based on a 3rd column (assuming your dataframe is in\nlong format):

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame({\n    'col1' : np.random.randn(20),\n    'col2' : np.random.randn(20),\n    'col3' : np.random.choice(['A','B','C'],20)\n})\n\nst.bar_chart(\n    chart_data,\n    x='col1',\n    y='col2',\n    color='col3'\n)\n
\n\n \n

Finally, if your dataframe is in wide format, you can group multiple\ncolumns under the y argument to show multiple series with different\ncolors:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['col1', 'col2', 'col3'])\n\nst.bar_chart(\n    chart_data,\n    x='col1',\n    y=['col2', 'col3'],\n    color=['#FF0000','#0000FF']  # Optional\n)\n
\n\n \n
\n", + "signature": "st.bar_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nchart_data = pd.DataFrame(\n    np.random.randn(50, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", "args": [ { "name": "data", - "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, or dict", "is_optional": false, - "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null }, { @@ -12195,13 +11319,6 @@ "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", "default": null }, - { - "name": "color", - "type_name": "str, tuple, sequence of str, sequence of tuple, or None", - "is_optional": false, - "description": "

The color to use for different series in this chart. This argument\ncan only be supplied by keyword.

\n

For a bar chart with just 1 series, this can be:

\n
    \n
  • None, to use the default color.
  • \n
  • A hex string like "#ffaa00" or "#ffaa0088".
  • \n
  • An RGB or RGBA tuple with the red, green, blue, and alpha\ncomponents specified as ints from 0 to 255 or floats from 0.0 to\n1.0.
  • \n
\n

For a bar chart with multiple series, where the dataframe is in\nlong format (that is, y is None or just one column), this can be:

\n
    \n
  • None, to use the default colors.

    \n
  • \n
  • The name of a column in the dataset. Data points will be grouped\ninto series of the same color based on the value of this column.\nIn addition, if the values in this column match one of the color\nformats above (hex string or color tuple), then that color will\nbe used.

    \n

    For example: if the dataset has 1000 rows, but this column can\nonly contains the values "adult", "child", "baby",\nthen those 1000 datapoints will be grouped into 3 series, whose\ncolors will be automatically selected from the default palette.

    \n

    But, if for the same 1000-row dataset, this column contained\nthe values "#ffaa00", "#f0f", "#0000ff", then then those 1000\ndatapoints would still be grouped into 3 series, but their\ncolors would be "#ffaa00", "#f0f", "#0000ff" this time around.

    \n
  • \n
\n

For a bar chart with multiple series, where the dataframe is in\nwide format (that is, y is a sequence of columns), this can be:

\n
    \n
  • None, to use the default colors.
  • \n
  • A list of string colors or color tuples to be used for each of\nthe series in the chart. This list should have the same length\nas the number of y values (e.g. color=["#fd0", "#f0f", "#04f"]\nfor three lines).
  • \n
\n", - "default": "color" - }, { "name": "width", "type_name": "int", @@ -12225,12 +11342,76 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L587" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/dataframe_selector.py#L312" }, - "streamlit.bokeh_chart": { - "name": "bokeh_chart", - "signature": "st.bokeh_chart(figure, use_container_width=False)", - "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n
\n", + "streamlit.beta_columns": { + "name": "beta_columns", + "signature": "st.beta_columns(*args, **kwargs)", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put columns inside another column.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/beta_util.py#L43" + }, + "streamlit.beta_container": { + "name": "beta_container", + "signature": "st.beta_container(*args, **kwargs)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/beta_util.py#L43" + }, + "streamlit.beta_expander": { + "name": "beta_expander", + "signature": "st.beta_expander(*args, **kwargs)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write("""\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    """)\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write("""\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n""")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/beta_util.py#L43" + }, + "streamlit.bokeh_chart": { + "name": "bokeh_chart", + "signature": "st.bokeh_chart(figure, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", "args": [ { @@ -12249,19 +11430,19 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/bokeh_chart.py#L36" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/bokeh_chart.py#L34" }, "streamlit.button": { "name": "button", - "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", - "example": "
\n
\nimport streamlit as st\n\nst.button("Reset", type="primary")\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n
\n", - "description": "

Display a button widget.

\n", + "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a button widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "description": "

A short label explaining to the user what this button is for.

\n", "default": null }, { @@ -12299,26 +11480,12 @@ "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, - { - "name": "type", - "type_name": "\"secondary\" or \"primary\"", - "is_optional": false, - "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", - "default": "s" - }, { "name": "disabled", "type_name": "bool", "is_optional": false, "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", "default": "False" - }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", - "default": null } ], "returns": [ @@ -12329,13 +11496,13 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/button.py#L61" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/button.py#L62" }, "streamlit.cache": { "name": "cache", "signature": "st.cache(func=None, persist=False, allow_output_mutation=False, show_spinner=True, suppress_st_warning=False, hash_funcs=None, max_entries=None, ttl=None)", - "example": "
\n
\nimport streamlit as st\n\n@st.cache\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\n@st.cache(persist=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To disable hashing return values, set the allow_output_mutation parameter to True:

\n
\n@st.cache(allow_output_mutation=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. MongoClient) to a hash function (id) like this:

\n
\n@st.cache(hash_funcs={MongoClient: id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "pymongo.mongo_client.MongoClient") to the hash function instead:

\n
\n@st.cache(hash_funcs={"pymongo.mongo_client.MongoClient": id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n
\n", - "description": "

Function decorator to memoize function executions.

\n", + "example": "
\n
\n@st.cache\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\n@st.cache(persist=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To disable hashing return values, set the allow_output_mutation parameter to True:

\n
\n@st.cache(allow_output_mutation=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. MongoClient) to a hash function (id) like this:

\n
\n@st.cache(hash_funcs={MongoClient: id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "pymongo.mongo_client.MongoClient") to the hash function instead:

\n
\n@st.cache(hash_funcs={"pymongo.mongo_client.MongoClient": id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n
\n", + "description": "Function decorator to memoize function executions.", "args": [ { "name": "func", @@ -12369,7 +11536,7 @@ "name": "suppress_st_warning", "type_name": "boolean", "is_optional": false, - "description": "

Suppress warnings about calling Streamlit commands from within\nthe cached function.

\n", + "description": "

Suppress warnings about calling Streamlit functions from within\nthe cached function.

\n", "default": null }, { @@ -12395,137 +11562,19 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/runtime/legacy_caching/caching.py#L486" - }, - "streamlit.cache_data": { - "name": "cache_data", - "signature": "st.cache_data(func=None, *, ttl, max_entries, show_spinner, persist, experimental_allow_widgets, hash_funcs=None)", - "example": "
\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\nimport streamlit as st\n\n@st.cache_data(persist="disk")\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

By default, all parameters to a cached function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nconnection = make_database_connection()\nd1 = fetch_and_clean_data(connection, num_rows=10)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nanother_connection = make_database_connection()\nd2 = fetch_and_clean_data(another_connection, num_rows=10)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _database_connection parameter was different\n# in both calls.\n
\n

A cached function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nfetch_and_clean_data.clear()\n# Clear all cached entries for this function.\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. datetime.datetime) to a hash\nfunction (lambda dt: dt.isoformat()) like this:

\n
\nimport streamlit as st\nimport datetime\n\n@st.cache_data(hash_funcs={datetime.datetime: lambda dt: dt.isoformat()})\ndef convert_to_utc(dt: datetime.datetime):\n    return dt.astimezone(datetime.timezone.utc)\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "datetime.datetime") to the hash function instead:

\n
\nimport streamlit as st\nimport datetime\n\n@st.cache_data(hash_funcs={"datetime.datetime": lambda dt: dt.isoformat()})\ndef convert_to_utc(dt: datetime.datetime):\n    return dt.astimezone(datetime.timezone.utc)\n
\n
\n", - "description": "

Decorator to cache functions that return data (e.g. dataframe transforms, database queries, ML inference).

\n

Cached objects are stored in "pickled" form, which means that the return\nvalue of a cached function must be pickleable. Each caller of the cached\nfunction gets its own copy of the cached data.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_data.clear().

\n

To cache global resources, use st.cache_resource instead. Learn more\nabout caching at https://docs.streamlit.io/library/advanced-features/caching.

\n", - "args": [ - { - "name": "func", - "type_name": "callable", - "is_optional": false, - "description": "

The function to cache. Streamlit hashes the function's source code.

\n", - "default": null - }, - { - "name": "ttl", - "type_name": "float, timedelta, str, or None", - "is_optional": false, - "description": "

The maximum time to keep an entry in the cache. Can be one of:

\n\n

Note that ttl will be ignored if persist="disk" or persist=True.

\n", - "default": null - }, - { - "name": "max_entries", - "type_name": "int or None", - "is_optional": false, - "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. When a new entry is added to a full cache,\nthe oldest cached entry will be removed. Defaults to None.

\n", - "default": "None" - }, - { - "name": "show_spinner", - "type_name": "boolean or string", - "is_optional": false, - "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached data is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", - "default": "True" - }, - { - "name": "persist", - "type_name": "\"disk\", boolean, or None", - "is_optional": false, - "description": "

Optional location to persist cached data to. Passing "disk" (or True)\nwill persist the cached data to the local disk. None (or False) will disable\npersistence. The default is None.

\n", - "default": "None" - }, - { - "name": "experimental_allow_widgets", - "type_name": "boolean", - "is_optional": false, - "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", - "default": "False" - }, - { - "name": "hash_funcs", - "type_name": "dict or None", - "is_optional": false, - "description": "

Mapping of types or fully qualified names to hash functions.\nThis is used to override the behavior of the hasher inside Streamlit's\ncaching mechanism: when the hasher encounters an object, it will first\ncheck to see if its type matches a key in this dict and, if so, will use\nthe provided function to generate a hash for it. See below for an example\nof how this can be used.

\n", - "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/runtime/caching/cache_data_api.py#L384" - }, - "streamlit.cache_resource": { - "name": "cache_resource", - "signature": "st.cache_resource(func, *, ttl, max_entries, show_spinner, validate, experimental_allow_widgets, hash_funcs=None)", - "example": "
\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(url):\n    # Create a database session object that points to the URL.\n    return session\n\ns1 = get_database_session(SESSION_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(SESSION_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the connection object in s1 is the same as in s2.\n\ns3 = get_database_session(SESSION_URL_2)\n# This is a different URL, so the function executes.\n
\n

By default, all parameters to a cache_resource function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\ns1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _sessionmaker parameter was different\n# in both calls.\n
\n

A cache_resource function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\nget_database_session.clear()\n# Clear all cached entries for this function.\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. Person) to a hash\nfunction (str) like this:

\n
\nimport streamlit as st\nfrom pydantic import BaseModel\n\nclass Person(BaseModel):\n    name: str\n\n@st.cache_resource(hash_funcs={Person: str})\ndef get_person_name(person: Person):\n    return person.name\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "__main__.Person") to the hash function instead:

\n
\nimport streamlit as st\nfrom pydantic import BaseModel\n\nclass Person(BaseModel):\n    name: str\n\n@st.cache_resource(hash_funcs={"__main__.Person": str})\ndef get_person_name(person: Person):\n    return person.name\n
\n
\n", - "description": "

Decorator to cache functions that return global resources (e.g. database connections, ML models).

\n

Cached objects are shared across all users, sessions, and reruns. They\nmust be thread-safe because they can be accessed from multiple threads\nconcurrently. If thread safety is an issue, consider using st.session_state\nto store resources per session instead.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_resource.clear().

\n

To cache data, use st.cache_data instead. Learn more about caching at\nhttps://docs.streamlit.io/library/advanced-features/caching.

\n", - "args": [ - { - "name": "func", - "type_name": "callable", - "is_optional": false, - "description": "

The function that creates the cached resource. Streamlit hashes the\nfunction's source code.

\n", - "default": null - }, - { - "name": "ttl", - "type_name": "float, timedelta, str, or None", - "is_optional": false, - "description": "

The maximum time to keep an entry in the cache. Can be one of:

\n\n

Note that ttl will be ignored if persist="disk" or persist=True.

\n", - "default": null - }, - { - "name": "max_entries", - "type_name": "int or None", - "is_optional": false, - "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. When a new entry is added to a full cache,\nthe oldest cached entry will be removed. Defaults to None.

\n", - "default": "None" - }, - { - "name": "show_spinner", - "type_name": "boolean or string", - "is_optional": false, - "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached resource is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", - "default": "True" - }, - { - "name": "validate", - "type_name": "callable or None", - "is_optional": false, - "description": "

An optional validation function for cached data. validate is called\neach time the cached value is accessed. It receives the cached value as\nits only parameter and it must return a boolean. If validate returns\nFalse, the current cached value is discarded, and the decorated function\nis called to compute a new value. This is useful e.g. to check the\nhealth of database connections.

\n", - "default": null - }, - { - "name": "experimental_allow_widgets", - "type_name": "boolean", - "is_optional": false, - "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", - "default": "False" - }, - { - "name": "hash_funcs", - "type_name": "dict or None", - "is_optional": false, - "description": "

Mapping of types or fully qualified names to hash functions.\nThis is used to override the behavior of the hasher inside Streamlit's\ncaching mechanism: when the hasher encounters an object, it will first\ncheck to see if its type matches a key in this dict and, if so, will use\nthe provided function to generate a hash for it. See below for an example\nof how this can be used.

\n", - "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/runtime/caching/cache_resource_api.py#L264" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/runtime/legacy_caching/caching.py#L398" }, "streamlit.camera_input": { "name": "camera_input", "signature": "st.camera_input(label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", - "description": "

Display a widget that returns pictures from the user's webcam.

\n", + "description": "Display a widget that returns pictures from the user's webcam.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this widget is used for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this widget is used for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { @@ -12572,9 +11621,9 @@ }, { "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", "default": "is" } ], @@ -12586,147 +11635,43 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/camera_input.py#L78" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/camera_input.py#L122" }, "streamlit.caption": { "name": "caption", - "signature": "st.caption(body, unsafe_allow_html=False, *, help=None)", - "examples": "
\n
\nimport streamlit as st\n\nst.caption('This is a string that explains something above.')\nst.caption('A caption with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "signature": "st.caption(body, unsafe_allow_html=False)", + "example": "
\n
\nst.caption('This is a string that explains something above.')\n
\n
\n", "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", "args": [ { "name": "body", "type_name": "str", "is_optional": false, - "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", + "description": "

The text to display.

\n", "default": null }, { "name": "unsafe_allow_html", "type_name": "bool", "is_optional": false, - "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", - "default": null - }, - { - "name": "help", - "type_name": "str", - "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the caption.

\n", + "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n

Also note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.

\n

If you decide to turn on HTML anyway, we ask you to please tell us your\nexact use case here:\nhttps://discuss.streamlit.io/t/96 .

\n

This will help us come up with safe APIs that allow you to do what you\nwant.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/markdown.py#L146" - }, - "streamlit.chat_input": { - "name": "chat_input", - "signature": "st.chat_input(placeholder=\"Your message\", *, key=None, max_chars=None, disabled=False, on_submit=None, args=None, kwargs=None)", - "examples": "
\n
\nimport streamlit as st\n\nprompt = st.chat_input("Say something")\nif prompt:\n    st.write(f"User has sent the following prompt: {prompt}")\n
\n\n \n
\n", - "description": "

Display a chat input widget.

\n
\n

Warning

\n

Chat input can only be used once per app page and inside the main area of the app.\nIt cannot be used in the sidebar, columns, expanders, forms or tabs.\nWe plan to support this in the future.

\n
\n", - "args": [ - { - "name": "placeholder", - "type_name": "str", - "is_optional": false, - "description": "

A placeholder text shown when the chat input is empty. Defaults to\n"Your message". For accessibility reasons, you should not use an\nempty string.

\n", - "default": "s" - }, - { - "name": "key", - "type_name": "str or int", - "is_optional": false, - "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget based on\nits content. Multiple widgets of the same type may not share the same key.

\n", - "default": null - }, - { - "name": "max_chars", - "type_name": "int or None", - "is_optional": false, - "description": "

The maximum number of characters that can be entered. If None\n(default), there will be no maximum.

\n", - "default": null - }, - { - "name": "disabled", - "type_name": "bool", - "is_optional": false, - "description": "

Whether the chat input should be disabled. Defaults to False.

\n", - "default": "False" - }, - { - "name": "on_submit", - "type_name": "callable", - "is_optional": false, - "description": "

An optional callback invoked when the chat input's value is submitted.

\n", - "default": null - }, - { - "name": "args", - "type_name": "tuple", - "is_optional": false, - "description": "

An optional tuple of args to pass to the callback.

\n", - "default": null - }, - { - "name": "kwargs", - "type_name": "dict", - "is_optional": false, - "description": "

An optional dict of kwargs to pass to the callback.

\n", - "default": null - } - ], - "returns": [ - { - "type_name": "str or None", - "is_generator": false, - "description": "

The current (non-empty) value of the text input widget on the last\nrun of the app, None otherwise.

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/chat.py#L214" - }, - "streamlit.chat_message": { - "name": "chat_message", - "signature": "st.chat_message(name, *, avatar=None)", - "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\nimport numpy as np\n\nwith st.chat_message("user"):\n    st.write("Hello \ud83d\udc4b")\n    st.line_chart(np.random.randn(30, 3))\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\nmessage = st.chat_message("assistant")\nmessage.write("Hello human")\nmessage.bar_chart(np.random.randn(30, 3))\n
\n\n \n
\n", - "description": "

Insert a chat message container.

\n

To add elements to the returned container, you can use with notation\n(preferred) or just call methods directly on the returned object. See the\nexamples below.

\n", - "args": [ - { - "name": "name", - "type_name": "\"user\", \"assistant\", \"ai\", \"human\", or str", - "is_optional": false, - "description": "

The name of the message author. Can be "human"/"user" or\n"ai"/"assistant" to enable preset styling and avatars.

\n

Currently, the name is not shown in the UI but is only set as an\naccessibility label. For accessibility reasons, you should not use\nan empty string.

\n", - "default": null - }, - { - "name": "avatar", - "type_name": "str, numpy.ndarray, or BytesIO", - "is_optional": false, - "description": "

The avatar shown next to the message. Can be one of:

\n
    \n
  • A single emoji, e.g. "\ud83e\uddd1\u200d\ud83d\udcbb", "\ud83e\udd16", "\ud83e\udd96". Shortcodes are not supported.
  • \n
  • \n
    An image using one of the formats allowed for st.image: path of a local
    \n
    image file; URL to fetch the image from; array of shape (w,h) or (w,h,1)\nfor a monochrome image, (w,h,3) for a color image, or (w,h,4) for an RGBA image.
    \n
    \n
  • \n
\n

If None (default), uses default icons if name is "user",\n"assistant", "ai", "human" or the first letter of the name value.

\n", - "default": "icons" - } - ], - "returns": [ - { - "type_name": "Container", - "is_generator": false, - "description": "

A single container that can hold multiple elements.

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/chat.py#L121" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/markdown.py#L118" }, "streamlit.checkbox": { "name": "checkbox", - "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n
\n", - "description": "

Display a checkbox widget.

\n", + "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a checkbox widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this checkbox is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this checkbox is for.

\n", "default": null }, { @@ -12777,13 +11722,6 @@ "is_optional": false, "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", "default": "False" - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" } ], "returns": [ @@ -12794,13 +11732,13 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/checkbox.py#L53" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/checkbox.py#L50" }, "streamlit.code": { "name": "code", - "signature": "st.code(body, language=\"python\", line_numbers=False)", - "example": "
\n
\nimport streamlit as st\n\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", - "description": "

Display a code block with optional syntax highlighting.

\n", + "signature": "st.code(body, language=\"python\")", + "example": "
\n
\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", + "description": "

Display a code block with optional syntax highlighting.

\n

(This is a convenience wrapper around st.markdown())

\n", "args": [ { "name": "body", @@ -12815,29 +11753,22 @@ "is_optional": false, "description": "

The language that the code is written in, for syntax highlighting.\nIf None, the code will be unstyled. Defaults to "python".

\n

For a list of available language values, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", "default": "s" - }, - { - "name": "line_numbers", - "type_name": "bool", - "is_optional": false, - "description": "

An optional boolean indicating whether to show line numbers to the\nleft of the code block. Defaults to False.

\n", - "default": "s" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/code.py#L27" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/markdown.py#L85" }, "streamlit.color_picker": { "name": "color_picker", "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n
\n", - "description": "

Display a color picker widget.

\n", + "example": "
\n
\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a color picker widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this input is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { @@ -12891,7 +11822,7 @@ }, { "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", "is_optional": false, "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", "default": "is" @@ -12905,27 +11836,27 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/color_picker.py#L53" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/color_picker.py#L58" }, "streamlit.columns": { "name": "columns", "signature": "st.columns(spec, *, gap=\"small\")", - "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n
\n", - "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put columns inside another column.

\n
\n", "args": [ { "name": "spec", - "type_name": "int or iterable of numbers", + "type_name": "int or list of numbers", "is_optional": false, - "description": "

Controls the number and width of columns to insert. Can be one of:

\n
    \n
  • An integer that specifies the number of columns. All columns have equal\nwidth in this case.
  • \n
  • An iterable of numbers (int or float) that specify the relative width of\neach column. E.g. [0.7, 0.3] creates two columns where the first\none takes up 70% of the available with and the second one takes up 30%.\nOr [1, 2, 3] creates three columns where the second one is two times\nthe width of the first one, and the third one is three times that width.
  • \n
\n", + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", "default": null }, { "name": "gap", - "type_name": "\"small\", \"medium\", or \"large\"", + "type_name": "string (\"small\", \"medium\", or \"large\")", "is_optional": false, - "description": "

The size of the gap between the columns. Defaults to "small". This\nargument can only be supplied by keyword.

\n", - "default": "s" + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" } ], "returns": [ @@ -12936,136 +11867,28 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/layouts.py#L79" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/layouts.py#L74" }, "streamlit.container": { "name": "container", "signature": "st.container()", - "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n
\n", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/layouts.py#L31" - }, - "streamlit.data_editor": { - "name": "data_editor", - "signature": "st.data_editor(data, *, width=None, height=None, use_container_width=False, hide_index=None, column_order=None, column_config=None, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", - "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

Or you can customize the data editor via column_config, hide_index, column_order, or disabled:

\n
\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    [\n        {"command": "st.selectbox", "rating": 4, "is_widget": True},\n        {"command": "st.balloons", "rating": 5, "is_widget": False},\n        {"command": "st.time_input", "rating": 3, "is_widget": True},\n    ]\n)\nedited_df = st.data_editor(\n    df,\n    column_config={\n        "command": "Streamlit Command",\n        "rating": st.column_config.NumberColumn(\n            "Your rating",\n            help="How much do you like this command (1-5)?",\n            min_value=1,\n            max_value=5,\n            step=1,\n            format="%d \u2b50",\n        ),\n        "is_widget": "Widget ?",\n    },\n    disabled=["command", "is_widget"],\n    hide_index=True,\n)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n
\n", - "description": "

Display a data editor widget.

\n

The data editor widget allows you to edit dataframes and many other data structures in a table-like UI.

\n
\n

Warning

\n

When going from st.experimental_data_editor to st.data_editor in\n1.23.0, the data editor's representation in st.session_state was changed.\nThe edited_cells dictionary is now called edited_rows and uses a\ndifferent format ({0: {"column name": "edited value"}} instead of\n{"0:1": "edited value"}). You may need to adjust the code if your app uses\nst.experimental_data_editor in combination with st.session_state."

\n
\n", - "args": [ - { - "name": "data", - "type_name": "pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None", - "is_optional": false, - "description": "

The data to edit in the data editor.

\n
\n

Note

\n
    \n
  • Styles from pandas.Styler will only be applied to non-editable columns.
  • \n
  • Mixing data types within a column can make the column uneditable.
  • \n
  • Additionally, the following data types are not yet supported for editing:\ncomplex, list, tuple, bytes, bytearray, memoryview, dict, set, frozenset,\ndatetime.timedelta, decimal.Decimal, fractions.Fraction, pandas.Interval,\npandas.Period, pandas.Timedelta.
  • \n
\n
\n", - "default": null - }, - { - "name": "width", - "type_name": "int or None", - "is_optional": false, - "description": "

Desired width of the data editor expressed in pixels. If None, the width will\nbe automatically determined.

\n", - "default": null - }, - { - "name": "height", - "type_name": "int or None", - "is_optional": false, - "description": "

Desired height of the data editor expressed in pixels. If None, the height will\nbe automatically determined.

\n", - "default": null - }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "

If True, set the data editor width to the width of the parent container.\nThis takes precedence over the width argument. Defaults to False.

\n", - "default": "False" - }, - { - "name": "hide_index", - "type_name": "bool or None", - "is_optional": false, - "description": "

Whether to hide the index column(s). If None (default), the visibility of\nindex columns is automatically determined based on the data.

\n", - "default": null - }, - { - "name": "column_order", - "type_name": "iterable of str or None", - "is_optional": false, - "description": "

Specifies the display order of columns. This also affects which columns are\nvisible. For example, column_order=("col2", "col1") will display 'col2'\nfirst, followed by 'col1', and will hide all other non-index columns. If\nNone (default), the order is inherited from the original data structure.

\n", - "default": null - }, - { - "name": "column_config", - "type_name": "dict or None", - "is_optional": false, - "description": "

Configures how columns are displayed, e.g. their title, visibility, type, or\nformat, as well as editing properties such as min/max value or step.\nThis needs to be a dictionary where each key is a column name and the value\nis one of:

\n
    \n
  • None to hide the column.
  • \n
  • A string to set the display label of the column.
  • \n
  • One of the column types defined under st.column_config, e.g.\nst.column_config.NumberColumn("Dollar values\u201d, format=\u201d$ %d") to show\na column as dollar amounts. See more info on the available column types\nand config options here.
  • \n
\n

To configure the index column(s), use _index as the column name.

\n", - "default": null - }, - { - "name": "num_rows", - "type_name": "\"fixed\" or \"dynamic\"", - "is_optional": false, - "description": "

Specifies if the user can add and delete rows in the data editor.\nIf "fixed", the user cannot add or delete rows. If "dynamic", the user can\nadd and delete rows in the data editor, but column sorting is disabled.\nDefaults to "fixed".

\n", - "default": "s" - }, - { - "name": "disabled", - "type_name": "bool or iterable of str", - "is_optional": false, - "description": "

Controls the editing of columns. If True, editing is disabled for all columns.\nIf an iterable of column names is provided (e.g., disabled=("col1", "col2")),\nonly the specified columns will be disabled for editing. If False (default),\nall columns that support editing are editable.

\n", - "default": null - }, - { - "name": "key", - "type_name": "str", - "is_optional": false, - "description": "

An optional string to use as the unique key for this widget. If this\nis omitted, a key will be generated for the widget based on its\ncontent. Multiple widgets of the same type may not share the same\nkey.

\n", - "default": null - }, - { - "name": "on_change", - "type_name": "callable", - "is_optional": false, - "description": "

An optional callback invoked when this data_editor's value changes.

\n", - "default": null - }, - { - "name": "args", - "type_name": "tuple", - "is_optional": false, - "description": "

An optional tuple of args to pass to the callback.

\n", - "default": null - }, - { - "name": "kwargs", - "type_name": "dict", - "is_optional": false, - "description": "

An optional dict of kwargs to pass to the callback.

\n", - "default": null - } - ], - "returns": [ - { - "type_name": "pandas.DataFrame, pandas.Series, pyarrow.Table, numpy.ndarray, list, set, tuple, or dict.", - "is_generator": false, - "description": "

The edited data. The edited data is returned in its original data type if\nit corresponds to any of the supported return types. All other data types\nare returned as a pd.DataFrame.

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/data_editor.py#L529" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/layouts.py#L29" }, "streamlit.dataframe": { "name": "dataframe", - "signature": "st.dataframe(data=None, width=None, height=None, *, use_container_width=False, hide_index=None, column_order=None, column_config=None)", - "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n

Or you can customize the dataframe via column_config, hide_index, or column_order:

\n
\nimport random\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    {\n        "name": ["Roadmap", "Extras", "Issues"],\n        "url": ["https://roadmap.streamlit.app", "https://extras.streamlit.app", "https://issues.streamlit.app"],\n        "stars": [random.randint(0, 1000) for _ in range(3)],\n        "views_history": [[random.randint(0, 5000) for _ in range(30)] for _ in range(3)],\n    }\n)\nst.dataframe(\n    df,\n    column_config={\n        "name": "App name",\n        "stars": st.column_config.NumberColumn(\n            "Github Stars",\n            help="Number of stars on GitHub",\n            format="%d \u2b50",\n        ),\n        "url": st.column_config.LinkColumn("App URL"),\n        "views_history": st.column_config.LineChartColumn(\n            "Views (past 30 days)", y_min=0, y_max=5000\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Display a dataframe as an interactive table.

\n

This command works with dataframes from Pandas, PyArrow, Snowpark, and PySpark.\nIt can also display several other types that can be converted to dataframes,\ne.g. numpy arrays, lists, sets and dictionaries.

\n", + "signature": "st.dataframe(data=None, width=None, height=None, *, use_container_width=False)", + "examples": "
\n
\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\nst.dataframe(df, 200, 100)\n
\n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a dataframe as an interactive table.", "args": [ { "name": "data", - "type_name": "pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", "is_optional": false, - "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.

\n", + "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. (It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.)\nStyler support is experimental!\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null }, { @@ -13088,43 +11911,22 @@ "is_optional": false, "description": "

If True, set the dataframe width to the width of the parent container.\nThis takes precedence over the width argument.\nThis argument can only be supplied by keyword.

\n", "default": null - }, - { - "name": "hide_index", - "type_name": "bool or None", - "is_optional": false, - "description": "

Whether to hide the index column(s). If None (default), the visibility of\nindex columns is automatically determined based on the data.

\n", - "default": null - }, - { - "name": "column_order", - "type_name": "iterable of str or None", - "is_optional": false, - "description": "

Specifies the display order of columns. This also affects which columns are\nvisible. For example, column_order=("col2", "col1") will display 'col2'\nfirst, followed by 'col1', and will hide all other non-index columns. If\nNone (default), the order is inherited from the original data structure.

\n", - "default": null - }, - { - "name": "column_config", - "type_name": "dict or None", - "is_optional": false, - "description": "

Configures how columns are displayed, e.g. their title, visibility, type, or\nformat. This needs to be a dictionary where each key is a column name and\nthe value is one of:

\n
    \n
  • None to hide the column.
  • \n
  • A string to set the display label of the column.
  • \n
  • One of the column types defined under st.column_config, e.g.\nst.column_config.NumberColumn("Dollar values\u201d, format=\u201d$ %d") to show\na column as dollar amounts. See more info on the available column types\nand config options here.
  • \n
\n

To configure the index column(s), use _index as the column name.

\n", - "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L44" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/dataframe_selector.py#L38" }, "streamlit.date_input": { "name": "date_input", - "signature": "st.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, format=\"YYYY/MM/DD\", disabled=False, label_visibility=\"visible\")", - "examples": "
\n
\nimport datetime\nimport streamlit as st\n\nd = st.date_input("When's your birthday", datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n
\nimport datetime\nimport streamlit as st\n\ntoday = datetime.datetime.now()\nnext_year = today.year + 1\njan_1 = datetime.date(next_year, 1, 1)\ndec_31 = datetime.date(next_year, 12, 31)\n\nd = st.date_input(\n    "Select your vacation for next year",\n    (jan_1, datetime.date(next_year, 1, 7)),\n    jan_1,\n    dec_31,\n    format="MM.DD.YYYY",\n)\nd\n
\n\n \n
\n", - "description": "

Display a date input widget.

\n", + "signature": "st.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nd = st.date_input(\n    "When's your birthday",\n    datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a date input widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this date input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this date input is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { @@ -13183,13 +11985,6 @@ "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, - { - "name": "format", - "type_name": "str", - "is_optional": false, - "description": "

A format string controlling how the interface should display dates.\nSupports \u201cYYYY/MM/DD\u201d (default), \u201cDD/MM/YYYY\u201d, or \u201cMM/DD/YYYY\u201d.\nYou may also use a period (.) or hyphen (-) as separators.

\n", - "default": null - }, { "name": "disabled", "type_name": "bool", @@ -13199,9 +11994,9 @@ }, { "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", "default": "is" } ], @@ -13213,28 +12008,19 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/time_widgets.py#L415" - }, - "streamlit.divider": { - "name": "divider", - "signature": "st.divider()", - "example": "
\n
\nimport streamlit as st\n\nst.divider()\n
\n
\n", - "description": "

Display a horizontal rule.

\n
\n

Note

\n

You can achieve the same effect with st.write("---") or\neven just "---" in your script (via magic).

\n
\n", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/markdown.py#L258" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/time_widgets.py#L362" }, "streamlit.download_button": { "name": "download_button", - "signature": "st.download_button(label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", - "examples": "
\n

Download a large DataFrame as a CSV:

\n
\nimport streamlit as st\n\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\nimport streamlit as st\n\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nimport streamlit as st\n\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nimport streamlit as st\n\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n
\n", + "signature": "st.download_button(label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False)", + "examples": "
\n

Download a large DataFrame as a CSV:

\n
\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "description": "

A short label explaining to the user what this button is for.

\n", "default": null }, { @@ -13293,26 +12079,12 @@ "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, - { - "name": "type", - "type_name": "\"secondary\" or \"primary\"", - "is_optional": false, - "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", - "default": "s" - }, { "name": "disabled", "type_name": "bool", "is_optional": false, "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", "default": "False" - }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", - "default": null } ], "returns": [ @@ -13323,13 +12095,13 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/button.py#L170" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/button.py#L130" }, "streamlit.echo": { "name": "echo", "signature": "st.echo(code_location=\"above\")", - "example": "
\n
\nimport streamlit as st\n\nwith st.echo():\n    st.write('This code will be printed')\n
\n
\n", - "description": "

Use in a with block to draw some code on the app, then execute it.

\n", + "example": "
\n
\nwith st.echo():\n    st.write('This code will be printed')\n
\n
\n", + "description": "Use in a `with` block to draw some code on the app, then execute it.", "args": [ { "name": "code_location", @@ -13340,46 +12112,46 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/echo.py#L28" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/echo.py#L27" }, "streamlit.empty": { "name": "empty", "signature": "st.empty()", - "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport streamlit as st\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nimport streamlit as st\n\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", + "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/empty.py#L24" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/empty.py#L24" }, "streamlit.error": { "name": "error", "signature": "st.error(body, *, icon=None)", - "example": "
\n
\nimport streamlit as st\n\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", - "description": "

Display error message.

\n", + "example": "
\n
\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", + "description": "Display error message.", "args": [ + { + "name": "icon", + "type_name": "None", + "is_optional": false, + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" + }, { "name": "body", "type_name": "str", "is_optional": false, "description": "

The error text to display.

\n", "default": null - }, - { - "name": "icon", - "type_name": "str or None", - "is_optional": false, - "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", - "default": "None" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/alert.py#L27" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/alert.py#L39" }, "streamlit.exception": { "name": "exception", "signature": "st.exception(exception)", - "example": "
\n
\nimport streamlit as st\n\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", - "description": "

Display an exception.

\n", + "example": "
\n
\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", + "description": "Display an exception.", "args": [ { "name": "exception", @@ -13390,19 +12162,19 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/exception.py#L50" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/exception.py#L47" }, "streamlit.expander": { "name": "expander", "signature": "st.expander(label, expanded=False)", - "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n
\n", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write("""\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    """)\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write("""\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n""")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "description": "

A string to use as the header for the expander.

\n", "default": null }, { @@ -13414,173 +12186,13 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/layouts.py#L319" - }, - "streamlit.experimental_connection": { - "name": "experimental_connection", - "signature": "st.experimental_connection(name, type=None, max_entries=None, ttl=None, **kwargs)", - "examples": "
\n

The easiest way to create a first-party (SQL or Snowpark) connection is to use their\ndefault names and define corresponding sections in your secrets.toml file.

\n
\nimport streamlit as st\nconn = st.experimental_connection("sql") # Config section defined in [connections.sql] in secrets.toml.\n
\n

Creating a SQLConnection with a custom name requires you to explicitly specify the\ntype. If type is not passed as a kwarg, it must be set in the appropriate section of\nsecrets.toml.

\n
\nimport streamlit as st\nconn1 = st.experimental_connection("my_sql_connection", type="sql") # Config section defined in [connections.my_sql_connection].\nconn2 = st.experimental_connection("my_other_sql_connection") # type must be set in [connections.my_other_sql_connection].\n
\n

Passing the full module path to the connection class that you want to use can be\nuseful, especially when working with a custom connection:

\n
\nimport streamlit as st\nconn = st.experimental_connection("my_sql_connection", type="streamlit.connections.SQLConnection")\n
\n

Finally, you can pass the connection class to use directly to this function. Doing\nso allows static type checking tools such as mypy to infer the exact return\ntype of st.experimental_connection.

\n
\nimport streamlit as st\nfrom streamlit.connections import SQLConnection\nconn = st.experimental_connection("my_sql_connection", type=SQLConnection)\n
\n
\n", - "description": "

Create a new connection to a data store or API, or return an existing one.

\n

Config options, credentials, secrets, etc. for connections are taken from various\nsources:

\n
    \n
  • Any connection-specific configuration files.
  • \n
  • An app's secrets.toml files.
  • \n
  • The kwargs passed to this function.
  • \n
\n", - "args": [ - { - "name": "name", - "type_name": "str", - "is_optional": false, - "description": "

The connection name used for secrets lookup in [connections.<name>].\nType will be inferred from passing "sql" or "snowpark".

\n", - "default": null - }, - { - "name": "type", - "type_name": "str, connection class, or None", - "is_optional": false, - "description": "

The type of connection to create. It can be a keyword ("sql" or "snowpark"),\na path to an importable class, or an imported class reference. All classes\nmust extend st.connections.ExperimentalBaseConnection and implement the\n_connect() method. If the type kwarg is None, a type field must be set\nin the connection's section in secrets.toml.

\n", - "default": null - }, - { - "name": "max_entries", - "type_name": "int or None", - "is_optional": false, - "description": "

The maximum number of connections to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", - "default": "None" - }, - { - "name": "ttl", - "type_name": "float, timedelta, or None", - "is_optional": false, - "description": "

The maximum number of seconds to keep results in the cache, or\nNone if cached results should not expire. The default is None.

\n", - "default": "None" - }, - { - "name": "**kwargs", - "type_name": "any", - "is_optional": false, - "description": "

Additional connection specific kwargs that are passed to the Connection's\n_connect() method. Learn more from the specific Connection's documentation.

\n", - "default": null - } - ], - "returns": [ - { - "type_name": "Connection object", - "is_generator": false, - "description": "

An initialized Connection object of the specified type.

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/runtime/connection_factory.py#L170" - }, - "streamlit.experimental_data_editor": { - "name": "experimental_data_editor", - "signature": "st.experimental_data_editor(data, *, width=None, height=None, use_container_width=False, hide_index=None, column_order=None, column_config=None, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", - "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

Or you can customize the data editor via column_config, hide_index, column_order, or disabled:

\n
\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    [\n        {"command": "st.selectbox", "rating": 4, "is_widget": True},\n        {"command": "st.balloons", "rating": 5, "is_widget": False},\n        {"command": "st.time_input", "rating": 3, "is_widget": True},\n    ]\n)\nedited_df = st.data_editor(\n    df,\n    column_config={\n        "command": "Streamlit Command",\n        "rating": st.column_config.NumberColumn(\n            "Your rating",\n            help="How much do you like this command (1-5)?",\n            min_value=1,\n            max_value=5,\n            step=1,\n            format="%d \u2b50",\n        ),\n        "is_widget": "Widget ?",\n    },\n    disabled=["command", "is_widget"],\n    hide_index=True,\n)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n
\n", - "description": "

Display a data editor widget.

\n

The data editor widget allows you to edit dataframes and many other data structures in a table-like UI.

\n
\n

Warning

\n

When going from st.experimental_data_editor to st.data_editor in\n1.23.0, the data editor's representation in st.session_state was changed.\nThe edited_cells dictionary is now called edited_rows and uses a\ndifferent format ({0: {"column name": "edited value"}} instead of\n{"0:1": "edited value"}). You may need to adjust the code if your app uses\nst.experimental_data_editor in combination with st.session_state."

\n
\n", - "args": [ - { - "name": "data", - "type_name": "pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None", - "is_optional": false, - "description": "

The data to edit in the data editor.

\n
\n

Note

\n
    \n
  • Styles from pandas.Styler will only be applied to non-editable columns.
  • \n
  • Mixing data types within a column can make the column uneditable.
  • \n
  • Additionally, the following data types are not yet supported for editing:\ncomplex, list, tuple, bytes, bytearray, memoryview, dict, set, frozenset,\ndatetime.timedelta, decimal.Decimal, fractions.Fraction, pandas.Interval,\npandas.Period, pandas.Timedelta.
  • \n
\n
\n", - "default": null - }, - { - "name": "width", - "type_name": "int or None", - "is_optional": false, - "description": "

Desired width of the data editor expressed in pixels. If None, the width will\nbe automatically determined.

\n", - "default": null - }, - { - "name": "height", - "type_name": "int or None", - "is_optional": false, - "description": "

Desired height of the data editor expressed in pixels. If None, the height will\nbe automatically determined.

\n", - "default": null - }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "

If True, set the data editor width to the width of the parent container.\nThis takes precedence over the width argument. Defaults to False.

\n", - "default": "False" - }, - { - "name": "hide_index", - "type_name": "bool or None", - "is_optional": false, - "description": "

Whether to hide the index column(s). If None (default), the visibility of\nindex columns is automatically determined based on the data.

\n", - "default": null - }, - { - "name": "column_order", - "type_name": "iterable of str or None", - "is_optional": false, - "description": "

Specifies the display order of columns. This also affects which columns are\nvisible. For example, column_order=("col2", "col1") will display 'col2'\nfirst, followed by 'col1', and will hide all other non-index columns. If\nNone (default), the order is inherited from the original data structure.

\n", - "default": null - }, - { - "name": "column_config", - "type_name": "dict or None", - "is_optional": false, - "description": "

Configures how columns are displayed, e.g. their title, visibility, type, or\nformat, as well as editing properties such as min/max value or step.\nThis needs to be a dictionary where each key is a column name and the value\nis one of:

\n
    \n
  • None to hide the column.
  • \n
  • A string to set the display label of the column.
  • \n
  • One of the column types defined under st.column_config, e.g.\nst.column_config.NumberColumn("Dollar values\u201d, format=\u201d$ %d") to show\na column as dollar amounts. See more info on the available column types\nand config options here.
  • \n
\n

To configure the index column(s), use _index as the column name.

\n", - "default": null - }, - { - "name": "num_rows", - "type_name": "\"fixed\" or \"dynamic\"", - "is_optional": false, - "description": "

Specifies if the user can add and delete rows in the data editor.\nIf "fixed", the user cannot add or delete rows. If "dynamic", the user can\nadd and delete rows in the data editor, but column sorting is disabled.\nDefaults to "fixed".

\n", - "default": "s" - }, - { - "name": "disabled", - "type_name": "bool or iterable of str", - "is_optional": false, - "description": "

Controls the editing of columns. If True, editing is disabled for all columns.\nIf an iterable of column names is provided (e.g., disabled=("col1", "col2")),\nonly the specified columns will be disabled for editing. If False (default),\nall columns that support editing are editable.

\n", - "default": null - }, - { - "name": "key", - "type_name": "str", - "is_optional": false, - "description": "

An optional string to use as the unique key for this widget. If this\nis omitted, a key will be generated for the widget based on its\ncontent. Multiple widgets of the same type may not share the same\nkey.

\n", - "default": null - }, - { - "name": "on_change", - "type_name": "callable", - "is_optional": false, - "description": "

An optional callback invoked when this data_editor's value changes.

\n", - "default": null - }, - { - "name": "args", - "type_name": "tuple", - "is_optional": false, - "description": "

An optional tuple of args to pass to the callback.

\n", - "default": null - }, - { - "name": "kwargs", - "type_name": "dict", - "is_optional": false, - "description": "

An optional dict of kwargs to pass to the callback.

\n", - "default": null - } - ], - "returns": [ - { - "type_name": "pandas.DataFrame, pandas.Series, pyarrow.Table, numpy.ndarray, list, set, tuple, or dict.", - "is_generator": false, - "description": "

The edited data. The edited data is returned in its original data type if\nit corresponds to any of the supported return types. All other data types\nare returned as a pd.DataFrame.

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/data_editor.py#L529" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/layouts.py#L287" }, "streamlit.experimental_get_query_params": { "name": "experimental_get_query_params", "signature": "st.experimental_get_query_params()", - "example": "
\n

Let's say the user's web browser is at\nhttp://localhost:8501/?show_map=True&selected=asia&selected=america.\nThen, you can get the query parameters using the following:

\n
\nimport streamlit as st\n\nst.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\n

Note that the values in the returned dict are always lists. This is\nbecause we internally use Python's urllib.parse.parse_qs(), which behaves\nthis way. And this behavior makes sense when you consider that every item\nin a query string is potentially a 1-element array.

\n
\n", - "description": "

Return the query parameters that is currently showing in the browser's URL bar.

\n", + "example": "
\n

Let's say the user's web browser is at\nhttp://localhost:8501/?show_map=True&selected=asia&selected=america.\nThen, you can get the query parameters using the following:

\n
\nst.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\n

Note that the values in the returned dict are always lists. This is\nbecause we internally use Python's urllib.parse.parse_qs(), which behaves\nthis way. And this behavior makes sense when you consider that every item\nin a query string is potentially a 1-element array.

\n
\n", + "description": "Return the query parameters that is currently showing in the browser's URL bar.", "args": [], "returns": [ { @@ -13590,66 +12202,59 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/commands/query_params.py#L29" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/__init__.py#L339" }, "streamlit.experimental_memo": { "name": "experimental_memo", - "signature": "st.experimental_memo(func=None, *, ttl, max_entries, show_spinner, persist, experimental_allow_widgets, hash_funcs=None)", - "example": "
\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\nimport streamlit as st\n\n@st.cache_data(persist="disk")\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

By default, all parameters to a cached function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nconnection = make_database_connection()\nd1 = fetch_and_clean_data(connection, num_rows=10)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nanother_connection = make_database_connection()\nd2 = fetch_and_clean_data(another_connection, num_rows=10)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _database_connection parameter was different\n# in both calls.\n
\n

A cached function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nfetch_and_clean_data.clear()\n# Clear all cached entries for this function.\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. datetime.datetime) to a hash\nfunction (lambda dt: dt.isoformat()) like this:

\n
\nimport streamlit as st\nimport datetime\n\n@st.cache_data(hash_funcs={datetime.datetime: lambda dt: dt.isoformat()})\ndef convert_to_utc(dt: datetime.datetime):\n    return dt.astimezone(datetime.timezone.utc)\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "datetime.datetime") to the hash function instead:

\n
\nimport streamlit as st\nimport datetime\n\n@st.cache_data(hash_funcs={"datetime.datetime": lambda dt: dt.isoformat()})\ndef convert_to_utc(dt: datetime.datetime):\n    return dt.astimezone(datetime.timezone.utc)\n
\n
\n", - "description": "

Decorator to cache functions that return data (e.g. dataframe transforms, database queries, ML inference).

\n

Cached objects are stored in "pickled" form, which means that the return\nvalue of a cached function must be pickleable. Each caller of the cached\nfunction gets its own copy of the cached data.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_data.clear().

\n

To cache global resources, use st.cache_resource instead. Learn more\nabout caching at https://docs.streamlit.io/library/advanced-features/caching.

\n", + "signature": "st.experimental_memo(func=None, *, persist=None, show_spinner=True, suppress_st_warning=False, max_entries=None, ttl=None)", + "example": "
\n
\n@st.experimental_memo\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\n@st.experimental_memo(persist="disk")\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

By default, all parameters to a memoized function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\n@st.experimental_memo\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nconnection = make_database_connection()\nd1 = fetch_and_clean_data(connection, num_rows=10)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nanother_connection = make_database_connection()\nd2 = fetch_and_clean_data(another_connection, num_rows=10)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _database_connection parameter was different\n# in both calls.\n
\n

A memoized function's cache can be procedurally cleared:

\n
\n@st.experimental_memo\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nfetch_and_clean_data.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Function decorator to memoize function executions.

\n

Memoized data is stored in "pickled" form, which means that the return\nvalue of a memoized function must be pickleable.

\n

Each caller of a memoized function gets its own copy of the cached data.

\n

You can clear a memoized function's cache with f.clear().

\n", "args": [ { "name": "func", "type_name": "callable", "is_optional": false, - "description": "

The function to cache. Streamlit hashes the function's source code.

\n", + "description": "

The function to memoize. Streamlit hashes the function's source code.

\n", "default": null }, { - "name": "ttl", - "type_name": "float, timedelta, str, or None", + "name": "persist", + "type_name": "str or None", "is_optional": false, - "description": "

The maximum time to keep an entry in the cache. Can be one of:

\n\n

Note that ttl will be ignored if persist="disk" or persist=True.

\n", + "description": "

Optional location to persist cached data to. Currently, the only\nvalid value is "disk", which will persist to the local disk.

\n", "default": null }, - { - "name": "max_entries", - "type_name": "int or None", - "is_optional": false, - "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. When a new entry is added to a full cache,\nthe oldest cached entry will be removed. Defaults to None.

\n", - "default": "None" - }, { "name": "show_spinner", - "type_name": "boolean or string", + "type_name": "boolean", "is_optional": false, - "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached data is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "description": "

Enable the spinner. Default is True to show a spinner when there is\na cache miss.

\n", "default": "True" }, { - "name": "persist", - "type_name": "\"disk\", boolean, or None", + "name": "suppress_st_warning", + "type_name": "boolean", "is_optional": false, - "description": "

Optional location to persist cached data to. Passing "disk" (or True)\nwill persist the cached data to the local disk. None (or False) will disable\npersistence. The default is None.

\n", - "default": "None" + "description": "

Suppress warnings about calling Streamlit functions from within\nthe cached function.

\n", + "default": null }, { - "name": "experimental_allow_widgets", - "type_name": "boolean", + "name": "max_entries", + "type_name": "int or None", "is_optional": false, - "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", - "default": "False" + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None" }, { - "name": "hash_funcs", - "type_name": "dict or None", + "name": "ttl", + "type_name": "float or None", "is_optional": false, - "description": "

Mapping of types or fully qualified names to hash functions.\nThis is used to override the behavior of the hasher inside Streamlit's\ncaching mechanism: when the hasher encounters an object, it will first\ncheck to see if its type matches a key in this dict and, if so, will use\nthe provided function to generate a hash for it. See below for an example\nof how this can be used.

\n", - "default": null + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.\nNote that ttl is incompatible with persist="disk" - ttl will be\nignored if persist is specified.

\n", + "default": "None" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/runtime/caching/cache_data_api.py#L384" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/runtime/caching/memo_decorator.py#L230" }, "streamlit.experimental_rerun": { "name": "experimental_rerun", @@ -13657,13 +12262,13 @@ "description": "

Rerun the script immediately.

\n

When st.experimental_rerun() is called, the script is halted - no\nmore statements will be run, and the script will be queued to re-run\nfrom the top.

\n

If this function is called outside of Streamlit, it will raise an\nException.

\n", "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/commands/execution_control.py#L47" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/__init__.py#L523" }, "streamlit.experimental_set_query_params": { "name": "experimental_set_query_params", "signature": "st.experimental_set_query_params(**query_params)", - "example": "
\n

To point the user's web browser to something like\n"http://localhost:8501/?show_map=True&selected=asia&selected=america",\nyou would do the following:

\n
\nimport streamlit as st\n\nst.experimental_set_query_params(\n    show_map=True,\n    selected=["asia", "america"],\n)\n
\n
\n", - "description": "

Set the query parameters that are shown in the browser's URL bar.

\n
\n

Warning

\n

Query param embed cannot be set using this method.

\n
\n", + "example": "
\n

To point the user's web browser to something like\n"http://localhost:8501/?show_map=True&selected=asia&selected=america",\nyou would do the following:

\n
\nst.experimental_set_query_params(\n    show_map=True,\n    selected=["asia", "america"],\n)\n
\n
\n", + "description": "Set the query parameters that are shown in the browser's URL bar.", "args": [ { "name": "**query_params", @@ -13674,78 +12279,68 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/commands/query_params.py#L65" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/__init__.py#L370" + }, + "streamlit.experimental_show": { + "name": "experimental_show", + "signature": "st.experimental_show(*args)", + "notes": "
\n

This is an experimental feature with usage limitations:

\n
    \n
  • The method must be called with the name show.
  • \n
  • Must be called in one line of code, and only once per line.
  • \n
  • \n
    When passing multiple arguments the inclusion of , or ) in a string
    \n
    argument may cause an error.
    \n
    \n
  • \n
\n
\n", + "example": "
\n
\ndataframe = pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n})\nst.experimental_show(dataframe)\n
\n
\n", + "description": "

Write arguments and argument names to your app for debugging purposes.

\n

Show() has similar properties to write():

\n
\n
    \n
  1. You can pass in multiple arguments, all of which will be debugged.
  2. \n
  3. It returns None, so it's "slot" in the app cannot be reused.
  4. \n
\n
\n

Note: This is an experimental feature. See\nhttps://docs.streamlit.io/library/advanced-features/prerelease#experimental for more information.

\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to debug in the App.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/__init__.py#L257" }, "streamlit.experimental_singleton": { "name": "experimental_singleton", - "signature": "st.experimental_singleton(func, *, ttl, max_entries, show_spinner, validate, experimental_allow_widgets, hash_funcs=None)", - "example": "
\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(url):\n    # Create a database session object that points to the URL.\n    return session\n\ns1 = get_database_session(SESSION_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(SESSION_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the connection object in s1 is the same as in s2.\n\ns3 = get_database_session(SESSION_URL_2)\n# This is a different URL, so the function executes.\n
\n

By default, all parameters to a cache_resource function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\ns1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _sessionmaker parameter was different\n# in both calls.\n
\n

A cache_resource function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\nget_database_session.clear()\n# Clear all cached entries for this function.\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. Person) to a hash\nfunction (str) like this:

\n
\nimport streamlit as st\nfrom pydantic import BaseModel\n\nclass Person(BaseModel):\n    name: str\n\n@st.cache_resource(hash_funcs={Person: str})\ndef get_person_name(person: Person):\n    return person.name\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "__main__.Person") to the hash function instead:

\n
\nimport streamlit as st\nfrom pydantic import BaseModel\n\nclass Person(BaseModel):\n    name: str\n\n@st.cache_resource(hash_funcs={"__main__.Person": str})\ndef get_person_name(person: Person):\n    return person.name\n
\n
\n", - "description": "

Decorator to cache functions that return global resources (e.g. database connections, ML models).

\n

Cached objects are shared across all users, sessions, and reruns. They\nmust be thread-safe because they can be accessed from multiple threads\nconcurrently. If thread safety is an issue, consider using st.session_state\nto store resources per session instead.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_resource.clear().

\n

To cache data, use st.cache_data instead. Learn more about caching at\nhttps://docs.streamlit.io/library/advanced-features/caching.

\n", + "signature": "st.experimental_singleton(func=None, *, show_spinner=True, suppress_st_warning=False)", + "example": "
\n
\n@st.experimental_singleton\ndef get_database_session(url):\n    # Create a database session object that points to the URL.\n    return session\n\ns1 = get_database_session(SESSION_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(SESSION_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the connection object in s1 is the same as in s2.\n\ns3 = get_database_session(SESSION_URL_2)\n# This is a different URL, so the function executes.\n
\n

By default, all parameters to a singleton function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\n@st.experimental_singleton\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\ns1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _sessionmaker parameter was different\n# in both calls.\n
\n

A singleton function's cache can be procedurally cleared:

\n
\n@st.experimental_singleton\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\nget_database_session.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Function decorator to store singleton objects.

\n

Each singleton object is shared across all users connected to the app.\nSingleton objects must be thread-safe, because they can be accessed from\nmultiple threads concurrently.

\n

(If thread-safety is an issue, consider using st.session_state to\nstore per-session singleton objects instead.)

\n

You can clear a memoized function's cache with f.clear().

\n", "args": [ { "name": "func", "type_name": "callable", "is_optional": false, - "description": "

The function that creates the cached resource. Streamlit hashes the\nfunction's source code.

\n", - "default": null - }, - { - "name": "ttl", - "type_name": "float, timedelta, str, or None", - "is_optional": false, - "description": "

The maximum time to keep an entry in the cache. Can be one of:

\n\n

Note that ttl will be ignored if persist="disk" or persist=True.

\n", + "description": "

The function that creates the singleton. Streamlit hashes the\nfunction's source code.

\n", "default": null }, - { - "name": "max_entries", - "type_name": "int or None", - "is_optional": false, - "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. When a new entry is added to a full cache,\nthe oldest cached entry will be removed. Defaults to None.

\n", - "default": "None" - }, { "name": "show_spinner", - "type_name": "boolean or string", + "type_name": "boolean", "is_optional": false, - "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached resource is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the singleton is being created.

\n", "default": "True" }, { - "name": "validate", - "type_name": "callable or None", - "is_optional": false, - "description": "

An optional validation function for cached data. validate is called\neach time the cached value is accessed. It receives the cached value as\nits only parameter and it must return a boolean. If validate returns\nFalse, the current cached value is discarded, and the decorated function\nis called to compute a new value. This is useful e.g. to check the\nhealth of database connections.

\n", - "default": null - }, - { - "name": "experimental_allow_widgets", + "name": "suppress_st_warning", "type_name": "boolean", "is_optional": false, - "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", - "default": "False" - }, - { - "name": "hash_funcs", - "type_name": "dict or None", - "is_optional": false, - "description": "

Mapping of types or fully qualified names to hash functions.\nThis is used to override the behavior of the hasher inside Streamlit's\ncaching mechanism: when the hasher encounters an object, it will first\ncheck to see if its type matches a key in this dict and, if so, will use\nthe provided function to generate a hash for it. See below for an example\nof how this can be used.

\n", + "description": "

Suppress warnings about calling Streamlit functions from within\nthe singleton function.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/runtime/caching/cache_resource_api.py#L264" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/runtime/caching/singleton_decorator.py#L152" }, "streamlit.file_uploader": { "name": "file_uploader", "signature": "st.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nimport streamlit as st\nimport pandas as pd\nfrom io import StringIO\n\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nimport streamlit as st\n\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n
\n", + "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this file uploader is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this file uploader is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { @@ -13806,9 +12401,9 @@ }, { "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", "default": "is" } ], @@ -13820,13 +12415,13 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/file_uploader.py#L222" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/file_uploader.py#L212" }, "streamlit.form": { "name": "form", "signature": "st.form(key, clear_on_submit=False)", - "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n\n \n
\n", - "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
  • Within a form, the only widget that can have a callback function is\nst.form_submit_button.
  • \n
\n", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n

Inserting elements out of order:

\n
\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n
\n", + "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
\n

For more information about forms, check out our\nblog post.

\n", "args": [ { "name": "key", @@ -13844,11 +12439,11 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/form.py#L118" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/form.py#L113" }, "streamlit.form_submit_button": { "name": "form_submit_button", - "signature": "st.form_submit_button(label=\"Submit\", help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "signature": "st.form_submit_button(label=\"Submit\", help=None, on_click=None, args=None, kwargs=None)", "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", "args": [ { @@ -13885,27 +12480,6 @@ "is_optional": false, "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null - }, - { - "name": "type", - "type_name": "\"secondary\" or \"primary\"", - "is_optional": false, - "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", - "default": "s" - }, - { - "name": "disabled", - "type_name": "bool", - "is_optional": false, - "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", - "default": "False" - }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", - "default": null } ], "returns": [ @@ -13916,7 +12490,11 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/form.py#L218" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/form.py#L202" + }, + "streamlit.gather_metrics": { + "name": "gather_metrics", + "signature": "st.gather_metrics(callable)" }, "streamlit.get_option": { "name": "get_option", @@ -13932,13 +12510,13 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/config.py#L131" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/config.py#L90" }, "streamlit.graphviz_chart": { "name": "graphviz_chart", "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)", - "example": "
\n
\nimport streamlit as st\nimport graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n
\n", - "description": "

Display a graph using the dagre-d3 library.

\n", + "example": "
\n
\nimport streamlit as st\nimport graphviz as graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a graph using the dagre-d3 library.", "args": [ { "name": "figure_or_dot", @@ -13956,68 +12534,54 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/graphviz_chart.py#L39" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/graphviz_chart.py#L39" }, "streamlit.header": { "name": "header", - "signature": "st.header(body, anchor=None, *, help=None, divider=False)", - "examples": "
\n
\nimport streamlit as st\n\nst.header('This is a header with a divider', divider='rainbow')\nst.header('_Streamlit_ is :blue[cool] :sunglasses:')\n
\n\n \n
\n", - "description": "

Display text in header formatting.

\n", + "signature": "st.header(body, anchor=None)", + "example": "
\n
\nst.header('This is a header')\n
\n
\n", + "description": "Display text in header formatting.", "args": [ { "name": "body", "type_name": "str", "is_optional": false, - "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", + "description": "

The text to display.

\n", "default": null }, { "name": "anchor", - "type_name": "str or False", - "is_optional": false, - "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", - "default": null - }, - { - "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the header.

\n", - "default": null - }, - { - "name": "divider", - "type_name": "bool or \u201cblue\u201d, \u201cgreen\u201d, \u201corange\u201d, \u201cred\u201d, \u201cviolet\u201d, \u201cgray\u201d/\"grey\", or \u201crainbow\u201d", - "is_optional": false, - "description": "

Shows a colored divider below the header. If True, successive\nheaders will cycle through divider colors. That is, the first\nheader will have a blue line, the second header will have a\ngreen line, and so on. If a string, the color can be set to one of\nthe following: blue, green, orange, red, violet, gray/grey, or\nrainbow.

\n", + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/heading.py#L41" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/heading.py#L26" }, "streamlit.help": { "name": "help", - "signature": "st.help(obj=)", - "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nimport streamlit as st\nimport pandas\n\nst.help(pandas.DataFrame)\n
\n\n \n

Want to quickly check what data type is output by a certain function?\nTry:

\n
\nimport streamlit as st\n\nx = my_poorly_documented_function()\nst.help(x)\n
\n

Want to quickly inspect an object? No sweat:

\n
\nclass Dog:\n  '''A typical dog.'''\n\n  def __init__(self, breed, color):\n    self.breed = breed\n    self.color = color\n\n  def bark(self):\n    return 'Woof!'\n\n\nfido = Dog('poodle', 'white')\n\nst.help(fido)\n
\n\n \n

And if you're using Magic, you can get help for functions, classes,\nand modules without even typing st.help:

\n
\nimport streamlit as st\nimport pandas\n\n# Get help for Pandas read_csv:\npandas.read_csv\n\n# Get help for Streamlit itself:\nst\n
\n\n \n
\n", - "description": "

Display help and other information for a given object.

\n

Depending on the type of object that is passed in, this displays the\nobject's name, type, value, signature, docstring, and member variables,\nmethods \u2014 as well as the values/docstring of members and methods.

\n", + "signature": "st.help(obj)", + "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nst.help(pandas.DataFrame)\n
\n

Want to quickly check what datatype is output by a certain function?\nTry:

\n
\nx = my_poorly_documented_function()\nst.help(x)\n
\n
\n", + "description": "

Display object's doc string, nicely formatted.

\n

Displays the doc string for this object.

\n", "args": [ { "name": "obj", - "type_name": "any", + "type_name": "Object", "is_optional": false, - "description": "

The object whose information should be displayed. If left\nunspecified, this call will display help for Streamlit itself.

\n", + "description": "

The object whose docstring should be displayed.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/doc_string.py#L48" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/doc_string.py#L43" }, "streamlit.image": { "name": "image", "signature": "st.image(image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", - "example": "
\n
\nimport streamlit as st\nfrom PIL import Image\n\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n
\n", - "description": "

Display an image or list of images.

\n", + "example": "
\n
\nfrom PIL import Image\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an image or list of images.", "args": [ { "name": "image", @@ -14042,9 +12606,9 @@ }, { "name": "use_column_width", - "type_name": "\"auto\", \"always\", \"never\", or bool", + "type_name": "'auto' or 'always' or 'never' or bool", "is_optional": false, - "description": "

If "auto", set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf "always" or True, set the image's width to the column width.\nIf "never" or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", + "description": "

If 'auto', set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf 'always' or True, set the image's width to the column width.\nIf 'never' or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", "default": null }, { @@ -14056,51 +12620,51 @@ }, { "name": "channels", - "type_name": "\"RGB\" or \"BGR\"", + "type_name": "'RGB' or 'BGR'", "is_optional": false, - "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to "RGB", meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to "BGR", instead.

\n", + "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to 'RGB', meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to 'BGR', instead.

\n", "default": "s" }, { "name": "output_format", - "type_name": "\"JPEG\", \"PNG\", or \"auto\"", + "type_name": "'JPEG', 'PNG', or 'auto'", "is_optional": false, - "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to "auto" which identifies the compression type based\non the type and format of the image argument.

\n", + "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to 'auto' which identifies the compression type based\non the type and format of the image argument.

\n", "default": "s" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/image.py#L87" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/image.py#L61" }, "streamlit.info": { "name": "info", "signature": "st.info(body, *, icon=None)", - "example": "
\n
\nimport streamlit as st\n\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", - "description": "

Display an informational message.

\n", + "example": "
\n
\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", + "description": "Display an informational message.", "args": [ + { + "name": "icon", + "type_name": "None", + "is_optional": false, + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" + }, { "name": "body", "type_name": "str", "is_optional": false, "description": "

The info text to display.

\n", "default": null - }, - { - "name": "icon", - "type_name": "str or None", - "is_optional": false, - "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", - "default": "None" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/alert.py#L91" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/alert.py#L98" }, "streamlit.json": { "name": "json", "signature": "st.json(body, *, expanded=True)", - "example": "
\n
\nimport streamlit as st\n\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n
\n", - "description": "

Display object or string as a pretty-printed JSON string.

\n", + "example": "
\n
\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display object or string as a pretty-printed JSON string.", "args": [ { "name": "body", @@ -14118,12 +12682,12 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/json.py#L35" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/json.py#L41" }, "streamlit.latex": { "name": "latex", - "signature": "st.latex(body, *, help=None)", - "example": "
\n
\nimport streamlit as st\n\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", + "signature": "st.latex(body)", + "example": "
\n
\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", "args": [ { @@ -14132,29 +12696,22 @@ "is_optional": false, "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", "default": null - }, - { - "name": "help", - "type_name": "str", - "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the LaTeX expression.

\n", - "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/markdown.py#L210" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/markdown.py#L164" }, "streamlit.line_chart": { "name": "line_chart", - "signature": "st.line_chart(data=None, *, x=None, y=None, color=None, width=0, height=0, use_container_width=True)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\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 \n

You can also choose different columns to use for x and y, as well as set\nthe color dynamically based on a 3rd column (assuming your dataframe is in\nlong format):

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame({\n    'col1' : np.random.randn(20),\n    'col2' : np.random.randn(20),\n    'col3' : np.random.choice(['A','B','C'], 20)\n})\n\nst.line_chart(\n    chart_data,\n    x = 'col1',\n    y = 'col2',\n    color = 'col3'\n)\n
\n\n \n

Finally, if your dataframe is in wide format, you can group multiple\ncolumns under the y argument to show multiple lines with different\ncolors:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns = ['col1', 'col2', 'col3'])\n\nst.line_chart(\n    chart_data,\n    x = 'col1',\n    y = ['col2', 'col3'],\n    color = ['#FF0000', '#0000FF']  # Optional\n)\n
\n\n \n
\n", + "signature": "st.line_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\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 \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", "args": [ { "name": "data", - "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict or None", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict or None", "is_optional": false, - "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null }, { @@ -14171,13 +12728,6 @@ "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", "default": null }, - { - "name": "color", - "type_name": "str, tuple, sequence of str, sequence of tuple, or None", - "is_optional": false, - "description": "

The color to use for different lines in this chart. This argument\ncan only be supplied by keyword.

\n

For a line chart with just one line, this can be:

\n
    \n
  • None, to use the default color.
  • \n
  • A hex string like "#ffaa00" or "#ffaa0088".
  • \n
  • An RGB or RGBA tuple with the red, green, blue, and alpha\ncomponents specified as ints from 0 to 255 or floats from 0.0 to\n1.0.
  • \n
\n

For a line chart with multiple lines, where the dataframe is in\nlong format (that is, y is None or just one column), this can be:

\n
    \n
  • None, to use the default colors.

    \n
  • \n
  • The name of a column in the dataset. Data points will be grouped\ninto lines of the same color based on the value of this column.\nIn addition, if the values in this column match one of the color\nformats above (hex string or color tuple), then that color will\nbe used.

    \n

    For example: if the dataset has 1000 rows, but this column can\nonly contains the values "adult", "child", "baby", then\nthose 1000 datapoints will be grouped into three lines, whose\ncolors will be automatically selected from the default palette.

    \n

    But, if for the same 1000-row dataset, this column contained\nthe values "#ffaa00", "#f0f", "#0000ff", then then those 1000\ndatapoints would still be grouped into three lines, but their\ncolors would be "#ffaa00", "#f0f", "#0000ff" this time around.

    \n
  • \n
\n

For a line chart with multiple lines, where the dataframe is in\nwide format (that is, y is a sequence of columns), this can be:

\n
    \n
  • None, to use the default colors.
  • \n
  • A list of string colors or color tuples to be used for each of\nthe lines in the chart. This list should have the same length\nas the number of y values (e.g. color=["#fd0", "#f0f", "#04f"]\nfor three lines).
  • \n
\n", - "default": "color" - }, { "name": "width", "type_name": "int", @@ -14201,109 +12751,74 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L231" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/dataframe_selector.py#L146" }, "streamlit.map": { "name": "map", - "signature": "st.map(data=None, *, latitude=None, longitude=None, color=None, size=None, zoom=None, use_container_width=True)", - "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n

You can also customize the size and color of the datapoints:

\n
\nst.map(df, size=20, color='#0044ff')\n
\n

And finally, you can choose different columns to use for the latitude\nand longitude components, as well as set size and color of each\ndatapoint dynamically based on other columns:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame({\n    "col1": np.random.randn(1000) / 50 + 37.76,\n    "col2": np.random.randn(1000) / 50 + -122.4,\n    "col3": np.random.randn(1000) * 100,\n    "col4": np.random.rand(1000, 4).tolist(),\n})\n\nst.map(df,\n    latitude='col1',\n    longitude='col2',\n    size='col3',\n    color='col4')\n
\n\n \n
\n", - "description": "

Display a map with a scatterplot overlaid onto it.

\n

This is a wrapper around st.pydeck_chart to quickly create\nscatterplot charts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "signature": "st.map(data=None, zoom=None, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a map with points on it.

\n

This is a wrapper around st.pydeck_chart to quickly create scatterplot\ncharts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more\ninfo on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", "args": [ { "name": "data", - "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", - "is_optional": false, - "description": "

The data to be plotted.

\n", - "default": null - }, - { - "name": "latitude", - "type_name": "str or None", - "is_optional": false, - "description": "

The name of the column containing the latitude coordinates of\nthe datapoints in the chart. This argument can only be supplied\nby keyword.

\n

If None, the latitude data will come from any column named 'lat',\n'latitude', 'LAT', or 'LATITUDE'.

\n", - "default": null - }, - { - "name": "longitude", - "type_name": "str or None", + "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,", "is_optional": false, - "description": "

The name of the column containing the longitude coordinates of\nthe datapoints in the chart. This argument can only be supplied\nby keyword.

\n

If None, the longitude data will come from any column named 'lon',\n'longitude', 'LON', or 'LONGITUDE'.

\n", + "description": "

or None\nThe data to be plotted. Must have columns called 'lat', 'lon',\n'latitude', or 'longitude'.

\n", "default": null }, - { - "name": "color", - "type_name": "str or tuple or None", - "is_optional": false, - "description": "

The color of the circles representing each datapoint. This argument\ncan only be supplied by keyword.

\n

Can be:

\n
    \n
  • None, to use the default color.
  • \n
  • A hex string like "#ffaa00" or "#ffaa0088".
  • \n
  • An RGB or RGBA tuple with the red, green, blue, and alpha\ncomponents specified as ints from 0 to 255 or floats from 0.0 to\n1.0.
  • \n
  • The name of the column to use for the color. Cells in this column\nshould contain colors represented as a hex string or color tuple,\nas described above.
  • \n
\n", - "default": "color" - }, - { - "name": "size", - "type_name": "str or float or None", - "is_optional": false, - "description": "

The size of the circles representing each point, in meters. This\nargument can only be supplied by keyword.

\n

This can be:

\n
    \n
  • None, to use the default size.
  • \n
  • A number like 100, to specify a single size to use for all\ndatapoints.
  • \n
  • The name of the column to use for the size. This allows each\ndatapoint to be represented by a circle of a different size.
  • \n
\n", - "default": "size" - }, { "name": "zoom", "type_name": "int", "is_optional": false, - "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels.\nThis argument can only be supplied by keyword.

\n", + "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels

\n", "default": null }, { "name": "use_container_width", "type_name": "bool", "is_optional": false, - "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "description": "", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/map.py#L91" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/map.py#L75" }, "streamlit.markdown": { "name": "markdown", - "signature": "st.markdown(body, unsafe_allow_html=False, *, help=None)", - "examples": "
\n
\nimport streamlit as st\n\nst.markdown("*Streamlit* is **really** ***cool***.")\nst.markdown('''\n    :red[Streamlit] :orange[can] :green[write] :blue[text] :violet[in]\n    :gray[pretty] :rainbow[colors].''')\nst.markdown("Here's a bouquet &mdash;\\\n            :tulip::cherry_blossom::rose::hibiscus::sunflower::blossom:")\n\nmulti = '''If you end a line with two spaces,\na soft return is used for the next line.\n\nTwo (or more) newline characters in a row will result in a hard return.\n'''\nst.markdown(multi)\n
\n\n \n
\n", - "description": "

Display string formatted as Markdown.

\n", + "signature": "st.markdown(body, unsafe_allow_html=False)", + "example": "
\n
\nst.markdown('Streamlit is **_really_ cool**.')\n
\n
\n", + "description": "Display string formatted as Markdown.", "args": [ { "name": "body", "type_name": "str", "is_optional": false, - "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n\n", "default": null }, { "name": "unsafe_allow_html", "type_name": "bool", "is_optional": false, - "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", - "default": null - }, - { - "name": "help", - "type_name": "str", - "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the Markdown.

\n", + "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n

Also note that ``unsafe_allow_html`` is a temporary measure and may\nbe removed from Streamlit at any time.

\n

If you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:

\n

https://discuss.streamlit.io/t/96

\n

This will help us come up with safe APIs that allow you to do what\nyou want.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/markdown.py#L31" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/markdown.py#L29" }, "streamlit.metric": { "name": "metric", - "signature": "st.metric(label, value, delta=None, delta_color=\"normal\", help=None, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n

st.metric looks especially nice in combination with st.columns:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n

The delta indicator color can also be inverted or turned off:

\n
\nimport streamlit as st\n\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n
\n", + "signature": "st.metric(label, value, delta=None, delta_color=\"normal\", help=None)", + "example": "
\n
\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n \n (view standalone Streamlit app)\n \n

st.metric looks especially nice in combination with st.columns:

\n
\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n \n (view standalone Streamlit app)\n \n

The delta indicator color can also be inverted or turned off:

\n
\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

The header or title for the metric. The label can optionally contain\nMarkdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "description": "

The header or Title for the metric

\n", "default": null }, { @@ -14322,7 +12837,7 @@ }, { "name": "delta_color", - "type_name": "\"normal\", \"inverse\", or \"off\"", + "type_name": "str", "is_optional": false, "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", "default": null @@ -14333,29 +12848,22 @@ "is_optional": false, "description": "

An optional tooltip that gets displayed next to the metric label.

\n", "default": null - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/metric.py#L46" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/metric.py#L43" }, "streamlit.multiselect": { "name": "multiselect", - "signature": "st.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, max_selections=None, placeholder=\"Choose an option\", disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n
\n", + "signature": "st.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this select widget is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { @@ -14414,20 +12922,6 @@ "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, - { - "name": "max_selections", - "type_name": "int", - "is_optional": false, - "description": "

The max selections that can be selected at a time.\nThis argument can only be supplied by keyword.

\n", - "default": null - }, - { - "name": "placeholder", - "type_name": "str", - "is_optional": false, - "description": "

A string to display when no options are selected. Defaults to 'Choose an option'.

\n", - "default": "s" - }, { "name": "disabled", "type_name": "bool", @@ -14437,9 +12931,9 @@ }, { "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", "default": "is" } ], @@ -14451,45 +12945,45 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/multiselect.py#L146" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/multiselect.py#L127" }, "streamlit.number_input": { "name": "number_input", - "signature": "st.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n
\n", - "description": "

Display a numeric input widget.

\n
\n

Note

\n

Integer values exceeding +/- (1<<53) - 1 cannot be accurately\nstored or returned by the widget due to serialization contstraints\nbetween the Python server and JavaScript client. You must handle\nsuch numbers as floats, leading to a loss in precision.

\n
\n", + "signature": "st.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a numeric input widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this input is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { "name": "min_value", - "type_name": "int, float, or None", + "type_name": "int or float or None", "is_optional": false, "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", "default": null }, { "name": "max_value", - "type_name": "int, float, or None", + "type_name": "int or float or None", "is_optional": false, "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", "default": null }, { "name": "value", - "type_name": "int, float, or None", + "type_name": "int or float or None", "is_optional": false, "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", "default": "min_value" }, { "name": "step", - "type_name": "int, float, or None", + "type_name": "int or float or None", "is_optional": false, "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", "default": "1" @@ -14545,9 +13039,9 @@ }, { "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", "default": "is" } ], @@ -14559,12 +13053,12 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/number_input.py#L67" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/number_input.py#L72" }, "streamlit.plotly_chart": { "name": "plotly_chart", - "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", theme=\"streamlit\", **kwargs)", - "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport numpy as np\nimport plotly.figure_factory as ff\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n        hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n
\n", + "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)", + "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport plotly.figure_factory as ff\nimport numpy as np\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n        hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", "args": [ { @@ -14583,18 +13077,11 @@ }, { "name": "sharing", - "type_name": "\"streamlit\", \"private\", \"secret\", or \"public\"", + "type_name": "{'streamlit', 'private', 'secret', 'public'}", "is_optional": false, - "description": "

Use "streamlit" to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", + "description": "

Use 'streamlit' to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", "default": null }, - { - "name": "theme", - "type_name": "\"streamlit\" or None", - "is_optional": false, - "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", - "default": "behavior" - }, { "name": "**kwargs", "type_name": null, @@ -14604,13 +13091,13 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/plotly_chart.py#L81" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/plotly_chart.py#L68" }, "streamlit.progress": { "name": "progress", - "signature": "st.progress(value, text=None)", - "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport streamlit as st\nimport time\n\nprogress_text = "Operation in progress. Please wait."\nmy_bar = st.progress(0, text=progress_text)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1, text=progress_text)\n
\n
\n", - "description": "

Display a progress bar.

\n", + "signature": "st.progress(value)", + "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport time\n\nmy_bar = st.progress(0)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1)\n
\n
\n", + "description": "Display a progress bar.", "args": [ { "name": "value", @@ -14618,23 +13105,16 @@ "is_optional": false, "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", "default": null - }, - { - "name": "text", - "type_name": "str or None", - "is_optional": false, - "description": "

A message to display above the progress bar. The text can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", - "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/progress.py#L66" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/progress.py#L31" }, "streamlit.pydeck_chart": { "name": "pydeck_chart", "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)", - "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport pydeck as pdk\n\nchart_data = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=chart_data,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=chart_data,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", - "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\ndf = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=df,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=df,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", + "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", "args": [ { "name": "pydeck_obj", @@ -14652,14 +13132,14 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/deck_gl_json_chart.py#L37" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/deck_gl_json_chart.py#L36" }, "streamlit.pyplot": { "name": "pyplot", - "signature": "st.pyplot(fig=None, clear_figure=None, use_container_width=True, **kwargs)", + "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)", "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", - "example": "
\n
\nimport streamlit as st\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n
\n", - "description": "

Display a matplotlib.pyplot figure.

\n", + "example": "
\n
\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a matplotlib.pyplot figure.", "args": [ { "name": "fig", @@ -14675,13 +13155,6 @@ "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", "default": "based" }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "

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

\n", - "default": "s" - }, { "name": "**kwargs", "type_name": "any", @@ -14691,26 +13164,26 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/pyplot.py#L38" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/pyplot.py#L37" }, "streamlit.radio": { "name": "radio", - "signature": "st.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, captions=None, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\ngenre = st.radio(\n    "What's your favorite movie genre",\n    [":rainbow[Comedy]", "***Drama***", "Documentary :movie_camera:"],\n    captions = ["Laugh out loud.", "Get the popcorn.", "Never stop learning."])\n\nif genre == ':rainbow[Comedy]':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn\\'t select comedy.")\n
\n\n \n
\n", - "description": "

Display a radio button widget.

\n", + "signature": "st.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, label_visibility=\"visible\")", + "example": "
\n
\ngenre = st.radio(\n    "What's your favorite movie genre",\n    ('Comedy', 'Drama', 'Documentary'))\n\nif genre == 'Comedy':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn't select comedy.")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a radio button widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this radio group is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this radio group is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { "name": "options", "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", "is_optional": false, - "description": "

Labels for the radio options. Labels can include markdown as\ndescribed in the label parameter and will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", + "description": "

Labels for the radio options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", "default": null }, { @@ -14776,18 +13249,11 @@ "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", "default": "false" }, - { - "name": "captions", - "type_name": "iterable of str or None", - "is_optional": false, - "description": "

A list of captions to show below each radio button. If None (default),\nno captions are shown.

\n", - "default": null - }, { "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", "default": "is" } ], @@ -14799,19 +13265,19 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/radio.py#L76" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/radio.py#L77" }, "streamlit.select_slider": { "name": "select_slider", "signature": "st.select_slider(label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "examples": "
\nimport streamlit as st\n\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nimport streamlit as st\n\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n ", + "examples": "
\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n \n (view standalone Streamlit app)\n \n ", "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this slider is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { @@ -14879,9 +13345,9 @@ }, { "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", "default": "is" } ], @@ -14893,19 +13359,19 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/select_slider.py#L107" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/select_slider.py#L107" }, "streamlit.selectbox": { "name": "selectbox", - "signature": "st.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=\"Select...\", disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n
\n", - "description": "

Display a select widget.

\n", + "signature": "st.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a select widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this select widget is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { @@ -14964,13 +13430,6 @@ "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, - { - "name": "placeholder", - "type_name": "str", - "is_optional": false, - "description": "

A string to display when no options are selected. Defaults to 'Select...'.

\n

A selectbox can't be empty, so a placeholder only displays while a\nuser's cursor is in a selectbox after manually deleting the current\nselection. A future update will allow selectboxes to be empty.

\n", - "default": "s" - }, { "name": "disabled", "type_name": "bool", @@ -14980,9 +13439,9 @@ }, { "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", "default": "is" } ], @@ -14994,7 +13453,7 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/selectbox.py#L72" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/selectbox.py#L80" }, "streamlit.set_option": { "name": "set_option", @@ -15017,13 +13476,13 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/config.py#L92" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/__init__.py#L217" }, "streamlit.set_page_config": { "name": "set_page_config", "signature": "st.set_page_config(page_title=None, page_icon=None, layout=\"centered\", initial_sidebar_state=\"auto\", menu_items=None)", - "example": "
\nimport streamlit as st\n\nst.set_page_config(\n    page_title="Ex-stream-ly Cool App",\n    page_icon="\ud83e\uddca",\n    layout="wide",\n    initial_sidebar_state="expanded",\n    menu_items={\n        'Get Help': 'https://www.extremelycoolapp.com/help',\n        'Report a bug': "https://www.extremelycoolapp.com/bug",\n        'About': "# This is a header. This is an *extremely* cool app!"\n    }\n)\n
\n", - "description": "

Configures the default settings of the page.

\n
\n

Note

\n

This must be the first Streamlit command used on an app page, and must only\nbe set once per page.

\n
\n", + "example": "
\nst.set_page_config(\n    page_title="Ex-stream-ly Cool App",\n    page_icon="\ud83e\uddca",\n    layout="wide",\n    initial_sidebar_state="expanded",\n    menu_items={\n        'Get Help': 'https://www.extremelycoolapp.com/help',\n        'Report a bug': "https://www.extremelycoolapp.com/bug",\n        'About': "# This is a header. This is an *extremely* cool app!"\n    }\n)\n
\n", + "description": "

Configures the default settings of the page.

\n
\n

Note

\n

This must be the first Streamlit command used in your app, and must only\nbe set once.

\n
\n", "args": [ { "name": "page_title", @@ -15048,7 +13507,7 @@ }, { "name": "initial_sidebar_state", - "type_name": "\"auto\", \"expanded\", or \"collapsed\"", + "type_name": "\"auto\" or \"expanded\" or \"collapsed\"", "is_optional": false, "description": "

How the sidebar should start out. Defaults to "auto",\nwhich hides the sidebar on mobile-sized devices, and shows it otherwise.\n"expanded" shows the sidebar initially; "collapsed" hides it.

\n", "default": "s" @@ -15062,19 +13521,19 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/commands/page_config.py#L114" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/commands/page_config.py#L115" }, "streamlit.slider": { "name": "slider", "signature": "st.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "examples": "
\n
\nimport streamlit as st\n\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nimport streamlit as st\n\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nimport streamlit as st\nfrom datetime import time\n\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nimport streamlit as st\nfrom datetime import datetime\n\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n
\n", - "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n
\n

Note

\n

Integer values exceeding +/- (1<<53) - 1 cannot be accurately\nstored or returned by the widget due to serialization contstraints\nbetween the Python server and JavaScript client. You must handle\nsuch numbers as floats, leading to a loss in precision.

\n
\n", + "examples": "
\n
\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nfrom datetime import time\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nfrom datetime import datetime\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this slider is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { @@ -15100,7 +13559,7 @@ }, { "name": "step", - "type_name": "int, float, timedelta, or None", + "type_name": "int/float/timedelta or None", "is_optional": false, "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", "default": "1" @@ -15156,9 +13615,9 @@ }, { "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", "default": "is" } ], @@ -15170,22 +13629,22 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/slider.py#L173" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/slider.py#L178" }, "streamlit.snow": { "name": "snow", "signature": "st.snow()", - "example": "
\n
\nimport streamlit as st\n\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", - "description": "

Draw celebratory snowfall.

\n", + "example": "
\n
\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", + "description": "Draw celebratory snowfall.", "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/snow.py#L25" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/snow.py#L25" }, "streamlit.spinner": { "name": "spinner", "signature": "st.spinner(text=\"In progress...\")", - "example": "
\n
\nimport time\nimport streamlit as st\n\nwith st.spinner('Wait for it...'):\n    time.sleep(5)\nst.success('Done!')\n
\n
\n", - "description": "

Temporarily displays a message while executing a block of code.

\n", + "example": "
\n
\nwith st.spinner('Wait for it...'):\n    time.sleep(5)\nst.success('Done!')\n
\n
\n", + "description": "Temporarily displays a message while executing a block of code.", "args": [ { "name": "text", @@ -15196,145 +13655,93 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/spinner.py#L23" - }, - "streamlit.status": { - "name": "status", - "signature": "st.status(label, *, expanded=False, state=\"running\")", - "examples": "
\n

You can use with notation to insert any element into an status container:

\n
\nimport time\nimport streamlit as st\n\nwith st.status("Downloading data..."):\n    st.write("Searching for data...")\n    time.sleep(2)\n    st.write("Found URL.")\n    time.sleep(1)\n    st.write("Downloading data...")\n    time.sleep(1)\n\nst.button('Rerun')\n
\n\n \n

You can also use .update() on the container to change the label, state,\nor expanded state:

\n
\nimport time\nimport streamlit as st\n\nwith st.status("Downloading data...", expanded=True) as status:\n    st.write("Searching for data...")\n    time.sleep(2)\n    st.write("Found URL.")\n    time.sleep(1)\n    st.write("Downloading data...")\n    time.sleep(1)\n    status.update(label="Download complete!", state="complete", expanded=False)\n\nst.button('Rerun')\n
\n\n \n
\n", - "description": "

Insert a status container to display output from long-running tasks.

\n

Inserts a container into your app that is typically used to show the status and\ndetails of a process or task. The container can hold multiple elements and can\nbe expanded or collapsed by the user similar to st.expander.\nWhen collapsed, all that is visible is the status icon and label.

\n

The label, state, and expanded state can all be updated by calling .update()\non the returned object. To add elements to the returned container, you can\nuse "with" notation (preferred) or just call methods directly on the returned\nobject.

\n

By default, st.status() initializes in the "running" state. When called using\n"with" notation, it automatically updates to the "complete" state at the end\nof the "with" block. See examples below for more details.

\n", - "args": [ - { - "name": "label", - "type_name": "str", - "is_optional": false, - "description": "

The initial label of the status container. The label can optionally\ncontain Markdown and supports the following elements: Bold,\nItalics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents)\nrender. Display unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", - "default": null - }, - { - "name": "expanded", - "type_name": "bool", - "is_optional": false, - "description": "

If True, initializes the status container in "expanded" state. Defaults to\nFalse (collapsed).

\n", - "default": "s" - }, - { - "name": "state", - "type_name": "\"running\", \"complete\", or \"error\"", - "is_optional": false, - "description": "

The initial state of the status container which determines which icon is\nshown:

\n
    \n
  • running (default): A spinner icon is shown.
  • \n
  • complete: A checkmark icon is shown.
  • \n
  • error: An error icon is shown.
  • \n
\n", - "default": null - } - ], - "returns": [ - { - "type_name": "StatusContainer", - "is_generator": false, - "description": "

A mutable status container that can hold multiple elements. The label, state,\nand expanded state can be updated after creation via .update().

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/layouts.py#L414" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/__init__.py#L401" }, "streamlit.stop": { "name": "stop", "signature": "st.stop()", - "example": "
\n
\nimport streamlit as st\n\nname = st.text_input('Name')\nif not name:\n  st.warning('Please input a name.')\n  st.stop()\nst.success('Thank you for inputting a name.')\n
\n
\n", + "example": "
\n
\nname = st.text_input('Name')\nif not name:\n  st.warning('Please input a name.')\n  st.stop()\nst.success('Thank you for inputting a name.')\n
\n
\n", "description": "

Stops execution immediately.

\n

Streamlit will not run any statements after st.stop().\nWe recommend rendering a message to explain why the script has stopped.\nWhen run outside of Streamlit, this will raise an Exception.

\n", "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/commands/execution_control.py#L26" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/__init__.py#L503" }, "streamlit.subheader": { "name": "subheader", - "signature": "st.subheader(body, anchor=None, *, help=None, divider=False)", - "examples": "
\n
\nimport streamlit as st\n\nst.subheader('This is a subheader with a divider', divider='rainbow')\nst.subheader('_Streamlit_ is :blue[cool] :sunglasses:')\n
\n\n \n
\n", - "description": "

Display text in subheader formatting.

\n", + "signature": "st.subheader(body, anchor=None)", + "example": "
\n
\nst.subheader('This is a subheader')\n
\n
\n", + "description": "Display text in subheader formatting.", "args": [ { "name": "body", "type_name": "str", "is_optional": false, - "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", + "description": "

The text to display.

\n", "default": null }, { "name": "anchor", - "type_name": "str or False", - "is_optional": false, - "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", - "default": null - }, - { - "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the subheader.

\n", - "default": null - }, - { - "name": "divider", - "type_name": "bool or \u201cblue\u201d, \u201cgreen\u201d, \u201corange\u201d, \u201cred\u201d, \u201cviolet\u201d, \u201cgray\u201d/\"grey\", or \u201crainbow\u201d", - "is_optional": false, - "description": "

Shows a colored divider below the header. If True, successive\nheaders will cycle through divider colors. That is, the first\nheader will have a blue line, the second header will have a\ngreen line, and so on. If a string, the color can be set to one of\nthe following: blue, green, orange, red, violet, gray/grey, or\nrainbow.

\n", + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/heading.py#L111" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/heading.py#L53" }, "streamlit.success": { "name": "success", "signature": "st.success(body, *, icon=None)", - "example": "
\n
\nimport streamlit as st\n\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", - "description": "

Display a success message.

\n", + "example": "
\n
\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", + "description": "Display a success message.", "args": [ + { + "name": "icon", + "type_name": "None", + "is_optional": false, + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" + }, { "name": "body", "type_name": "str", "is_optional": false, "description": "

The success text to display.

\n", "default": null - }, - { - "name": "icon", - "type_name": "str or None", - "is_optional": false, - "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", - "default": "None" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/alert.py#L124" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/alert.py#L129" }, "streamlit.table": { "name": "table", "signature": "st.table(data=None)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n
\n", + "example": "
\n
\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", "args": [ { "name": "data", - "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", "is_optional": false, - "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L193" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/dataframe_selector.py#L112" }, "streamlit.tabs": { "name": "tabs", "signature": "st.tabs(tabs)", - "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\nimport streamlit as st\n\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n
\n", + "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", "args": [ { "name": "tabs", "type_name": "list of strings", "is_optional": false, - "description": "

Creates a tab for each string in the list. The first tab is selected by default.\nThe string is used as the name of the tab and can optionally contain Markdown,\nsupporting the following elements: Bold, Italics, Strikethroughs, Inline Code,\nEmojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "description": "

Creates a tab for each string in the list. The string is used as the name of the tab.\nThe first tab is selected by default.

\n", "default": null } ], @@ -15346,13 +13753,13 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/layouts.py#L207" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/layouts.py#L199" }, "streamlit.text": { "name": "text", - "signature": "st.text(body, *, help=None)", - "example": "
\n
\nimport streamlit as st\n\nst.text('This is some text.')\n
\n
\n", - "description": "

Write fixed-width and preformatted text.

\n", + "signature": "st.text(body)", + "example": "
\n
\nst.text('This is some text.')\n
\n
\n", + "description": "Write fixed-width and preformatted text.", "args": [ { "name": "body", @@ -15360,29 +13767,22 @@ "is_optional": false, "description": "

The string to display.

\n", "default": null - }, - { - "name": "help", - "type_name": "str", - "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the text.

\n", - "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/text.py#L27" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/text.py#L27" }, "streamlit.text_area": { "name": "text_area", "signature": "st.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", - "description": "

Display a multi-line text input widget.

\n", + "example": "
\n
\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", + "description": "Display a multi-line text input widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this input is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { @@ -15457,9 +13857,9 @@ }, { "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", "default": "is" } ], @@ -15471,19 +13871,19 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/text_widgets.py#L288" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/text_widgets.py#L250" }, "streamlit.text_input": { "name": "text_input", "signature": "st.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n
\n", - "description": "

Display a single-line text input widget.

\n", + "example": "
\n
\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a single-line text input widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this input is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { @@ -15509,7 +13909,7 @@ }, { "name": "type", - "type_name": "\"default\" or \"password\"", + "type_name": "str", "is_optional": false, "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", "default": "s" @@ -15532,7 +13932,7 @@ "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this text input's value changes.

\n", + "description": "

An optional callback invoked when this text_input's value changes.

\n", "default": null }, { @@ -15565,9 +13965,9 @@ }, { "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", "default": "is" } ], @@ -15579,19 +13979,19 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/text_widgets.py#L72" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/text_widgets.py#L70" }, "streamlit.time_input": { "name": "time_input", - "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", step=0:15:00)", - "example": "
\n
\nimport datetime\nimport streamlit as st\n\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n
\n", - "description": "

Display a time input widget.

\n", + "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a time input widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this time input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this time input is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { @@ -15645,17 +14045,10 @@ }, { "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", "default": "is" - }, - { - "name": "step", - "type_name": "int or timedelta", - "is_optional": false, - "description": "

The stepping interval in seconds. Defaults to 900, i.e. 15 minutes.\nYou can also pass a datetime.timedelta object.

\n", - "default": "900" } ], "returns": [ @@ -15666,154 +14059,43 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/time_widgets.py#L219" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/time_widgets.py#L218" }, "streamlit.title": { "name": "title", - "signature": "st.title(body, anchor=None, *, help=None)", - "examples": "
\n
\nimport streamlit as st\n\nst.title('This is a title')\nst.title('_Streamlit_ is :blue[cool] :sunglasses:')\n
\n\n \n
\n", + "signature": "st.title(body, anchor=None)", + "example": "
\n
\nst.title('This is a title')\n
\n
\n", "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", "args": [ { "name": "body", "type_name": "str", "is_optional": false, - "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", + "description": "

The text to display.

\n", "default": null }, { "name": "anchor", - "type_name": "str or False", - "is_optional": false, - "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", - "default": null - }, - { - "name": "help", - "type_name": "str", - "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the title.

\n", - "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/heading.py#L181" - }, - "streamlit.toast": { - "name": "toast", - "signature": "st.toast(body, *, icon=None)", - "example": "
\n
\nimport streamlit as st\n\nst.toast('Your edited image was saved!', icon='\ud83d\ude0d')\n
\n
\n", - "description": "

Display a short message, known as a notification "toast".

\n

The toast appears in the app's bottom-right corner and disappears after four seconds.

\n
\n

Warning

\n

st.toast is not compatible with Streamlit's caching and\ncannot be called within a cached function.

\n
\n", - "args": [ - { - "name": "body", "type_name": "str", "is_optional": false, - "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", "default": null - }, - { - "name": "icon", - "type_name": "str or None", - "is_optional": false, - "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the toast. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", - "default": "None" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/toast.py#L37" - }, - "streamlit.toggle": { - "name": "toggle", - "signature": "st.toggle(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\non = st.toggle('Activate feature')\n\nif on:\n    st.write('Feature activated!')\n
\n\n \n
\n", - "description": "

Display a toggle widget.

\n", - "args": [ - { - "name": "label", - "type_name": "str", - "is_optional": false, - "description": "

A short label explaining to the user what this toggle is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", - "default": null - }, - { - "name": "value", - "type_name": "bool", - "is_optional": false, - "description": "

Preselect the toggle when it first renders. This will be\ncast to bool internally.

\n", - "default": null - }, - { - "name": "key", - "type_name": "str or int", - "is_optional": false, - "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", - "default": null - }, - { - "name": "help", - "type_name": "str", - "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the toggle.

\n", - "default": null - }, - { - "name": "on_change", - "type_name": "callable", - "is_optional": false, - "description": "

An optional callback invoked when this toggle's value changes.

\n", - "default": null - }, - { - "name": "args", - "type_name": "tuple", - "is_optional": false, - "description": "

An optional tuple of args to pass to the callback.

\n", - "default": null - }, - { - "name": "kwargs", - "type_name": "dict", - "is_optional": false, - "description": "

An optional dict of kwargs to pass to the callback.

\n", - "default": null - }, - { - "name": "disabled", - "type_name": "bool", - "is_optional": false, - "description": "

An optional boolean, which disables the toggle if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", - "default": "False" - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" - } - ], - "returns": [ - { - "type_name": "bool", - "is_generator": false, - "description": "

Whether or not the toggle is checked.

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/checkbox.py#L156" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/heading.py#L81" }, "streamlit.vega_lite_chart": { "name": "vega_lite_chart", - "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, theme=\"streamlit\", **kwargs)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(chart_data, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", - "description": "

Display a chart using the Vega-Lite library.

\n", + "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, **kwargs)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(df, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", + "description": "Display a chart using the Vega-Lite library.", "args": [ { "name": "data", "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", "is_optional": false, - "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null }, { @@ -15830,13 +14112,6 @@ "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", "default": null }, - { - "name": "theme", - "type_name": "\"streamlit\" or None", - "is_optional": false, - "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", - "default": "behavior" - }, { "name": "**kwargs", "type_name": "any", @@ -15846,19 +14121,19 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L819" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/dataframe_selector.py#L443" }, "streamlit.video": { "name": "video", "signature": "st.video(data, format=\"video/mp4\", start_time=0)", - "example": "
\n
\nimport streamlit as st\n\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", - "description": "

Display a video player.

\n", + "example": "
\n
\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", + "description": "Display a video player.", "args": [ { "name": "data", - "type_name": "str, bytes, BytesIO, numpy.ndarray, or file", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", "is_optional": false, - "description": "

Raw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "description": "

io.open().\nRaw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", "default": null }, { @@ -15877,1517 +14152,1506 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/media.py#L115" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/media.py#L81" }, "streamlit.warning": { "name": "warning", "signature": "st.warning(body, *, icon=None)", - "example": "
\n
\nimport streamlit as st\n\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", - "description": "

Display warning message.

\n", + "example": "
\n
\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", + "description": "Display warning message.", "args": [ + { + "name": "icon", + "type_name": "None", + "is_optional": false, + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" + }, { "name": "body", "type_name": "str", "is_optional": false, "description": "

The warning text to display.

\n", "default": null - }, - { - "name": "icon", - "type_name": "str or None", - "is_optional": false, - "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", - "default": "None" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/alert.py#L59" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/alert.py#L68" }, "streamlit.write": { "name": "write", - "signature": "st.write(*args, unsafe_allow_html=False, **kwargs)", - "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nimport streamlit as st\n\nst.write('Hello, *World!* :sunglasses:')\n
\n\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nimport streamlit as st\nimport pandas as pd\n\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nimport streamlit as st\n\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n
\n", + "signature": "st.write(*args, **kwargs)", + "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nwrite('Hello, *World!* :sunglasses:')\n
\n\n \n \n (view standalone Streamlit app)\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n \n (view standalone Streamlit app)\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n \n (view standalone Streamlit app)\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", "args": [ { "name": "*args", "type_name": "any", "is_optional": false, - "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression, emoji shortcodes, and colored text.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(class) : Displays information about a class.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", + "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression and emoji shortcodes.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", "default": null }, { "name": "unsafe_allow_html", "type_name": "bool", "is_optional": false, - "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n

Also note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.

\n

If you decide to turn on HTML anyway, we ask you to please tell us your\nexact use case here:\nhttps://discuss.streamlit.io/t/96 .

\n

This will help us come up with safe APIs that allow you to do what you\nwant.

\n", "default": "False" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/write.py#L49" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/write.py#L44" }, "streamlit.experimental_memo.clear": { "name": "experimental_memo.clear", "signature": "st.experimental_memo.clear()", - "description": "

Clear all in-memory and on-disk data caches.

\n", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/runtime/caching/cache_data_api.py#L587" - }, - "streamlit.cache_data.clear": { - "name": "cache_data.clear", - "signature": "st.cache_data.clear()", - "description": "

Clear all in-memory and on-disk data caches.

\n", + "description": "Clear all in-memory and on-disk memo caches.", "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/runtime/caching/cache_data_api.py#L587" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/runtime/caching/memo_decorator.py#L376" }, "streamlit.experimental_singleton.clear": { "name": "experimental_singleton.clear", "signature": "st.experimental_singleton.clear()", - "description": "

Clear all cache_resource caches.

\n", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/runtime/caching/cache_resource_api.py#L449" - }, - "streamlit.cache_resource.clear": { - "name": "cache_resource.clear", - "signature": "st.cache_resource.clear()", - "description": "

Clear all cache_resource caches.

\n", + "description": "Clear all singleton caches.", "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/runtime/caching/cache_resource_api.py#L449" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/runtime/caching/singleton_decorator.py#L251" }, - "streamlit.connections.ExperimentalBaseConnection": { - "name": "ExperimentalBaseConnection", - "signature": "st.connections.ExperimentalBaseConnection(connection_name, **kwargs)", - "is_class": true, - "methods": [ + "streamlit.components.v1.declare_component": { + "name": "declare_component", + "signature": "st.components.v1.declare_component(name, path=None, url=None)", + "description": "Create and register a custom component.", + "args": [ { - "name": "reset", - "signature": "st.connections.reset.reset()", - "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", - "description": "

Reset this connection so that it gets reinitialized the next time it's used.

", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/base_connection.py#L137" - } - ], - "properties": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/base_connection.py#L25", - "description": "

The abstract base class that all Streamlit Connections must inherit from.

\n

This base class provides connection authors with a standardized way to hook into the\nst.experimental_connection() factory function: connection authors are required to\nprovide an implementation for the abstract method _connect in their subclasses.

\n

Additionally, it also provides a few methods/properties designed to make\nimplementation of connections more convenient. See the docstrings for each of the\nmethods of this class for more information

\n
\n

Note

\n

While providing an implementation of _connect is technically all that's\nrequired to define a valid connection, connections should also provide the user\nwith context-specific ways of interacting with the underlying connection object.\nFor example, the first-party SQLConnection provides a query() method for\nreads and a session property for more complex operations.

\n
\n", - "args": [], - "returns": [] - }, - "streamlit.connections.SQLConnection": { - "name": "SQLConnection", - "signature": "st.connections.SQLConnection(connection_name, **kwargs)", - "is_class": true, - "methods": [ + "name": "name", + "type_name": "str", + "is_optional": false, + "description": "

A short, descriptive name for the component. Like, "slider".

\n", + "default": null + }, { - "name": "query", - "signature": "st.connections.query.query(sql, *, ttl=None, index_col=None, chunksize=None, params=None, **kwargs)", - "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("sql")\ndf = conn.query("select * from pet_owners where owner = :owner", ttl=3600, params={"owner":"barbara"})\nst.dataframe(df)\n
\n
\n", - "description": "

Run a read-only query.

", - "args": [ - { - "name": "sql", - "type_name": "str", - "is_optional": false, - "description": "

The read-only SQL query to execute.

\n", - "default": null - }, - { - "name": "ttl", - "type_name": "float, int, timedelta or None", - "is_optional": false, - "description": "

The maximum number of seconds to keep results in the cache, or\nNone if cached results should not expire. The default is None.

\n", - "default": "None" - }, - { - "name": "index_col", - "type_name": "str, list of str, or None", - "is_optional": false, - "description": "

Column(s) to set as index(MultiIndex). Default is None.

\n", - "default": "None" - }, - { - "name": "chunksize", - "type_name": "int or None", - "is_optional": false, - "description": "

If specified, return an iterator where chunksize is the number of\nrows to include in each chunk. Default is None.

\n", - "default": "None" - }, - { - "name": "params", - "type_name": "list, tuple, dict or None", - "is_optional": false, - "description": "

List of parameters to pass to the execute method. The syntax used to pass\nparameters is database driver dependent. Check your database driver\ndocumentation for which of the five syntax styles, described in PEP 249\nparamstyle, is supported.\nDefault is None.

\n", - "default": "None" - }, - { - "name": "**kwargs", - "type_name": "dict", - "is_optional": false, - "description": "

Additional keyword arguments are passed to pd.read_sql.

\n", - "default": null - } - ], - "returns": [ - { - "type_name": "pd.DataFrame", - "is_generator": false, - "description": "

The result of running the query, formatted as a pandas DataFrame.

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/sql_connection.py#L121" + "name": "path", + "type_name": "str or None", + "is_optional": false, + "description": "

The path to serve the component's frontend files from. Either\npath or url must be specified, but not both.

\n", + "default": null }, { - "name": "reset", - "signature": "st.connections.reset.reset()", - "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", - "description": "

Reset this connection so that it gets reinitialized the next time it's used.

", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/base_connection.py#L137" + "name": "url", + "type_name": "str or None", + "is_optional": false, + "description": "

The URL that the component is served from. Either path or url\nmust be specified, but not both.

\n", + "default": null } ], - "properties": [ + "returns": [ { - "name": "session", - "signature": "st.connections.session.session", - "example": "
\n
\nimport streamlit as st\nconn = st.experimental_connection("sql")\nn = st.slider("Pick a number")\nif st.button("Add the number!"):\n    with conn.session as session:\n        session.execute("INSERT INTO numbers (val) VALUES (:n);", {"n": n})\n        session.commit()\n
\n
\n", - "description": "

Return a SQLAlchemy Session.

", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/sql_connection.py#L226" + "type_name": "CustomComponent", + "is_generator": false, + "description": "

A CustomComponent that can be called like a function.\nCalling the component will create a new instance of the component\nin the Streamlit app.

\n", + "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/sql_connection.py#L45", - "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("sql")\ndf = conn.query("select * from pet_owners")\nst.dataframe(df)\n
\n
\n", - "description": "

A connection to a SQL database using a SQLAlchemy Engine. Initialize using st.experimental_connection("<name>", type="sql").

\n

SQLConnection provides the query() convenience method, which can be used to\nrun simple read-only queries with both caching and simple error handling/retries.\nMore complex DB interactions can be performed by using the .session property\nto receive a regular SQLAlchemy Session.

\n

SQLConnections should always be created using st.experimental_connection(),\nnot initialized directly. Connection parameters for a SQLConnection can be\nspecified using either st.secrets or **kwargs. Some frequently used\nparameters include:

\n
    \n
  • url or arguments for sqlalchemy.engine.URL.create().\nMost commonly it includes a dialect, host, database, username and password.
  • \n
  • create_engine_kwargs can be passed via st.secrets, such as for\nsnowflake-sqlalchemy\nor Google BigQuery.\nThese can also be passed directly as **kwargs to experimental_connection().
  • \n
  • autocommit=True to run with isolation level AUTOCOMMIT. Default is False.
  • \n
\n", - "args": [], - "returns": [] + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/components/v1/components.py#L245" }, - "streamlit.connections.SnowparkConnection": { - "name": "SnowparkConnection", - "signature": "st.connections.SnowparkConnection(connection_name, **kwargs)", - "is_class": true, - "methods": [ + "streamlit.components.v1.html": { + "name": "html", + "signature": "st.components.v1.html(html, width=None, height=None, scrolling=False)", + "description": "Display an HTML string in an iframe.", + "args": [ { - "name": "query", - "signature": "st.connections.query.query(sql, ttl=None)", - "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("snowpark")\ndf = conn.query("select * from pet_owners")\nst.dataframe(df)\n
\n
\n", - "description": "

Run a read-only SQL query.

", - "args": [ - { - "name": "sql", - "type_name": "str", - "is_optional": false, - "description": "

The read-only SQL query to execute.

\n", - "default": null - }, - { - "name": "ttl", - "type_name": "float, int, timedelta or None", - "is_optional": false, - "description": "

The maximum number of seconds to keep results in the cache, or\nNone if cached results should not expire. The default is None.

\n", - "default": "None" - } - ], - "returns": [ - { - "type_name": "pd.DataFrame", - "is_generator": false, - "description": "

The result of running the query, formatted as a pandas DataFrame.

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/snowpark_connection.py#L123" + "name": "html", + "type_name": "str", + "is_optional": false, + "description": "

The HTML string to embed in the iframe.

\n", + "default": null }, { - "name": "reset", - "signature": "st.connections.reset.reset()", - "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", - "description": "

Reset this connection so that it gets reinitialized the next time it's used.

", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/base_connection.py#L137" + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", + "default": "the" }, { - "name": "safe_session", - "signature": "st.connections.safe_session.safe_session()", - "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("snowpark")\nwith conn.safe_session() as session:\n    df = session.table("mytable").limit(10).to_pandas()\n\nst.dataframe(df)\n
\n
\n", - "description": "

Grab the underlying Snowpark session in a thread-safe manner.

", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/snowpark_connection.py#L207" - } - ], - "properties": [ + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", + "default": "150" + }, { - "name": "session", - "signature": "st.connections.session.session", - "example": "
\n
\nimport streamlit as st\n\nsession = st.experimental_connection("snowpark").session\ndf = session.table("mytable").limit(10).to_pandas()\nst.dataframe(df)\n
\n
\n", - "description": "

Access the underlying Snowpark session.

", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/snowpark_connection.py#L184" + "name": "scrolling", + "type_name": "bool", + "is_optional": false, + "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", + "default": "False" } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/snowpark_connection.py#L70", - "description": "

A connection to Snowpark using snowflake.snowpark.session.Session. Initialize using

\n

st.experimental_connection("<name>", type="snowpark").

\n

In addition to accessing the Snowpark Session, SnowparkConnection supports direct SQL querying using\nquery("...") and thread safe access using with conn.safe_session():. See methods\nbelow for more information. SnowparkConnections should always be created using\nst.experimental_connection(), not initialized directly.

\n
\n

Note

\n

We don't expect this iteration of SnowparkConnection to be able to scale\nwell in apps with many concurrent users due to the lock contention that will occur\nover the single underlying Session object under high load.

\n
\n", - "args": [], - "returns": [] + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/iframe.py#L59" }, - "streamlit.connections.SQLConnection.query": { - "name": "query", - "signature": "SQLConnection.query(sql, *, ttl=None, index_col=None, chunksize=None, params=None, **kwargs)", - "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("sql")\ndf = conn.query("select * from pet_owners where owner = :owner", ttl=3600, params={"owner":"barbara"})\nst.dataframe(df)\n
\n
\n", - "description": "

Run a read-only query.

\n

This method implements both query result caching (with caching behavior\nidentical to that of using @st.cache_data) as well as simple error handling/retries.

\n
\n

Note

\n

Queries that are run without a specified ttl are cached indefinitely.

\n
\n

Aside from the ttl kwarg, all kwargs passed to this function are passed down\nto pd.read_sql\nand have the behavior described in the pandas documentation.

\n", + "streamlit.components.v1.iframe": { + "name": "iframe", + "signature": "st.components.v1.iframe(src, width=None, height=None, scrolling=False)", + "description": "Load a remote URL in an iframe.", "args": [ { - "name": "sql", + "name": "src", "type_name": "str", "is_optional": false, - "description": "

The read-only SQL query to execute.

\n", + "description": "

The URL of the page to embed.

\n", "default": null }, { - "name": "ttl", - "type_name": "float, int, timedelta or None", + "name": "width", + "type_name": "int", "is_optional": false, - "description": "

The maximum number of seconds to keep results in the cache, or\nNone if cached results should not expire. The default is None.

\n", - "default": "None" + "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", + "default": "the" }, { - "name": "index_col", - "type_name": "str, list of str, or None", + "name": "height", + "type_name": "int", "is_optional": false, - "description": "

Column(s) to set as index(MultiIndex). Default is None.

\n", - "default": "None" + "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", + "default": "150" }, { - "name": "chunksize", - "type_name": "int or None", + "name": "scrolling", + "type_name": "bool", "is_optional": false, - "description": "

If specified, return an iterator where chunksize is the number of\nrows to include in each chunk. Default is None.

\n", - "default": "None" - }, + "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", + "default": "False" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/iframe.py#L25" + }, + "DeltaGenerator.add_rows": { + "name": "add_rows", + "signature": "element.add_rows(self, data=None, **kwargs)", + "example": "
\n
\ndf1 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table = st.table(df1)\n\ndf2 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table.add_rows(df2)\n# Now the table shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

You can do the same thing with plots. For example, if you want to add\nmore data to a line chart:

\n
\n# Assuming df1 and df2 from the example above still exist...\nmy_chart = st.line_chart(df1)\nmy_chart.add_rows(df2)\n# Now the chart shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

And for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:

\n
\nmy_chart = st.vega_lite_chart({\n    'mark': 'line',\n    'encoding': {'x': 'a', 'y': 'b'},\n    'datasets': {\n      'some_fancy_name': df1,  # <-- named dataset\n     },\n    'data': {'name': 'some_fancy_name'},\n}),\nmy_chart.add_rows(some_fancy_name=df2)  # <-- name used as keyword\n
\n
\n", + "description": "Concatenate a dataframe to the bottom of the current one.", + "args": [ { - "name": "params", - "type_name": "list, tuple, dict or None", + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", "is_optional": false, - "description": "

List of parameters to pass to the execute method. The syntax used to pass\nparameters is database driver dependent. Check your database driver\ndocumentation for which of the five syntax styles, described in PEP 249\nparamstyle, is supported.\nDefault is None.

\n", - "default": "None" + "description": "

Table to concat. Optional.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null }, { "name": "**kwargs", - "type_name": "dict", + "type_name": "pandas.DataFrame, numpy.ndarray, Iterable, dict, or None", "is_optional": false, - "description": "

Additional keyword arguments are passed to pd.read_sql.

\n", + "description": "

The named dataset to concat. Optional. You can only pass in 1\ndataset (including the one in the data parameter).

\n", "default": null } ], - "returns": [ - { - "type_name": "pd.DataFrame", - "is_generator": false, - "description": "

The result of running the query, formatted as a pandas DataFrame.

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/sql_connection.py#L121" - }, - "streamlit.connections.SQLConnection.reset": { - "name": "reset", - "signature": "SQLConnection.reset()", - "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", - "description": "

Reset this connection so that it gets reinitialized the next time it's used.

\n

This method can be useful when a connection has become stale, an auth token has\nexpired, or in similar scenarios where a broken connection might be fixed by\nreinitializing it. Note that some connection methods may already use reset()\nin their error handling code.

\n", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/base_connection.py#L137" - }, - "streamlit.connections.SQLConnection.session": { - "name": "session", - "signature": "SQLConnection.session", - "example": "
\n
\nimport streamlit as st\nconn = st.experimental_connection("sql")\nn = st.slider("Pick a number")\nif st.button("Add the number!"):\n    with conn.session as session:\n        session.execute("INSERT INTO numbers (val) VALUES (:n);", {"n": n})\n        session.commit()\n
\n
\n", - "description": "

Return a SQLAlchemy Session.

\n

Users of this connection should use the contextmanager pattern for writes,\ntransactions, and anything more complex than simple read queries.

\n

See the usage example below, which assumes we have a table numbers with a\nsingle integer column val. The SQLAlchemy docs also contain\nmuch more information on the usage of sessions.

\n", - "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/sql_connection.py#L226" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/dataframe_selector.py#L513" }, - "streamlit.connections.SnowparkConnection.query": { - "name": "query", - "signature": "SnowparkConnection.query(sql, ttl=None)", - "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("snowpark")\ndf = conn.query("select * from pet_owners")\nst.dataframe(df)\n
\n
\n", - "description": "

Run a read-only SQL query.

\n

This method implements both query result caching (with caching behavior\nidentical to that of using @st.cache_data) as well as simple error handling/retries.

\n
\n

Note

\n

Queries that are run without a specified ttl are cached indefinitely.

\n
\n", + "DeltaGenerator.altair_chart": { + "name": "altair_chart", + "signature": "element.altair_chart(self, altair_chart, use_container_width=False)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a chart using the Altair library.", "args": [ { - "name": "sql", - "type_name": "str", + "name": "altair_chart", + "type_name": "altair.vegalite.v2.api.Chart", "is_optional": false, - "description": "

The read-only SQL query to execute.

\n", + "description": "

The Altair chart object to display.

\n", "default": null }, { - "name": "ttl", - "type_name": "float, int, timedelta or None", + "name": "use_container_width", + "type_name": "bool", "is_optional": false, - "description": "

The maximum number of seconds to keep results in the cache, or\nNone if cached results should not expire. The default is None.

\n", - "default": "None" - } - ], - "returns": [ - { - "type_name": "pd.DataFrame", - "is_generator": false, - "description": "

The result of running the query, formatted as a pandas DataFrame.

\n", - "return_name": null + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", + "default": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/snowpark_connection.py#L123" - }, - "streamlit.connections.SnowparkConnection.reset": { - "name": "reset", - "signature": "SnowparkConnection.reset()", - "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", - "description": "

Reset this connection so that it gets reinitialized the next time it's used.

\n

This method can be useful when a connection has become stale, an auth token has\nexpired, or in similar scenarios where a broken connection might be fixed by\nreinitializing it. Note that some connection methods may already use reset()\nin their error handling code.

\n", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/base_connection.py#L137" - }, - "streamlit.connections.SnowparkConnection.safe_session": { - "name": "safe_session", - "signature": "SnowparkConnection.safe_session()", - "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("snowpark")\nwith conn.safe_session() as session:\n    df = session.table("mytable").limit(10).to_pandas()\n\nst.dataframe(df)\n
\n
\n", - "description": "

Grab the underlying Snowpark session in a thread-safe manner.

\n

As operations on a Snowpark session are not thread safe, we need to take care\nwhen using a session in the context of a Streamlit app where each script run\noccurs in its own thread. Using the contextmanager pattern to do this ensures\nthat access on this connection's underlying Session is done in a thread-safe\nmanner.

\n

Information on how to use Snowpark sessions can be found in the Snowpark documentation.

\n", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/snowpark_connection.py#L207" - }, - "streamlit.connections.SnowparkConnection.session": { - "name": "session", - "signature": "SnowparkConnection.session", - "example": "
\n
\nimport streamlit as st\n\nsession = st.experimental_connection("snowpark").session\ndf = session.table("mytable").limit(10).to_pandas()\nst.dataframe(df)\n
\n
\n", - "description": "

Access the underlying Snowpark session.

\n
\n

Note

\n

Snowpark sessions are not thread safe. Users of this method are\nresponsible for ensuring that access to the session returned by this method is\ndone in a thread-safe manner. For most users, we recommend using the thread-safe\nsafe_session() method and a with block.

\n
\n

Information on how to use Snowpark sessions can be found in the Snowpark documentation.

\n", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/snowpark_connection.py#L184" - }, - "streamlit.connections.ExperimentalBaseConnection.reset": { - "name": "reset", - "signature": "ExperimentalBaseConnection.reset()", - "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", - "description": "

Reset this connection so that it gets reinitialized the next time it's used.

\n

This method can be useful when a connection has become stale, an auth token has\nexpired, or in similar scenarios where a broken connection might be fixed by\nreinitializing it. Note that some connection methods may already use reset()\nin their error handling code.

\n", - "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/connections/base_connection.py#L137" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/dataframe_selector.py#L396" }, - "streamlit.column_config.BarChartColumn": { - "name": "BarChartColumn", - "signature": "st.column_config.BarChartColumn(label=None, *, width=None, help=None, y_min=None, y_max=None)", - "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "sales": [\n            [0, 4, 26, 80, 100, 40],\n            [80, 20, 80, 35, 40, 100],\n            [10, 20, 80, 80, 70, 0],\n            [10, 100, 20, 100, 30, 100],\n        ],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "sales": st.column_config.BarChartColumn(\n            "Sales (last 6 months)",\n            help="The sales volume in the last 6 months",\n            y_min=0,\n            y_max=100,\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Configure a bar chart column in st.dataframe or st.data_editor.

\n

Cells need to contain a list of numbers. Chart columns are not editable\nat the moment. This command needs to be used in the column_config parameter\nof st.dataframe or st.data_editor.

\n", + "DeltaGenerator.area_chart": { + "name": "area_chart", + "signature": "element.area_chart(self, data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", "args": [ { - "name": "label", + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", "type_name": "str or None", "is_optional": false, - "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", "default": null }, { - "name": "width", - "type_name": "\"small\", \"medium\", \"large\", or None", + "name": "y", + "type_name": "str, sequence of str, or None", "is_optional": false, - "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", "default": null }, { - "name": "help", - "type_name": "str or None", + "name": "width", + "type_name": "int", "is_optional": false, - "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", "default": null }, { - "name": "y_min", - "type_name": "int, float, or None", + "name": "height", + "type_name": "int", "is_optional": false, - "description": "

The minimum value on the y-axis for all cells in the column.\nIf None (default), every cell will use the minimum of its data.

\n", + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", "default": null }, { - "name": "y_max", - "type_name": "int, float, or None", + "name": "use_container_width", + "type_name": "bool", "is_optional": false, - "description": "

The maximum value on the y-axis for all cells in the column. If None (default),\nevery cell will use the maximum of its data.

\n", + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/lib/column_types.py#L746" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/dataframe_selector.py#L229" }, - "streamlit.column_config.CheckboxColumn": { - "name": "CheckboxColumn", - "signature": "st.column_config.CheckboxColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None)", - "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "widgets": ["st.selectbox", "st.number_input", "st.text_area", "st.button"],\n        "favorite": [True, False, False, True],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "favorite": st.column_config.CheckboxColumn(\n            "Your favorite?",\n            help="Select your **favorite** widgets",\n            default=False,\n        )\n    },\n    disabled=["widgets"],\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Configure a checkbox column in st.dataframe or st.data_editor.

\n

This is the default column type for boolean values. This command needs to be used in\nthe column_config parameter of st.dataframe or st.data_editor.\nWhen used with st.data_editor, editing will be enabled with a checkbox widget.

\n", + "DeltaGenerator.audio": { + "name": "audio", + "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0)", + "example": "
\n
\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an audio player.", "args": [ { - "name": "label", - "type_name": "str or None", - "is_optional": false, - "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", - "default": null - }, - { - "name": "width", - "type_name": "\"small\", \"medium\", \"large\", or None", + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", "is_optional": false, - "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "description": "

io.open().\nRaw audio data, filename, or a URL pointing to the file to load.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", "default": null }, { - "name": "help", - "type_name": "str or None", + "name": "start_time", + "type_name": "int", "is_optional": false, - "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "description": "

The time from which this element should start playing.

\n", "default": null }, { - "name": "disabled", - "type_name": "bool or None", - "is_optional": false, - "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", - "default": "False" - }, - { - "name": "required", - "type_name": "bool or None", - "is_optional": false, - "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", - "default": "False" - }, - { - "name": "default", - "type_name": "bool or None", + "name": "format", + "type_name": "str", "is_optional": false, - "description": "

Specifies the default value in this column when a new row is added by the user.

\n", - "default": "value" + "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/lib/column_types.py#L565" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/media.py#L42" }, - "streamlit.column_config.Column": { - "name": "Column", - "signature": "st.column_config.Column(label=None, *, width=None, help=None, disabled=None, required=None)", - "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "widgets": ["st.selectbox", "st.number_input", "st.text_area", "st.button"],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "widgets": st.column_config.Column(\n            "Streamlit Widgets",\n            help="Streamlit **widget** commands \ud83c\udf88",\n            width="medium",\n            required=True,\n        )\n    },\n    hide_index=True,\n    num_rows="dynamic",\n)\n
\n\n \n
\n", - "description": "

Configure a generic column in st.dataframe or st.data_editor.

\n

The type of the column will be automatically inferred from the data type.\nThis command needs to be used in the column_config parameter of st.dataframe\nor st.data_editor.

\n

To change the type of the column and enable type-specific configuration options,\nuse one of the column types in the st.column_config namespace,\ne.g. st.column_config.NumberColumn.

\n", + "DeltaGenerator.balloons": { + "name": "balloons", + "signature": "element.balloons(self)", + "example": "
\n
\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", + "description": "Draw celebratory balloons.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/balloons.py#L25" + }, + "DeltaGenerator.bar_chart": { + "name": "bar_chart", + "signature": "element.bar_chart(self, data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nchart_data = pd.DataFrame(\n    np.random.randn(50, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", "args": [ { - "name": "label", + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", "type_name": "str or None", "is_optional": false, - "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", "default": null }, { "name": "width", - "type_name": "\"small\", \"medium\", \"large\", or None", + "type_name": "int", "is_optional": false, - "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", "default": null }, { - "name": "help", - "type_name": "str or None", + "name": "height", + "type_name": "int", "is_optional": false, - "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", "default": null }, { - "name": "disabled", - "type_name": "bool or None", + "name": "use_container_width", + "type_name": "bool", "is_optional": false, - "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", - "default": "False" + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/dataframe_selector.py#L312" + }, + "DeltaGenerator.beta_columns": { + "name": "beta_columns", + "signature": "element.beta_columns(*args, **kwargs)", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put columns inside another column.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null }, { - "name": "required", - "type_name": "bool or None", + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", "is_optional": false, - "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", - "default": "False" + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null } ], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/beta_util.py#L43" + }, + "DeltaGenerator.beta_container": { + "name": "beta_container", + "signature": "element.beta_container(*args, **kwargs)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/lib/column_types.py#L187" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/beta_util.py#L43" }, - "streamlit.column_config.DateColumn": { - "name": "DateColumn", - "signature": "st.column_config.DateColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, format=None, min_value=None, max_value=None, step=None)", - "examples": "
\n
\nfrom datetime import date\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "birthday": [\n            date(1980, 1, 1),\n            date(1990, 5, 3),\n            date(1974, 5, 19),\n            date(2001, 8, 17),\n        ]\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "birthday": st.column_config.DateColumn(\n            "Birthday",\n            min_value=date(1900, 1, 1),\n            max_value=date(2005, 1, 1),\n            format="DD.MM.YYYY",\n            step=1,\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Configure a date column in st.dataframe or st.data_editor.

\n

This is the default column type for date values. This command needs to be used in\nthe column_config parameter of st.dataframe or st.data_editor. When used\nwith st.data_editor, editing will be enabled with a date picker widget.

\n", + "DeltaGenerator.beta_expander": { + "name": "beta_expander", + "signature": "element.beta_expander(*args, **kwargs)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write("""\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    """)\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write("""\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n""")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", "args": [ { "name": "label", - "type_name": "str or None", + "type_name": "str", "is_optional": false, - "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "description": "

A string to use as the header for the expander.

\n", "default": null }, { - "name": "width", - "type_name": "\"small\", \"medium\", \"large\", or None", + "name": "expanded", + "type_name": "bool", "is_optional": false, - "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/beta_util.py#L43" + }, + "DeltaGenerator.bokeh_chart": { + "name": "bokeh_chart", + "signature": "element.bokeh_chart(self, figure, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", + "args": [ + { + "name": "figure", + "type_name": "bokeh.plotting.figure.Figure", + "is_optional": false, + "description": "

A Bokeh figure to plot.

\n", "default": null }, { - "name": "help", - "type_name": "str or None", + "name": "use_container_width", + "type_name": "bool", "is_optional": false, - "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Bokeh's native width value.

\n", "default": null - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/bokeh_chart.py#L34" + }, + "DeltaGenerator.button": { + "name": "button", + "signature": "element.button(self, label, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a button widget.", + "args": [ { - "name": "disabled", - "type_name": "bool or None", + "name": "label", + "type_name": "str", "is_optional": false, - "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", - "default": "False" + "description": "

A short label explaining to the user what this button is for.

\n", + "default": null }, { - "name": "required", - "type_name": "bool or None", + "name": "key", + "type_name": "str or int", "is_optional": false, - "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", - "default": "False" + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null }, { - "name": "default", - "type_name": "datetime.date or None", + "name": "help", + "type_name": "str", "is_optional": false, - "description": "

Specifies the default value in this column when a new row is added by the user.

\n", - "default": "value" + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null }, { - "name": "format", - "type_name": "str or None", + "name": "on_click", + "type_name": "callable", "is_optional": false, - "description": "

A momentJS format string controlling how times are displayed. See\nmomentJS docs for available\nformats. If None (default), uses YYYY-MM-DD.

\n", + "description": "

An optional callback invoked when this button is clicked.

\n", "default": null }, { - "name": "min_value", - "type_name": "datetime.date or None", + "name": "args", + "type_name": "tuple", "is_optional": false, - "description": "

The minimum date that can be entered.\nIf None (default), there will be no minimum.

\n", + "description": "

An optional tuple of args to pass to the callback.

\n", "default": null }, { - "name": "max_value", - "type_name": "datetime.date or None", + "name": "kwargs", + "type_name": "dict", "is_optional": false, - "description": "

The maximum date that can be entered.\nIf None (default), there will be no maximum.

\n", + "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, { - "name": "step", - "type_name": "int or None", + "name": "disabled", + "type_name": "bool", "is_optional": false, - "description": "

The stepping interval in days. If None (default), the step will be 1 day.

\n", - "default": null + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" } ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/lib/column_types.py#L1278" + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/button.py#L62" }, - "streamlit.column_config.DatetimeColumn": { - "name": "DatetimeColumn", - "signature": "st.column_config.DatetimeColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, format=None, min_value=None, max_value=None, step=None, timezone=None)", - "examples": "
\n
\nfrom datetime import datetime\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "appointment": [\n            datetime(2024, 2, 5, 12, 30),\n            datetime(2023, 11, 10, 18, 0),\n            datetime(2024, 3, 11, 20, 10),\n            datetime(2023, 9, 12, 3, 0),\n        ]\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "appointment": st.column_config.DatetimeColumn(\n            "Appointment",\n            min_value=datetime(2023, 6, 1),\n            max_value=datetime(2025, 1, 1),\n            format="D MMM YYYY, h:mm a",\n            step=60,\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Configure a datetime column in st.dataframe or st.data_editor.

\n

This is the default column type for datetime values. This command needs to be\nused in the column_config parameter of st.dataframe or\nst.data_editor. When used with st.data_editor, editing will be enabled\nwith a datetime picker widget.

\n", + "DeltaGenerator.camera_input": { + "name": "camera_input", + "signature": "element.camera_input(self, label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", + "description": "Display a widget that returns pictures from the user's webcam.", "args": [ { "name": "label", - "type_name": "str or None", + "type_name": "str", "is_optional": false, - "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "description": "

A short label explaining to the user what this widget is used for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { - "name": "width", - "type_name": "\"small\", \"medium\", \"large\", or None", + "name": "key", + "type_name": "str or int", "is_optional": false, - "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", "default": null }, { "name": "help", - "type_name": "str or None", + "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "description": "

A tooltip that gets displayed next to the camera input.

\n", "default": null }, { - "name": "disabled", - "type_name": "bool or None", + "name": "on_change", + "type_name": "callable", "is_optional": false, - "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", - "default": "False" - }, - { - "name": "required", - "type_name": "bool or None", - "is_optional": false, - "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", - "default": "False" - }, - { - "name": "default", - "type_name": "datetime.datetime or None", - "is_optional": false, - "description": "

Specifies the default value in this column when a new row is added by the user.

\n", - "default": "value" - }, - { - "name": "format", - "type_name": "str or None", - "is_optional": false, - "description": "

A momentJS format string controlling how datetimes are displayed. See\nmomentJS docs for available\nformats. If None (default), uses YYYY-MM-DD HH:mm:ss.

\n", + "description": "

An optional callback invoked when this camera_input's value\nchanges.

\n", "default": null }, { - "name": "min_value", - "type_name": "datetime.datetime or None", + "name": "args", + "type_name": "tuple", "is_optional": false, - "description": "

The minimum datetime that can be entered.\nIf None (default), there will be no minimum.

\n", + "description": "

An optional tuple of args to pass to the callback.

\n", "default": null }, { - "name": "max_value", - "type_name": "datetime.datetime or None", + "name": "kwargs", + "type_name": "dict", "is_optional": false, - "description": "

The maximum datetime that can be entered.\nIf None (default), there will be no maximum.

\n", + "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, { - "name": "step", - "type_name": "int, float, datetime.timedelta, or None", + "name": "disabled", + "type_name": "bool", "is_optional": false, - "description": "

The stepping interval in seconds. If None (default), the step will be 1 second.

\n", - "default": null + "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" }, { - "name": "timezone", - "type_name": "str or None", + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", "is_optional": false, - "description": "

The timezone of this column. If None (default),\nthe timezone is inferred from the underlying data.

\n", - "default": null + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" } ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/lib/column_types.py#L1043" + "returns": [ + { + "type_name": "None or UploadedFile", + "is_generator": false, + "description": "

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/camera_input.py#L122" }, - "streamlit.column_config.ImageColumn": { - "name": "ImageColumn", - "signature": "st.column_config.ImageColumn(label=None, *, width=None, help=None)", - "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "apps": [\n            "https://storage.googleapis.com/s4a-prod-share-preview/default/st_app_screenshot_image/5435b8cb-6c6c-490b-9608-799b543655d3/Home_Page.png",\n            "https://storage.googleapis.com/s4a-prod-share-preview/default/st_app_screenshot_image/ef9a7627-13f2-47e5-8f65-3f69bb38a5c2/Home_Page.png",\n            "https://storage.googleapis.com/s4a-prod-share-preview/default/st_app_screenshot_image/31b99099-8eae-4ff8-aa89-042895ed3843/Home_Page.png",\n            "https://storage.googleapis.com/s4a-prod-share-preview/default/st_app_screenshot_image/6a399b09-241e-4ae7-a31f-7640dc1d181e/Home_Page.png",\n        ],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "apps": st.column_config.ImageColumn(\n            "Preview Image", help="Streamlit app preview screenshots"\n        )\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Configure an image column in st.dataframe or st.data_editor.

\n

The cell values need to be one of:

\n
    \n
  • A URL to fetch the image from. This can also be a relative URL of an image\ndeployed via static file serving.\nNote that you can NOT use an arbitrary local image if it is not available through\na public URL.
  • \n
  • A data URL containing an SVG XML like data:image/svg+xml;utf8,<svg xmlns=...</svg>.
  • \n
  • A data URL containing a Base64 encoded image like data:image/png;base64,iVBO....
  • \n
\n

Image columns are not editable at the moment. This command needs to be used in the\ncolumn_config parameter of st.dataframe or st.data_editor.

\n", + "DeltaGenerator.caption": { + "name": "caption", + "signature": "element.caption(self, body, unsafe_allow_html=False)", + "example": "
\n
\nst.caption('This is a string that explains something above.')\n
\n
\n", + "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", "args": [ { - "name": "label", - "type_name": "str or None", - "is_optional": false, - "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", - "default": null - }, - { - "name": "width", - "type_name": "\"small\", \"medium\", \"large\", or None", + "name": "body", + "type_name": "str", "is_optional": false, - "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "description": "

The text to display.

\n", "default": null }, { - "name": "help", - "type_name": "str or None", + "name": "unsafe_allow_html", + "type_name": "bool", "is_optional": false, - "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n

Also note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.

\n

If you decide to turn on HTML anyway, we ask you to please tell us your\nexact use case here:\nhttps://discuss.streamlit.io/t/96 .

\n

This will help us come up with safe APIs that allow you to do what you\nwant.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/lib/column_types.py#L907" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/markdown.py#L118" }, - "streamlit.column_config.LineChartColumn": { - "name": "LineChartColumn", - "signature": "st.column_config.LineChartColumn(label=None, *, width=None, help=None, y_min=None, y_max=None)", - "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "sales": [\n            [0, 4, 26, 80, 100, 40],\n            [80, 20, 80, 35, 40, 100],\n            [10, 20, 80, 80, 70, 0],\n            [10, 100, 20, 100, 30, 100],\n        ],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "sales": st.column_config.LineChartColumn(\n            "Sales (last 6 months)",\n            width="medium",\n            help="The sales volume in the last 6 months",\n            y_min=0,\n            y_max=100,\n         ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Configure a line chart column in st.dataframe or st.data_editor.

\n

Cells need to contain a list of numbers. Chart columns are not editable\nat the moment. This command needs to be used in the column_config parameter\nof st.dataframe or st.data_editor.

\n", + "DeltaGenerator.checkbox": { + "name": "checkbox", + "signature": "element.checkbox(self, label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a checkbox widget.", "args": [ { "name": "label", - "type_name": "str or None", + "type_name": "str", "is_optional": false, - "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "description": "

A short label explaining to the user what this checkbox is for.

\n", "default": null }, { - "name": "width", - "type_name": "\"small\", \"medium\", \"large\", or None", + "name": "value", + "type_name": "bool", "is_optional": false, - "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "description": "

Preselect the checkbox when it first renders. This will be\ncast to bool internally.

\n", "default": null }, { - "name": "help", - "type_name": "str or None", + "name": "key", + "type_name": "str or int", "is_optional": false, - "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", "default": null }, { - "name": "y_min", - "type_name": "int, float, or None", + "name": "help", + "type_name": "str", "is_optional": false, - "description": "

The minimum value on the y-axis for all cells in the column.\nIf None (default), every cell will use the minimum of its data.

\n", + "description": "

An optional tooltip that gets displayed next to the checkbox.

\n", "default": null }, { - "name": "y_max", - "type_name": "int, float, or None", - "is_optional": false, - "description": "

The maximum value on the y-axis for all cells in the column. If None (default),\nevery cell will use the maximum of its data.

\n", - "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/lib/column_types.py#L826" - }, - "streamlit.column_config.LinkColumn": { - "name": "LinkColumn", - "signature": "st.column_config.LinkColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, max_chars=None, validate=None)", - "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "apps": [\n            "https://roadmap.streamlit.app",\n            "https://extras.streamlit.app",\n            "https://issues.streamlit.app",\n            "https://30days.streamlit.app",\n        ],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "apps": st.column_config.LinkColumn(\n            "Trending apps",\n            help="The top trending Streamlit apps",\n            validate="^https://[a-z]+\\.streamlit\\.app$",\n            max_chars=100,\n        )\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Configure a link column in st.dataframe or st.data_editor.

\n

The cell values need to be string and will be shown as clickable links.\nThis command needs to be used in the column_config parameter of st.dataframe\nor st.data_editor. When used with st.data_editor, editing will be enabled\nwith a text input widget.

\n", - "args": [ - { - "name": "label", - "type_name": "str or None", + "name": "on_change", + "type_name": "callable", "is_optional": false, - "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "description": "

An optional callback invoked when this checkbox's value changes.

\n", "default": null }, { - "name": "width", - "type_name": "\"small\", \"medium\", \"large\", or None", + "name": "args", + "type_name": "tuple", "is_optional": false, - "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "description": "

An optional tuple of args to pass to the callback.

\n", "default": null }, { - "name": "help", - "type_name": "str or None", + "name": "kwargs", + "type_name": "dict", "is_optional": false, - "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, { "name": "disabled", - "type_name": "bool or None", - "is_optional": false, - "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", - "default": "False" - }, - { - "name": "required", - "type_name": "bool or None", + "type_name": "bool", "is_optional": false, - "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", + "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", "default": "False" - }, + } + ], + "returns": [ { - "name": "default", - "type_name": "str or None", - "is_optional": false, - "description": "

Specifies the default value in this column when a new row is added by the user.

\n", - "default": "value" - }, + "type_name": "bool", + "is_generator": false, + "description": "

Whether or not the checkbox is checked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/checkbox.py#L50" + }, + "DeltaGenerator.code": { + "name": "code", + "signature": "element.code(self, body, language=\"python\")", + "example": "
\n
\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", + "description": "

Display a code block with optional syntax highlighting.

\n

(This is a convenience wrapper around st.markdown())

\n", + "args": [ { - "name": "max_chars", - "type_name": "int or None", + "name": "body", + "type_name": "str", "is_optional": false, - "description": "

The maximum number of characters that can be entered. If None (default),\nthere will be no maximum.

\n", + "description": "

The string to display as code.

\n", "default": null }, { - "name": "validate", + "name": "language", "type_name": "str or None", "is_optional": false, - "description": "

A regular expression (JS flavor, e.g. "^https://.+$") that edited values are validated against.\nIf the input is invalid, it will not be submitted.

\n", - "default": null + "description": "

The language that the code is written in, for syntax highlighting.\nIf None, the code will be unstyled. Defaults to "python".

\n

For a list of available language values, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", + "default": "s" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/lib/column_types.py#L466" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/markdown.py#L85" }, - "streamlit.column_config.ListColumn": { - "name": "ListColumn", - "signature": "st.column_config.ListColumn(label=None, *, width=None, help=None)", - "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "sales": [\n            [0, 4, 26, 80, 100, 40],\n            [80, 20, 80, 35, 40, 100],\n            [10, 20, 80, 80, 70, 0],\n            [10, 100, 20, 100, 30, 100],\n        ],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "sales": st.column_config.ListColumn(\n            "Sales (last 6 months)",\n            help="The sales volume in the last 6 months",\n            width="medium",\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Configure a list column in st.dataframe or st.data_editor.

\n

This is the default column type for list-like values. List columns are not editable\nat the moment. This command needs to be used in the column_config parameter of\nst.dataframe or st.data_editor.

\n", + "DeltaGenerator.color_picker": { + "name": "color_picker", + "signature": "element.color_picker(self, label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a color picker widget.", "args": [ { "name": "label", - "type_name": "str or None", + "type_name": "str", "is_optional": false, - "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "description": "

A short label explaining to the user what this input is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { - "name": "width", - "type_name": "\"small\", \"medium\", \"large\", or None", + "name": "value", + "type_name": "str", "is_optional": false, - "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "description": "

The hex value of this widget when it first renders. If None,\ndefaults to black.

\n", + "default": "black" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", "default": null }, { "name": "help", - "type_name": "str or None", + "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "description": "

An optional tooltip that gets displayed next to the color picker.

\n", "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/lib/column_types.py#L978" - }, - "streamlit.column_config.NumberColumn": { - "name": "NumberColumn", - "signature": "st.column_config.NumberColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, format=None, min_value=None, max_value=None, step=None)", - "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "price": [20, 950, 250, 500],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "price": st.column_config.NumberColumn(\n            "Price (in USD)",\n            help="The price of the product in USD",\n            min_value=0,\n            max_value=1000,\n            step=1,\n            format="$%d",\n        )\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Configure a number column in st.dataframe or st.data_editor.

\n

This is the default column type for integer and float values. This command needs to\nbe used in the column_config parameter of st.dataframe or st.data_editor.\nWhen used with st.data_editor, editing will be enabled with a numeric input widget.

\n", - "args": [ + }, { - "name": "label", - "type_name": "str or None", + "name": "on_change", + "type_name": "callable", "is_optional": false, - "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "description": "

An optional callback invoked when this color_picker's value\nchanges.

\n", "default": null }, { - "name": "width", - "type_name": "\"small\", \"medium\", \"large\", or None", + "name": "args", + "type_name": "tuple", "is_optional": false, - "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "description": "

An optional tuple of args to pass to the callback.

\n", "default": null }, { - "name": "help", - "type_name": "str or None", + "name": "kwargs", + "type_name": "dict", "is_optional": false, - "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, { "name": "disabled", - "type_name": "bool or None", + "type_name": "bool", "is_optional": false, - "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", + "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", "default": "False" }, { - "name": "required", - "type_name": "bool or None", + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", "is_optional": false, - "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", - "default": "False" - }, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ { - "name": "default", - "type_name": "int, float, or None", + "type_name": "str", + "is_generator": false, + "description": "

The selected color as a hex string.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/color_picker.py#L58" + }, + "DeltaGenerator.columns": { + "name": "columns", + "signature": "element.columns(self, spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put columns inside another column.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", "is_optional": false, - "description": "

Specifies the default value in this column when a new row is added by the user.

\n", - "default": "value" + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null }, { - "name": "format", - "type_name": "str or None", + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", "is_optional": false, - "description": "

A printf-style format string controlling how numbers are displayed.\nThis does not impact the return value. Valid formatters: %d %e %f %g %i %u.\nYou can also add prefixes and suffixes, e.g. "$ %.2f" to show a dollar prefix.

\n", + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/layouts.py#L74" + }, + "DeltaGenerator.container": { + "name": "container", + "signature": "element.container(self)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/layouts.py#L29" + }, + "DeltaGenerator.dataframe": { + "name": "dataframe", + "signature": "element.dataframe(self, data=None, width=None, height=None, *, use_container_width=False)", + "examples": "
\n
\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\nst.dataframe(df, 200, 100)\n
\n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a dataframe as an interactive table.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. (It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.)\nStyler support is experimental!\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null }, { - "name": "min_value", - "type_name": "int, float, or None", + "name": "width", + "type_name": "int or None", "is_optional": false, - "description": "

The minimum value that can be entered.\nIf None (default), there will be no minimum.

\n", + "description": "

Desired width of the dataframe expressed in pixels. If None, the width\nwill be automatically calculated based on the column content.

\n", "default": null }, { - "name": "max_value", - "type_name": "int, float, or None", + "name": "height", + "type_name": "int or None", "is_optional": false, - "description": "

The maximum value that can be entered.\nIf None (default), there will be no maximum.

\n", - "default": null + "description": "

Desired height of the dataframe expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" }, { - "name": "step", - "type_name": "int, float, or None", + "name": "use_container_width", + "type_name": "bool", "is_optional": false, - "description": "

The stepping interval. Specifies the precision of numbers that can be entered.\nIf None (default), uses 1 for integers and unrestricted precision for floats.

\n", + "description": "

If True, set the dataframe width to the width of the parent container.\nThis takes precedence over the width argument.\nThis argument can only be supplied by keyword.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/lib/column_types.py#L262" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/dataframe_selector.py#L38" }, - "streamlit.column_config.ProgressColumn": { - "name": "ProgressColumn", - "signature": "st.column_config.ProgressColumn(label=None, *, width=None, help=None, format=None, min_value=None, max_value=None)", - "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "sales": [200, 550, 1000, 80],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "sales": st.column_config.ProgressColumn(\n            "Sales volume",\n            help="The sales volume in USD",\n            format="$%f",\n            min_value=0,\n            max_value=1000,\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Configure a progress column in st.dataframe or st.data_editor.

\n

Cells need to contain a number. Progress columns are not editable at the moment.\nThis command needs to be used in the column_config parameter of st.dataframe\nor st.data_editor.

\n", + "DeltaGenerator.date_input": { + "name": "date_input", + "signature": "element.date_input(self, label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nd = st.date_input(\n    "When's your birthday",\n    datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a date input widget.", "args": [ { "name": "label", - "type_name": "str or None", + "type_name": "str", "is_optional": false, - "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "description": "

A short label explaining to the user what this date input is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { - "name": "width", - "type_name": "\"small\", \"medium\", \"large\", or None", + "name": "value", + "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", "is_optional": false, - "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", - "default": null + "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", + "default": "today" }, { - "name": "help", - "type_name": "str or None", + "name": "min_value", + "type_name": "datetime.date or datetime.datetime", "is_optional": false, - "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", - "default": null + "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", + "default": "value" }, { - "name": "format", - "type_name": "str or None", + "name": "max_value", + "type_name": "datetime.date or datetime.datetime", "is_optional": false, - "description": "

A printf-style format string controlling how numbers are displayed.\nValid formatters: %d %e %f %g %i %u. You can also add prefixes and suffixes,\ne.g. "$ %.2f" to show a dollar prefix.

\n", - "default": null + "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", + "default": "value" }, { - "name": "min_value", - "type_name": "int, float, or None", + "name": "key", + "type_name": "str or int", "is_optional": false, - "description": "

The minimum value of the progress bar.\nIf None (default), will be 0.

\n", + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", "default": null }, { - "name": "max_value", - "type_name": "int, float, or None", + "name": "help", + "type_name": "str", "is_optional": false, - "description": "

The minimum value of the progress bar. If None (default), will be 100 for\ninteger values and 1 for float values.

\n", + "description": "

An optional tooltip that gets displayed next to the input.

\n", "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/lib/column_types.py#L1391" - }, - "streamlit.column_config.SelectboxColumn": { - "name": "SelectboxColumn", - "signature": "st.column_config.SelectboxColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, options=None)", - "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "category": [\n            "\ud83d\udcca Data Exploration",\n            "\ud83d\udcc8 Data Visualization",\n            "\ud83e\udd16 LLM",\n            "\ud83d\udcca Data Exploration",\n        ],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "category": st.column_config.SelectboxColumn(\n            "App Category",\n            help="The category of the app",\n            width="medium",\n            options=[\n                "\ud83d\udcca Data Exploration",\n                "\ud83d\udcc8 Data Visualization",\n                "\ud83e\udd16 LLM",\n            ],\n            required=True,\n        )\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Configure a selectbox column in st.dataframe or st.data_editor.

\n

This is the default column type for Pandas categorical values. This command needs to\nbe used in the column_config parameter of st.dataframe or st.data_editor.\nWhen used with st.data_editor, editing will be enabled with a selectbox widget.

\n", - "args": [ + }, { - "name": "label", - "type_name": "str or None", + "name": "on_change", + "type_name": "callable", "is_optional": false, - "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "description": "

An optional callback invoked when this date_input's value changes.

\n", "default": null }, { - "name": "width", - "type_name": "\"small\", \"medium\", \"large\", or None", + "name": "args", + "type_name": "tuple", "is_optional": false, - "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "description": "

An optional tuple of args to pass to the callback.

\n", "default": null }, { - "name": "help", - "type_name": "str or None", + "name": "kwargs", + "type_name": "dict", "is_optional": false, - "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, { "name": "disabled", - "type_name": "bool or None", - "is_optional": false, - "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", - "default": "False" - }, - { - "name": "required", - "type_name": "bool or None", + "type_name": "bool", "is_optional": false, - "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", + "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", "default": "False" }, { - "name": "default", - "type_name": "str, int, float, bool, or None", + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", "is_optional": false, - "description": "

Specifies the default value in this column when a new row is added by the user.

\n", - "default": "value" - }, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ { - "name": "options", - "type_name": "iterable of str or None", - "is_optional": false, - "description": "

The options that can be selected during editing. If None (default), this will be\ninferred from the underlying dataframe column if its dtype is \u201ccategory\u201d\n(see Pandas docs on categorical data).

\n", - "default": null + "type_name": "datetime.date or a tuple with 0-2 dates", + "is_generator": false, + "description": "

The current value of the date input widget.

\n", + "return_name": null } ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/lib/column_types.py#L647" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/time_widgets.py#L362" }, - "streamlit.column_config.TextColumn": { - "name": "TextColumn", - "signature": "st.column_config.TextColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, max_chars=None, validate=None)", - "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "widgets": ["st.selectbox", "st.number_input", "st.text_area", "st.button"],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "widgets": st.column_config.TextColumn(\n            "Widgets",\n            help="Streamlit **widget** commands \ud83c\udf88",\n            default="st.",\n            max_chars=50,\n            validate="^st\\.[a-z_]+$",\n        )\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Configure a text column in st.dataframe or st.data_editor.

\n

This is the default column type for string values. This command needs to be used in the\ncolumn_config parameter of st.dataframe or st.data_editor. When used with\nst.data_editor, editing will be enabled with a text input widget.

\n", + "DeltaGenerator.determine_delta_color_and_direction": { + "name": "determine_delta_color_and_direction", + "signature": "element.determine_delta_color_and_direction(self, delta_color, delta)" + }, + "DeltaGenerator.download_button": { + "name": "download_button", + "signature": "element.download_button(self, label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False)", + "examples": "
\n

Download a large DataFrame as a CSV:

\n
\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", "args": [ { "name": "label", - "type_name": "str or None", + "type_name": "str", "is_optional": false, - "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "description": "

A short label explaining to the user what this button is for.

\n", "default": null }, { - "name": "width", - "type_name": "\"small\", \"medium\", \"large\", or None", + "name": "data", + "type_name": "str or bytes or file", "is_optional": false, - "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "description": "

The contents of the file to be downloaded. See example below for\ncaching techniques to avoid recomputing this data unnecessarily.

\n", "default": null }, { - "name": "help", - "type_name": "str or None", + "name": "file_name", + "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "description": "

An optional string to use as the name of the file to be downloaded,\nsuch as 'my_file.csv'. If not specified, the name will be\nautomatically generated.

\n", "default": null }, { - "name": "disabled", - "type_name": "bool or None", + "name": "mime", + "type_name": "str or None", "is_optional": false, - "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", - "default": "False" + "description": "

The MIME type of the data. If None, defaults to "text/plain"\n(if data is of type str or is a textual file) or\n"application/octet-stream" (if data is of type bytes or is a\nbinary file).

\n", + "default": "s" }, { - "name": "required", - "type_name": "bool or None", + "name": "key", + "type_name": "str or int", "is_optional": false, - "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", - "default": "False" + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null }, { - "name": "default", - "type_name": "str or None", + "name": "help", + "type_name": "str", "is_optional": false, - "description": "

Specifies the default value in this column when a new row is added by the user.

\n", - "default": "value" + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null }, { - "name": "max_chars", - "type_name": "int or None", + "name": "on_click", + "type_name": "callable", "is_optional": false, - "description": "

The maximum number of characters that can be entered. If None (default),\nthere will be no maximum.

\n", + "description": "

An optional callback invoked when this button is clicked.

\n", "default": null }, { - "name": "validate", - "type_name": "str or None", + "name": "args", + "type_name": "tuple", "is_optional": false, - "description": "

A regular expression (JS flavor, e.g. "^[a-z]+$") that edited values are validated against.\nIf the input is invalid, it will not be submitted.

\n", + "description": "

An optional tuple of args to pass to the callback.

\n", "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/lib/column_types.py#L372" - }, - "streamlit.column_config.TimeColumn": { - "name": "TimeColumn", - "signature": "st.column_config.TimeColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, format=None, min_value=None, max_value=None, step=None)", - "examples": "
\n
\nfrom datetime import time\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "appointment": [\n            time(12, 30),\n            time(18, 0),\n            time(9, 10),\n            time(16, 25),\n        ]\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "appointment": st.column_config.TimeColumn(\n            "Appointment",\n            min_value=time(8, 0, 0),\n            max_value=time(19, 0, 0),\n            format="hh:mm a",\n            step=60,\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Configure a time column in st.dataframe or st.data_editor.

\n

This is the default column type for time values. This command needs to be used in\nthe column_config parameter of st.dataframe or st.data_editor. When\nused with st.data_editor, editing will be enabled with a time picker widget.

\n", - "args": [ + }, { - "name": "label", - "type_name": "str or None", + "name": "kwargs", + "type_name": "dict", "is_optional": false, - "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, { - "name": "width", - "type_name": "\"small\", \"medium\", \"large\", or None", + "name": "disabled", + "type_name": "bool", "is_optional": false, - "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", - "default": null + "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/button.py#L130" + }, + "DeltaGenerator.empty": { + "name": "empty", + "signature": "element.empty(self)", + "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", + "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/empty.py#L24" + }, + "DeltaGenerator.error": { + "name": "error", + "signature": "element.error(self, body, *, icon=None)", + "example": "
\n
\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", + "description": "Display error message.", + "args": [ + { + "name": "icon", + "type_name": "None", + "is_optional": false, + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" }, { - "name": "help", - "type_name": "str or None", + "name": "body", + "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "description": "

The error text to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/alert.py#L39" + }, + "DeltaGenerator.exception": { + "name": "exception", + "signature": "element.exception(self, exception)", + "example": "
\n
\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", + "description": "Display an exception.", + "args": [ + { + "name": "exception", + "type_name": "Exception", + "is_optional": false, + "description": "

The exception to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/exception.py#L47" + }, + "DeltaGenerator.expander": { + "name": "expander", + "signature": "element.expander(self, label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write("""\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    """)\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write("""\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n""")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander.

\n", "default": null }, { - "name": "disabled", - "type_name": "bool or None", + "name": "expanded", + "type_name": "bool", "is_optional": false, - "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", - "default": "False" + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/layouts.py#L287" + }, + "DeltaGenerator.file_uploader": { + "name": "file_uploader", + "signature": "element.file_uploader(self, label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this file uploader is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null }, { - "name": "required", - "type_name": "bool or None", + "name": "type", + "type_name": "str or list of str or None", "is_optional": false, - "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", - "default": "False" + "description": "

Array of allowed extensions. ['png', 'jpg']\nThe default is None, which means all extensions are allowed.

\n", + "default": "None" }, { - "name": "default", - "type_name": "datetime.time or None", + "name": "accept_multiple_files", + "type_name": "bool", "is_optional": false, - "description": "

Specifies the default value in this column when a new row is added by the user.

\n", - "default": "value" + "description": "

If True, allows the user to upload multiple files at the same time,\nin which case the return value will be a list of files.\nDefault: False

\n", + "default": "False" }, { - "name": "format", - "type_name": "str or None", + "name": "key", + "type_name": "str or int", "is_optional": false, - "description": "

A momentJS format string controlling how times are displayed. See\nmomentJS docs for available\nformats. If None (default), uses HH:mm:ss.

\n", + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", "default": null }, { - "name": "min_value", - "type_name": "datetime.time or None", + "name": "help", + "type_name": "str", "is_optional": false, - "description": "

The minimum time that can be entered.\nIf None (default), there will be no minimum.

\n", + "description": "

A tooltip that gets displayed next to the file uploader.

\n", "default": null }, { - "name": "max_value", - "type_name": "datetime.time or None", + "name": "on_change", + "type_name": "callable", "is_optional": false, - "description": "

The maximum time that can be entered.\nIf None (default), there will be no maximum.

\n", + "description": "

An optional callback invoked when this file_uploader's value\nchanges.

\n", "default": null }, { - "name": "step", - "type_name": "int, float, datetime.timedelta, or None", + "name": "args", + "type_name": "tuple", "is_optional": false, - "description": "

The stepping interval in seconds. If None (default), the step will be 1 second.

\n", + "description": "

An optional tuple of args to pass to the callback.

\n", "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/lib/column_types.py#L1164" - }, - "streamlit.components.v1.declare_component": { - "name": "declare_component", - "signature": "st.components.v1.declare_component(name, path=None, url=None)", - "description": "

Create and register a custom component.

\n", - "args": [ + }, { - "name": "name", - "type_name": "str", + "name": "kwargs", + "type_name": "dict", "is_optional": false, - "description": "

A short, descriptive name for the component. Like, "slider".

\n", + "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, { - "name": "path", - "type_name": "str or None", + "name": "disabled", + "type_name": "bool", "is_optional": false, - "description": "

The path to serve the component's frontend files from. Either\npath or url must be specified, but not both.

\n", - "default": null + "description": "

An optional boolean, which disables the file uploader if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" }, { - "name": "url", - "type_name": "str or None", + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", "is_optional": false, - "description": "

The URL that the component is served from. Either path or url\nmust be specified, but not both.

\n", - "default": null + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" } ], "returns": [ { - "type_name": "CustomComponent", + "type_name": "None or UploadedFile or list of UploadedFile", "is_generator": false, - "description": "

A CustomComponent that can be called like a function.\nCalling the component will create a new instance of the component\nin the Streamlit app.

\n", + "description": "
    \n
  • If accept_multiple_files is False, returns either None or\nan UploadedFile object.
  • \n
  • If accept_multiple_files is True, returns a list with the\nuploaded files as UploadedFile objects. If no files were\nuploaded, returns an empty list.
  • \n
\n

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/components/v1/components.py#L262" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/file_uploader.py#L212" }, - "streamlit.components.v1.html": { - "name": "html", - "signature": "st.components.v1.html(html, width=None, height=None, scrolling=False)", - "description": "

Display an HTML string in an iframe.

\n", + "DeltaGenerator.form": { + "name": "form", + "signature": "element.form(self, key, clear_on_submit=False)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n

Inserting elements out of order:

\n
\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n
\n", + "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
\n

For more information about forms, check out our\nblog post.

\n", "args": [ { - "name": "html", + "name": "key", "type_name": "str", "is_optional": false, - "description": "

The HTML string to embed in the iframe.

\n", + "description": "

A string that identifies the form. Each form must have its own\nkey. (This key is not displayed to the user in the interface.)

\n", "default": null }, { - "name": "width", - "type_name": "int", - "is_optional": false, - "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", - "default": "the" - }, - { - "name": "height", - "type_name": "int", - "is_optional": false, - "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", - "default": "150" - }, - { - "name": "scrolling", + "name": "clear_on_submit", "type_name": "bool", "is_optional": false, - "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", - "default": "False" + "description": "

If True, all widgets inside the form will be reset to their default\nvalues after the user presses the Submit button. Defaults to False.\n(Note that Custom Components are unaffected by this flag, and\nwill not be reset to their defaults on form submission.)

\n", + "default": "values" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/iframe.py#L59" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/form.py#L113" }, - "streamlit.components.v1.iframe": { - "name": "iframe", - "signature": "st.components.v1.iframe(src, width=None, height=None, scrolling=False)", - "description": "

Load a remote URL in an iframe.

\n", + "DeltaGenerator.form_submit_button": { + "name": "form_submit_button", + "signature": "element.form_submit_button(self, label=\"Submit\", help=None, on_click=None, args=None, kwargs=None)", + "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", "args": [ { - "name": "src", + "name": "label", "type_name": "str", "is_optional": false, - "description": "

The URL of the page to embed.

\n", - "default": null + "description": "

A short label explaining to the user what this button is for.\nDefaults to "Submit".

\n", + "default": "s" }, { - "name": "width", - "type_name": "int", + "name": "help", + "type_name": "str or None", "is_optional": false, - "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", - "default": "the" + "description": "

A tooltip that gets displayed when the button is hovered over.\nDefaults to None.

\n", + "default": "None" }, { - "name": "height", - "type_name": "int", + "name": "on_click", + "type_name": "callable", "is_optional": false, - "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", - "default": "150" + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null }, { - "name": "scrolling", - "type_name": "bool", + "name": "args", + "type_name": "tuple", "is_optional": false, - "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", - "default": "False" + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null } ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/iframe.py#L25" + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/form.py#L202" }, - "DeltaGenerator.add_rows": { - "name": "add_rows", - "signature": "element.add_rows(data=None, **kwargs)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf1 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table = st.table(df1)\n\ndf2 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table.add_rows(df2)\n# Now the table shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

You can do the same thing with plots. For example, if you want to add\nmore data to a line chart:

\n
\n# Assuming df1 and df2 from the example above still exist...\nmy_chart = st.line_chart(df1)\nmy_chart.add_rows(df2)\n# Now the chart shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

And for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:

\n
\nmy_chart = st.vega_lite_chart({\n    'mark': 'line',\n    'encoding': {'x': 'a', 'y': 'b'},\n    'datasets': {\n      'some_fancy_name': df1,  # <-- named dataset\n     },\n    'data': {'name': 'some_fancy_name'},\n}),\nmy_chart.add_rows(some_fancy_name=df2)  # <-- name used as keyword\n
\n
\n", - "description": "

Concatenate a dataframe to the bottom of the current one.

\n", + "DeltaGenerator.graphviz_chart": { + "name": "graphviz_chart", + "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nimport graphviz as graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a graph using the dagre-d3 library.", "args": [ { - "name": "data", - "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, Iterable, dict, or None", + "name": "figure_or_dot", + "type_name": "graphviz.dot.Graph, graphviz.dot.Digraph, str", "is_optional": false, - "description": "

Table to concat. Optional.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "description": "

The Graphlib graph object or dot string to display

\n", "default": null }, { - "name": "**kwargs", - "type_name": "pandas.DataFrame, numpy.ndarray, Iterable, dict, or None", + "name": "use_container_width", + "type_name": "bool", "is_optional": false, - "description": "

The named dataset to concat. Optional. You can only pass in 1\ndataset (including the one in the data parameter).

\n", + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L894" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/graphviz_chart.py#L39" }, - "DeltaGenerator.altair_chart": { - "name": "altair_chart", - "signature": "element.altair_chart(altair_chart, use_container_width=False, theme=\"streamlit\")", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(chart_data).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n
\n", - "description": "

Display a chart using the Altair library.

\n", + "DeltaGenerator.header": { + "name": "header", + "signature": "element.header(self, body, anchor=None)", + "example": "
\n
\nst.header('This is a header')\n
\n
\n", + "description": "Display text in header formatting.", "args": [ { - "name": "altair_chart", - "type_name": "altair.Chart", + "name": "body", + "type_name": "str", "is_optional": false, - "description": "

The Altair chart object to display.

\n", + "description": "

The text to display.

\n", "default": null }, { - "name": "use_container_width", - "type_name": "bool", + "name": "anchor", + "type_name": "str", "is_optional": false, - "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", "default": null - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/heading.py#L26" + }, + "DeltaGenerator.help": { + "name": "help", + "signature": "element.help(self, obj)", + "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nst.help(pandas.DataFrame)\n
\n

Want to quickly check what datatype is output by a certain function?\nTry:

\n
\nx = my_poorly_documented_function()\nst.help(x)\n
\n
\n", + "description": "

Display object's doc string, nicely formatted.

\n

Displays the doc string for this object.

\n", + "args": [ { - "name": "theme", - "type_name": "\"streamlit\" or None", + "name": "obj", + "type_name": "Object", "is_optional": false, - "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", - "default": "behavior" + "description": "

The object whose docstring should be displayed.

\n", + "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L766" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/doc_string.py#L43" }, - "DeltaGenerator.area_chart": { - "name": "area_chart", - "signature": "element.area_chart(data=None, *, x=None, y=None, color=None, width=0, height=0, use_container_width=True)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns = ['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n

You can also choose different columns to use for x and y, as well as set\nthe color dynamically based on a 3rd column (assuming your dataframe is in\nlong format):

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame({\n    'col1' : np.random.randn(20),\n    'col2' : np.random.randn(20),\n    'col3' : np.random.choice(['A', 'B', 'C'], 20)\n})\n\nst.area_chart(\n    chart_data,\n    x = 'col1',\n    y = 'col2',\n    color = 'col3'\n)\n
\n\n \n

Finally, if your dataframe is in wide format, you can group multiple\ncolumns under the y argument to show multiple series with different\ncolors:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['col1', 'col2', 'col3'])\n\nst.area_chart(\n    chart_data,\n    x='col1',\n    y=['col2', 'col3'],\n    color=['#FF0000','#0000FF']  # Optional\n)\n
\n\n \n
\n", - "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "DeltaGenerator.image": { + "name": "image", + "signature": "element.image(self, image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", + "example": "
\n
\nfrom PIL import Image\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an image or list of images.", "args": [ { - "name": "data", - "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "name": "image", + "type_name": "numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]", "is_optional": false, - "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "description": "

Monochrome image of shape (w,h) or (w,h,1)\nOR a color image of shape (w,h,3)\nOR an RGBA image of shape (w,h,4)\nOR a URL to fetch the image from\nOR a path of a local image file\nOR an SVG XML string like <svg xmlns=...</svg>\nOR a list of one of the above, to display multiple images.

\n", "default": null }, { - "name": "x", - "type_name": "str or None", + "name": "caption", + "type_name": "str or list of str", "is_optional": false, - "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "description": "

Image caption. If displaying multiple images, caption should be a\nlist of captions (one for each image).

\n", "default": null }, { - "name": "y", - "type_name": "str, sequence of str, or None", + "name": "width", + "type_name": "int or None", "is_optional": false, - "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", - "default": null + "description": "

Image width. None means use the image width,\nbut do not exceed the width of the column.\nShould be set for SVG images, as they have no default image width.

\n", + "default": "image" }, { - "name": "color", - "type_name": "str, tuple, sequence of str, sequence of tuple, or None", + "name": "use_column_width", + "type_name": "'auto' or 'always' or 'never' or bool", "is_optional": false, - "description": "

The color to use for different series in this chart. This argument\ncan only be supplied by keyword.

\n

For an area chart with just 1 series, this can be:

\n
    \n
  • None, to use the default color.
  • \n
  • A hex string like "#ffaa00" or "#ffaa0088".
  • \n
  • An RGB or RGBA tuple with the red, green, blue, and alpha\ncomponents specified as ints from 0 to 255 or floats from 0.0 to\n1.0.
  • \n
\n

For an area chart with multiple series, where the dataframe is in\nlong format (that is, y is None or just one column), this can be:

\n
    \n
  • None, to use the default colors.

    \n
  • \n
  • The name of a column in the dataset. Data points will be grouped\ninto series of the same color based on the value of this column.\nIn addition, if the values in this column match one of the color\nformats above (hex string or color tuple), then that color will\nbe used.

    \n

    For example: if the dataset has 1000 rows, but this column can\nonly contains the values "adult", "child", "baby",\nthen those 1000 datapoints will be grouped into 3 series, whose\ncolors will be automatically selected from the default palette.

    \n

    But, if for the same 1000-row dataset, this column contained\nthe values "#ffaa00", "#f0f", "#0000ff", then then those 1000\ndatapoints would still be grouped into 3 series, but their\ncolors would be "#ffaa00", "#f0f", "#0000ff" this time around.

    \n
  • \n
\n

For an area chart with multiple series, where the dataframe is in\nwide format (that is, y is a sequence of columns), this can be:

\n
    \n
  • None, to use the default colors.
  • \n
  • A list of string colors or color tuples to be used for each of\nthe series in the chart. This list should have the same length\nas the number of y values (e.g. color=["#fd0", "#f0f", "#04f"]\nfor three lines).
  • \n
\n", - "default": "color" + "description": "

If 'auto', set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf 'always' or True, set the image's width to the column width.\nIf 'never' or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", + "default": null }, { - "name": "width", - "type_name": "int", + "name": "clamp", + "type_name": "bool", "is_optional": false, - "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "description": "

Clamp image pixel values to a valid range ([0-255] per channel).\nThis is only meaningful for byte array images; the parameter is\nignored for image URLs. If this is not set, and an image has an\nout-of-range value, an error will be thrown.

\n", "default": null }, { - "name": "height", - "type_name": "int", + "name": "channels", + "type_name": "'RGB' or 'BGR'", "is_optional": false, - "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", - "default": null + "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to 'RGB', meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to 'BGR', instead.

\n", + "default": "s" }, { - "name": "use_container_width", - "type_name": "bool", + "name": "output_format", + "type_name": "'JPEG', 'PNG', or 'auto'", "is_optional": false, - "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", - "default": null + "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to 'auto' which identifies the compression type based\non the type and format of the image argument.

\n", + "default": "s" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L409" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/image.py#L61" }, - "DeltaGenerator.audio": { - "name": "audio", - "signature": "element.audio(data, format=\"audio/wav\", start_time=0, *, sample_rate=None)", - "example": "
\n
\nimport streamlit as st\nimport numpy as np\n\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n\nsample_rate = 44100  # 44100 samples per second\nseconds = 2  # Note duration of 2 seconds\nfrequency_la = 440  # Our played note will be 440 Hz\n# Generate array with seconds*sample_rate steps, ranging between 0 and seconds\nt = np.linspace(0, seconds, seconds * sample_rate, False)\n# Generate a 440 Hz sine wave\nnote_la = np.sin(frequency_la * t * 2 * np.pi)\n\nst.audio(note_la, sample_rate=sample_rate)\n
\n\n \n
\n", - "description": "

Display an audio player.

\n", + "DeltaGenerator.info": { + "name": "info", + "signature": "element.info(self, body, *, icon=None)", + "example": "
\n
\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", + "description": "Display an informational message.", "args": [ { - "name": "data", - "type_name": "str, bytes, BytesIO, numpy.ndarray, or file", + "name": "icon", + "type_name": "None", "is_optional": false, - "description": "

Raw audio data, filename, or a URL pointing to the file to load.\nRaw data formats must include all necessary file headers to match the file\nformat specified via format.\nIf data is a numpy array, it must either be a 1D array of the waveform\nor a 2D array of shape (num_channels, num_samples) with waveforms\nfor all channels. See the default channel order at\nhttp://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx

\n", - "default": "channel" + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" }, { - "name": "format", + "name": "body", "type_name": "str", "is_optional": false, - "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", - "default": "s" - }, + "description": "

The info text to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/alert.py#L98" + }, + "DeltaGenerator.is_negative": { + "name": "is_negative", + "signature": "element.is_negative(delta)" + }, + "DeltaGenerator.json": { + "name": "json", + "signature": "element.json(self, body, *, expanded=True)", + "example": "
\n
\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display object or string as a pretty-printed JSON string.", + "args": [ { - "name": "start_time", - "type_name": "int", + "name": "body", + "type_name": "object or str", "is_optional": false, - "description": "

The time from which this element should start playing.

\n", + "description": "

The object to print as JSON. All referenced objects should be\nserializable to JSON as well. If object is a string, we assume it\ncontains serialized JSON.

\n", "default": null }, { - "name": "sample_rate", - "type_name": "int or None", + "name": "expanded", + "type_name": "bool", "is_optional": false, - "description": "

The sample rate of the audio data in samples per second. Only required if\ndata is a numpy array.

\n", - "default": null + "description": "

An optional boolean that allows the user to set whether the initial\nstate of this json element should be expanded. Defaults to True.\nThis argument can only be supplied by keyword.

\n", + "default": "True" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/media.py#L42" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/json.py#L41" }, - "DeltaGenerator.balloons": { - "name": "balloons", - "signature": "element.balloons()", - "example": "
\n
\nimport streamlit as st\n\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", - "description": "

Draw celebratory balloons.

\n", - "args": [], + "DeltaGenerator.latex": { + "name": "latex", + "signature": "element.latex(self, body)", + "example": "
\n
\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", + "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", + "args": [ + { + "name": "body", + "type_name": "str or SymPy expression", + "is_optional": false, + "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", + "default": null + } + ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/balloons.py#L25" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/markdown.py#L164" }, - "DeltaGenerator.bar_chart": { - "name": "bar_chart", - "signature": "element.bar_chart(data=None, *, x=None, y=None, color=None, width=0, height=0, use_container_width=True)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n

You can also choose different columns to use for x and y, as well as set\nthe color dynamically based on a 3rd column (assuming your dataframe is in\nlong format):

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame({\n    'col1' : np.random.randn(20),\n    'col2' : np.random.randn(20),\n    'col3' : np.random.choice(['A','B','C'],20)\n})\n\nst.bar_chart(\n    chart_data,\n    x='col1',\n    y='col2',\n    color='col3'\n)\n
\n\n \n

Finally, if your dataframe is in wide format, you can group multiple\ncolumns under the y argument to show multiple series with different\ncolors:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['col1', 'col2', 'col3'])\n\nst.bar_chart(\n    chart_data,\n    x='col1',\n    y=['col2', 'col3'],\n    color=['#FF0000','#0000FF']  # Optional\n)\n
\n\n \n
\n", - "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "DeltaGenerator.line_chart": { + "name": "line_chart", + "signature": "element.line_chart(self, data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\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 \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", "args": [ { "name": "data", - "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict or None", "is_optional": false, - "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null }, { @@ -17404,13 +15668,6 @@ "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", "default": null }, - { - "name": "color", - "type_name": "str, tuple, sequence of str, sequence of tuple, or None", - "is_optional": false, - "description": "

The color to use for different series in this chart. This argument\ncan only be supplied by keyword.

\n

For a bar chart with just 1 series, this can be:

\n
    \n
  • None, to use the default color.
  • \n
  • A hex string like "#ffaa00" or "#ffaa0088".
  • \n
  • An RGB or RGBA tuple with the red, green, blue, and alpha\ncomponents specified as ints from 0 to 255 or floats from 0.0 to\n1.0.
  • \n
\n

For a bar chart with multiple series, where the dataframe is in\nlong format (that is, y is None or just one column), this can be:

\n
    \n
  • None, to use the default colors.

    \n
  • \n
  • The name of a column in the dataset. Data points will be grouped\ninto series of the same color based on the value of this column.\nIn addition, if the values in this column match one of the color\nformats above (hex string or color tuple), then that color will\nbe used.

    \n

    For example: if the dataset has 1000 rows, but this column can\nonly contains the values "adult", "child", "baby",\nthen those 1000 datapoints will be grouped into 3 series, whose\ncolors will be automatically selected from the default palette.

    \n

    But, if for the same 1000-row dataset, this column contained\nthe values "#ffaa00", "#f0f", "#0000ff", then then those 1000\ndatapoints would still be grouped into 3 series, but their\ncolors would be "#ffaa00", "#f0f", "#0000ff" this time around.

    \n
  • \n
\n

For a bar chart with multiple series, where the dataframe is in\nwide format (that is, y is a sequence of columns), this can be:

\n
    \n
  • None, to use the default colors.
  • \n
  • A list of string colors or color tuples to be used for each of\nthe series in the chart. This list should have the same length\nas the number of y values (e.g. color=["#fd0", "#f0f", "#04f"]\nfor three lines).
  • \n
\n", - "default": "color" - }, { "name": "width", "type_name": "int", @@ -17434,123 +15691,140 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L587" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/dataframe_selector.py#L146" }, - "DeltaGenerator.bokeh_chart": { - "name": "bokeh_chart", - "signature": "element.bokeh_chart(figure, use_container_width=False)", - "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n
\n", - "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", + "DeltaGenerator.map": { + "name": "map", + "signature": "element.map(self, data=None, zoom=None, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a map with points on it.

\n

This is a wrapper around st.pydeck_chart to quickly create scatterplot\ncharts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more\ninfo on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", "args": [ { - "name": "figure", - "type_name": "bokeh.plotting.figure.Figure", + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,", "is_optional": false, - "description": "

A Bokeh figure to plot.

\n", + "description": "

or None\nThe data to be plotted. Must have columns called 'lat', 'lon',\n'latitude', or 'longitude'.

\n", + "default": null + }, + { + "name": "zoom", + "type_name": "int", + "is_optional": false, + "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels

\n", "default": null }, { "name": "use_container_width", "type_name": "bool", "is_optional": false, - "description": "

If True, set the chart width to the column width. This takes\nprecedence over Bokeh's native width value.

\n", + "description": "", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/bokeh_chart.py#L36" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/map.py#L75" }, - "DeltaGenerator.button": { - "name": "button", - "signature": "element.button(label, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", - "example": "
\n
\nimport streamlit as st\n\nst.button("Reset", type="primary")\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n
\n", - "description": "

Display a button widget.

\n", + "DeltaGenerator.markdown": { + "name": "markdown", + "signature": "element.markdown(self, body, unsafe_allow_html=False)", + "example": "
\n
\nst.markdown('Streamlit is **_really_ cool**.')\n
\n
\n", + "description": "Display string formatted as Markdown.", "args": [ { - "name": "label", + "name": "body", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n\n", "default": null }, { - "name": "key", - "type_name": "str or int", + "name": "unsafe_allow_html", + "type_name": "bool", "is_optional": false, - "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n

Also note that ``unsafe_allow_html`` is a temporary measure and may\nbe removed from Streamlit at any time.

\n

If you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:

\n

https://discuss.streamlit.io/t/96

\n

This will help us come up with safe APIs that allow you to do what\nyou want.

\n", "default": null - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/markdown.py#L29" + }, + "DeltaGenerator.metric": { + "name": "metric", + "signature": "element.metric(self, label, value, delta=None, delta_color=\"normal\", help=None)", + "example": "
\n
\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n \n (view standalone Streamlit app)\n \n

st.metric looks especially nice in combination with st.columns:

\n
\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n \n (view standalone Streamlit app)\n \n

The delta indicator color can also be inverted or turned off:

\n
\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", + "args": [ { - "name": "help", + "name": "label", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "description": "

The header or Title for the metric

\n", "default": null }, { - "name": "on_click", - "type_name": "callable", + "name": "value", + "type_name": "int, float, str, or None", "is_optional": false, - "description": "

An optional callback invoked when this button is clicked.

\n", + "description": "

Value of the metric. None is rendered as a long dash.

\n", "default": null }, { - "name": "args", - "type_name": "tuple", + "name": "delta", + "type_name": "int, float, str, or None", "is_optional": false, - "description": "

An optional tuple of args to pass to the callback.

\n", + "description": "

Indicator of how the metric changed, rendered with an arrow below\nthe metric. If delta is negative (int/float) or starts with a minus\nsign (str), the arrow points down and the text is red; else the\narrow points up and the text is green. If None (default), no delta\nindicator is shown.

\n", "default": null }, { - "name": "kwargs", - "type_name": "dict", + "name": "delta_color", + "type_name": "str", "is_optional": false, - "description": "

An optional dict of kwargs to pass to the callback.

\n", + "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", "default": null }, { - "name": "type", - "type_name": "\"secondary\" or \"primary\"", + "name": "help", + "type_name": "str", "is_optional": false, - "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", - "default": "s" - }, - { - "name": "disabled", - "type_name": "bool", - "is_optional": false, - "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", - "default": "False" - }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "description": "

An optional tooltip that gets displayed next to the metric label.

\n", "default": null } ], - "returns": [ - { - "type_name": "bool", - "is_generator": false, - "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/button.py#L61" + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/metric.py#L43" }, - "DeltaGenerator.camera_input": { - "name": "camera_input", - "signature": "element.camera_input(label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", - "description": "

Display a widget that returns pictures from the user's webcam.

\n", + "DeltaGenerator.multiselect": { + "name": "multiselect", + "signature": "element.multiselect(self, label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this widget is used for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this select widget is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence[V], numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null + }, + { + "name": "default", + "type_name": "[V], V, or None", + "is_optional": false, + "description": "

List of default values. Can also be a single value.

\n", + "default": "values" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of selectbox options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe multiselect.

\n", "default": null }, { @@ -17564,14 +15838,14 @@ "name": "help", "type_name": "str", "is_optional": false, - "description": "

A tooltip that gets displayed next to the camera input.

\n", + "description": "

An optional tooltip that gets displayed next to the multiselect.

\n", "default": null }, { "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this camera_input's value\nchanges.

\n", + "description": "

An optional callback invoked when this multiselect's value changes.

\n", "default": null }, { @@ -17592,97 +15866,94 @@ "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "description": "

An optional boolean, which disables the multiselect widget if set\nto True. The default is False. This argument can only be supplied\nby keyword.

\n", "default": "False" }, { "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", "default": "is" } ], "returns": [ { - "type_name": "None or UploadedFile", + "type_name": "list", "is_generator": false, - "description": "

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "description": "

A list with the selected options

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/camera_input.py#L78" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/multiselect.py#L127" }, - "DeltaGenerator.caption": { - "name": "caption", - "signature": "element.caption(body, unsafe_allow_html=False, *, help=None)", - "examples": "
\n
\nimport streamlit as st\n\nst.caption('This is a string that explains something above.')\nst.caption('A caption with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", - "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", + "DeltaGenerator.number_input": { + "name": "number_input", + "signature": "element.number_input(self, label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a numeric input widget.", "args": [ { - "name": "body", + "name": "label", "type_name": "str", "is_optional": false, - "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", + "description": "

A short label explaining to the user what this input is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { - "name": "unsafe_allow_html", - "type_name": "bool", + "name": "min_value", + "type_name": "int or float or None", "is_optional": false, - "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", "default": null }, { - "name": "help", - "type_name": "str", + "name": "max_value", + "type_name": "int or float or None", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the caption.

\n", + "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/markdown.py#L146" - }, - "DeltaGenerator.chat_input": { - "name": "chat_input", - "signature": "element.chat_input(placeholder=\"Your message\", *, key=None, max_chars=None, disabled=False, on_submit=None, args=None, kwargs=None)", - "examples": "
\n
\nimport streamlit as st\n\nprompt = st.chat_input("Say something")\nif prompt:\n    st.write(f"User has sent the following prompt: {prompt}")\n
\n\n \n
\n", - "description": "

Display a chat input widget.

\n
\n

Warning

\n

Chat input can only be used once per app page and inside the main area of the app.\nIt cannot be used in the sidebar, columns, expanders, forms or tabs.\nWe plan to support this in the future.

\n
\n", - "args": [ + }, { - "name": "placeholder", - "type_name": "str", + "name": "value", + "type_name": "int or float or None", "is_optional": false, - "description": "

A placeholder text shown when the chat input is empty. Defaults to\n"Your message". For accessibility reasons, you should not use an\nempty string.

\n", - "default": "s" + "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", + "default": "min_value" }, { - "name": "key", - "type_name": "str or int", + "name": "step", + "type_name": "int or float or None", "is_optional": false, - "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget based on\nits content. Multiple widgets of the same type may not share the same key.

\n", + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. Output must be purely numeric. This does not impact\nthe return value. Valid formatters: %d %e %f %g %i %u

\n", "default": null }, { - "name": "max_chars", - "type_name": "int or None", + "name": "key", + "type_name": "str or int", "is_optional": false, - "description": "

The maximum number of characters that can be entered. If None\n(default), there will be no maximum.

\n", + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", "default": null }, { - "name": "disabled", - "type_name": "bool", + "name": "help", + "type_name": "str", "is_optional": false, - "description": "

Whether the chat input should be disabled. Defaults to False.

\n", - "default": "False" + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null }, { - "name": "on_submit", + "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when the chat input's value is submitted.

\n", + "description": "

An optional callback invoked when this number_input's value changes.

\n", "default": null }, { @@ -17698,67 +15969,187 @@ "is_optional": false, "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the number input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" } ], "returns": [ { - "type_name": "str or None", + "type_name": "int or float", "is_generator": false, - "description": "

The current (non-empty) value of the text input widget on the last\nrun of the app, None otherwise.

\n", + "description": "

The current value of the numeric input widget. The return type\nwill match the data type of the value parameter.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/chat.py#L214" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/number_input.py#L72" }, - "DeltaGenerator.chat_message": { - "name": "chat_message", - "signature": "element.chat_message(name, *, avatar=None)", - "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\nimport numpy as np\n\nwith st.chat_message("user"):\n    st.write("Hello \ud83d\udc4b")\n    st.line_chart(np.random.randn(30, 3))\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\nmessage = st.chat_message("assistant")\nmessage.write("Hello human")\nmessage.bar_chart(np.random.randn(30, 3))\n
\n\n \n
\n", - "description": "

Insert a chat message container.

\n

To add elements to the returned container, you can use with notation\n(preferred) or just call methods directly on the returned object. See the\nexamples below.

\n", + "DeltaGenerator.parse_delta": { + "name": "parse_delta", + "signature": "element.parse_delta(delta)" + }, + "DeltaGenerator.parse_label": { + "name": "parse_label", + "signature": "element.parse_label(label)" + }, + "DeltaGenerator.parse_value": { + "name": "parse_value", + "signature": "element.parse_value(value)" + }, + "DeltaGenerator.plotly_chart": { + "name": "plotly_chart", + "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)", + "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport plotly.figure_factory as ff\nimport numpy as np\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n        hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", "args": [ { - "name": "name", - "type_name": "\"user\", \"assistant\", \"ai\", \"human\", or str", + "name": "figure_or_data", + "type_name": "plotly.graph_objs.Figure, plotly.graph_objs.Data,", "is_optional": false, - "description": "

The name of the message author. Can be "human"/"user" or\n"ai"/"assistant" to enable preset styling and avatars.

\n

Currently, the name is not shown in the UI but is only set as an\naccessibility label. For accessibility reasons, you should not use\nan empty string.

\n", + "description": "

dict/list of plotly.graph_objs.Figure/Data

\n

See https://plot.ly/python/ for examples of graph descriptions.

\n", "default": null }, { - "name": "avatar", - "type_name": "str, numpy.ndarray, or BytesIO", + "name": "use_container_width", + "type_name": "bool", "is_optional": false, - "description": "

The avatar shown next to the message. Can be one of:

\n
    \n
  • A single emoji, e.g. "\ud83e\uddd1\u200d\ud83d\udcbb", "\ud83e\udd16", "\ud83e\udd96". Shortcodes are not supported.
  • \n
  • \n
    An image using one of the formats allowed for st.image: path of a local
    \n
    image file; URL to fetch the image from; array of shape (w,h) or (w,h,1)\nfor a monochrome image, (w,h,3) for a color image, or (w,h,4) for an RGBA image.
    \n
    \n
  • \n
\n

If None (default), uses default icons if name is "user",\n"assistant", "ai", "human" or the first letter of the name value.

\n", - "default": "icons" + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + }, + { + "name": "sharing", + "type_name": "{'streamlit', 'private', 'secret', 'public'}", + "is_optional": false, + "description": "

Use 'streamlit' to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", + "default": null + }, + { + "name": "**kwargs", + "type_name": null, + "is_optional": null, + "description": "

Any argument accepted by Plotly's plot() function.

\n", + "default": null } ], - "returns": [ + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/plotly_chart.py#L68" + }, + "DeltaGenerator.progress": { + "name": "progress", + "signature": "element.progress(self, value)", + "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport time\n\nmy_bar = st.progress(0)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1)\n
\n
\n", + "description": "Display a progress bar.", + "args": [ { - "type_name": "Container", - "is_generator": false, - "description": "

A single container that can hold multiple elements.

\n", - "return_name": null + "name": "value", + "type_name": "int or float", + "is_optional": false, + "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", + "default": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/chat.py#L121" + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/progress.py#L31" }, - "DeltaGenerator.checkbox": { - "name": "checkbox", - "signature": "element.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n
\n", - "description": "

Display a checkbox widget.

\n", + "DeltaGenerator.pydeck_chart": { + "name": "pydeck_chart", + "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)", + "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\ndf = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=df,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=df,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", + "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "pydeck_obj", + "type_name": "pydeck.Deck or None", + "is_optional": false, + "description": "

Object specifying the PyDeck chart to draw.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/deck_gl_json_chart.py#L36" + }, + "DeltaGenerator.pyplot": { + "name": "pyplot", + "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)", + "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", + "example": "
\n
\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a matplotlib.pyplot figure.", + "args": [ + { + "name": "fig", + "type_name": "Matplotlib Figure", + "is_optional": false, + "description": "

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

\n", + "default": null + }, + { + "name": "clear_figure", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", + "default": "based" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Arguments to pass to Matplotlib's savefig function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/pyplot.py#L37" + }, + "DeltaGenerator.radio": { + "name": "radio", + "signature": "element.radio(self, label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, label_visibility=\"visible\")", + "example": "
\n
\ngenre = st.radio(\n    "What's your favorite movie genre",\n    ('Comedy', 'Drama', 'Documentary'))\n\nif genre == 'Comedy':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn't select comedy.")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a radio button widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this checkbox is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this radio group is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { - "name": "value", - "type_name": "bool", + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", "is_optional": false, - "description": "

Preselect the checkbox when it first renders. This will be\ncast to bool internally.

\n", + "description": "

Labels for the radio options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of radio options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe radio.

\n", "default": null }, { @@ -17772,14 +16163,14 @@ "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the checkbox.

\n", + "description": "

An optional tooltip that gets displayed next to the radio.

\n", "default": null }, { "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this checkbox's value changes.

\n", + "description": "

An optional callback invoked when this radio's value changes.

\n", "default": null }, { @@ -17800,77 +16191,67 @@ "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "description": "

An optional boolean, which disables the radio button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", "default": "False" }, + { + "name": "horizontal", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", + "default": "false" + }, { "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", "default": "is" } ], "returns": [ { - "type_name": "bool", + "type_name": "any", "is_generator": false, - "description": "

Whether or not the checkbox is checked.

\n", + "description": "

The selected option.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/checkbox.py#L53" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/radio.py#L77" }, - "DeltaGenerator.code": { - "name": "code", - "signature": "element.code(body, language=\"python\", line_numbers=False)", - "example": "
\n
\nimport streamlit as st\n\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", - "description": "

Display a code block with optional syntax highlighting.

\n", + "DeltaGenerator.select_slider": { + "name": "select_slider", + "signature": "element.select_slider(self, label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n \n (view standalone Streamlit app)\n \n ", + "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", "args": [ { - "name": "body", + "name": "label", "type_name": "str", "is_optional": false, - "description": "

The string to display as code.

\n", + "description": "

A short label explaining to the user what this slider is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { - "name": "language", - "type_name": "str or None", + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", "is_optional": false, - "description": "

The language that the code is written in, for syntax highlighting.\nIf None, the code will be unstyled. Defaults to "python".

\n

For a list of available language values, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", - "default": "s" + "description": "

Labels for the slider options. All options will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", + "default": null }, { - "name": "line_numbers", - "type_name": "bool", - "is_optional": false, - "description": "

An optional boolean indicating whether to show line numbers to the\nleft of the code block. Defaults to False.

\n", - "default": "s" - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/code.py#L27" - }, - "DeltaGenerator.color_picker": { - "name": "color_picker", - "signature": "element.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n
\n", - "description": "

Display a color picker widget.

\n", - "args": [ - { - "name": "label", - "type_name": "str", + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", "is_optional": false, - "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", - "default": null + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to first option.

\n", + "default": "first" }, { - "name": "value", - "type_name": "str", + "name": "format_func", + "type_name": "function", "is_optional": false, - "description": "

The hex value of this widget when it first renders. If None,\ndefaults to black.

\n", - "default": "black" + "description": "

Function to modify the display of the labels from the options.\nargument. It receives the option as an argument and its output\nwill be cast to str.

\n", + "default": null }, { "name": "key", @@ -17883,14 +16264,14 @@ "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the color picker.

\n", + "description": "

An optional tooltip that gets displayed next to the select slider.

\n", "default": null }, { "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this color_picker's value\nchanges.

\n", + "description": "

An optional callback invoked when this select_slider's value changes.

\n", "default": null }, { @@ -17911,12 +16292,12 @@ "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "description": "

An optional boolean, which disables the select slider if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", "default": "False" }, { "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", "is_optional": false, "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", "default": "is" @@ -17924,135 +16305,67 @@ ], "returns": [ { - "type_name": "str", - "is_generator": false, - "description": "

The selected color as a hex string.

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/color_picker.py#L53" - }, - "DeltaGenerator.columns": { - "name": "columns", - "signature": "element.columns(spec, *, gap=\"small\")", - "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n
\n", - "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", - "args": [ - { - "name": "spec", - "type_name": "int or iterable of numbers", - "is_optional": false, - "description": "

Controls the number and width of columns to insert. Can be one of:

\n
    \n
  • An integer that specifies the number of columns. All columns have equal\nwidth in this case.
  • \n
  • An iterable of numbers (int or float) that specify the relative width of\neach column. E.g. [0.7, 0.3] creates two columns where the first\none takes up 70% of the available with and the second one takes up 30%.\nOr [1, 2, 3] creates three columns where the second one is two times\nthe width of the first one, and the third one is three times that width.
  • \n
\n", - "default": null - }, - { - "name": "gap", - "type_name": "\"small\", \"medium\", or \"large\"", - "is_optional": false, - "description": "

The size of the gap between the columns. Defaults to "small". This\nargument can only be supplied by keyword.

\n", - "default": "s" - } - ], - "returns": [ - { - "type_name": "list of containers", + "type_name": "any value or tuple of any value", "is_generator": false, - "description": "

A list of container objects.

\n", + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/layouts.py#L79" - }, - "DeltaGenerator.container": { - "name": "container", - "signature": "element.container()", - "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n
\n", - "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/layouts.py#L31" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/select_slider.py#L107" }, - "DeltaGenerator.data_editor": { - "name": "data_editor", - "signature": "element.data_editor(data, *, width=None, height=None, use_container_width=False, hide_index=None, column_order=None, column_config=None, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", - "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

Or you can customize the data editor via column_config, hide_index, column_order, or disabled:

\n
\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    [\n        {"command": "st.selectbox", "rating": 4, "is_widget": True},\n        {"command": "st.balloons", "rating": 5, "is_widget": False},\n        {"command": "st.time_input", "rating": 3, "is_widget": True},\n    ]\n)\nedited_df = st.data_editor(\n    df,\n    column_config={\n        "command": "Streamlit Command",\n        "rating": st.column_config.NumberColumn(\n            "Your rating",\n            help="How much do you like this command (1-5)?",\n            min_value=1,\n            max_value=5,\n            step=1,\n            format="%d \u2b50",\n        ),\n        "is_widget": "Widget ?",\n    },\n    disabled=["command", "is_widget"],\n    hide_index=True,\n)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n
\n", - "description": "

Display a data editor widget.

\n

The data editor widget allows you to edit dataframes and many other data structures in a table-like UI.

\n
\n

Warning

\n

When going from st.experimental_data_editor to st.data_editor in\n1.23.0, the data editor's representation in st.session_state was changed.\nThe edited_cells dictionary is now called edited_rows and uses a\ndifferent format ({0: {"column name": "edited value"}} instead of\n{"0:1": "edited value"}). You may need to adjust the code if your app uses\nst.experimental_data_editor in combination with st.session_state."

\n
\n", + "DeltaGenerator.selectbox": { + "name": "selectbox", + "signature": "element.selectbox(self, label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a select widget.", "args": [ { - "name": "data", - "type_name": "pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None", - "is_optional": false, - "description": "

The data to edit in the data editor.

\n
\n

Note

\n
    \n
  • Styles from pandas.Styler will only be applied to non-editable columns.
  • \n
  • Mixing data types within a column can make the column uneditable.
  • \n
  • Additionally, the following data types are not yet supported for editing:\ncomplex, list, tuple, bytes, bytearray, memoryview, dict, set, frozenset,\ndatetime.timedelta, decimal.Decimal, fractions.Fraction, pandas.Interval,\npandas.Period, pandas.Timedelta.
  • \n
\n
\n", - "default": null - }, - { - "name": "width", - "type_name": "int or None", - "is_optional": false, - "description": "

Desired width of the data editor expressed in pixels. If None, the width will\nbe automatically determined.

\n", - "default": null - }, - { - "name": "height", - "type_name": "int or None", + "name": "label", + "type_name": "str", "is_optional": false, - "description": "

Desired height of the data editor expressed in pixels. If None, the height will\nbe automatically determined.

\n", + "description": "

A short label explaining to the user what this select widget is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "

If True, set the data editor width to the width of the parent container.\nThis takes precedence over the width argument. Defaults to False.

\n", - "default": "False" - }, - { - "name": "hide_index", - "type_name": "bool or None", + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", "is_optional": false, - "description": "

Whether to hide the index column(s). If None (default), the visibility of\nindex columns is automatically determined based on the data.

\n", + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", "default": null }, { - "name": "column_order", - "type_name": "iterable of str or None", + "name": "index", + "type_name": "int", "is_optional": false, - "description": "

Specifies the display order of columns. This also affects which columns are\nvisible. For example, column_order=("col2", "col1") will display 'col2'\nfirst, followed by 'col1', and will hide all other non-index columns. If\nNone (default), the order is inherited from the original data structure.

\n", + "description": "

The index of the preselected option on first render.

\n", "default": null }, { - "name": "column_config", - "type_name": "dict or None", + "name": "format_func", + "type_name": "function", "is_optional": false, - "description": "

Configures how columns are displayed, e.g. their title, visibility, type, or\nformat, as well as editing properties such as min/max value or step.\nThis needs to be a dictionary where each key is a column name and the value\nis one of:

\n
    \n
  • None to hide the column.
  • \n
  • A string to set the display label of the column.
  • \n
  • One of the column types defined under st.column_config, e.g.\nst.column_config.NumberColumn("Dollar values\u201d, format=\u201d$ %d") to show\na column as dollar amounts. See more info on the available column types\nand config options here.
  • \n
\n

To configure the index column(s), use _index as the column name.

\n", + "description": "

Function to modify the display of the labels. It receives the option\nas an argument and its output will be cast to str.

\n", "default": null }, { - "name": "num_rows", - "type_name": "\"fixed\" or \"dynamic\"", - "is_optional": false, - "description": "

Specifies if the user can add and delete rows in the data editor.\nIf "fixed", the user cannot add or delete rows. If "dynamic", the user can\nadd and delete rows in the data editor, but column sorting is disabled.\nDefaults to "fixed".

\n", - "default": "s" - }, - { - "name": "disabled", - "type_name": "bool or iterable of str", + "name": "key", + "type_name": "str or int", "is_optional": false, - "description": "

Controls the editing of columns. If True, editing is disabled for all columns.\nIf an iterable of column names is provided (e.g., disabled=("col1", "col2")),\nonly the specified columns will be disabled for editing. If False (default),\nall columns that support editing are editable.

\n", + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", "default": null }, { - "name": "key", + "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional string to use as the unique key for this widget. If this\nis omitted, a key will be generated for the widget based on its\ncontent. Multiple widgets of the same type may not share the same\nkey.

\n", + "description": "

An optional tooltip that gets displayed next to the selectbox.

\n", "default": null }, { "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this data_editor's value changes.

\n", + "description": "

An optional callback invoked when this selectbox's value changes.

\n", "default": null }, { @@ -18068,110 +16381,79 @@ "is_optional": false, "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the selectbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" } ], "returns": [ { - "type_name": "pandas.DataFrame, pandas.Series, pyarrow.Table, numpy.ndarray, list, set, tuple, or dict.", + "type_name": "any", "is_generator": false, - "description": "

The edited data. The edited data is returned in its original data type if\nit corresponds to any of the supported return types. All other data types\nare returned as a pd.DataFrame.

\n", + "description": "

The selected option

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/data_editor.py#L529" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/selectbox.py#L80" }, - "DeltaGenerator.dataframe": { - "name": "dataframe", - "signature": "element.dataframe(data=None, width=None, height=None, *, use_container_width=False, hide_index=None, column_order=None, column_config=None)", - "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n

Or you can customize the dataframe via column_config, hide_index, or column_order:

\n
\nimport random\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    {\n        "name": ["Roadmap", "Extras", "Issues"],\n        "url": ["https://roadmap.streamlit.app", "https://extras.streamlit.app", "https://issues.streamlit.app"],\n        "stars": [random.randint(0, 1000) for _ in range(3)],\n        "views_history": [[random.randint(0, 5000) for _ in range(30)] for _ in range(3)],\n    }\n)\nst.dataframe(\n    df,\n    column_config={\n        "name": "App name",\n        "stars": st.column_config.NumberColumn(\n            "Github Stars",\n            help="Number of stars on GitHub",\n            format="%d \u2b50",\n        ),\n        "url": st.column_config.LinkColumn("App URL"),\n        "views_history": st.column_config.LineChartColumn(\n            "Views (past 30 days)", y_min=0, y_max=5000\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", - "description": "

Display a dataframe as an interactive table.

\n

This command works with dataframes from Pandas, PyArrow, Snowpark, and PySpark.\nIt can also display several other types that can be converted to dataframes,\ne.g. numpy arrays, lists, sets and dictionaries.

\n", + "DeltaGenerator.slider": { + "name": "slider", + "signature": "element.slider(self, label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nfrom datetime import time\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nfrom datetime import datetime\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n", "args": [ { - "name": "data", - "type_name": "pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "name": "label", + "type_name": "str", "is_optional": false, - "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.

\n", + "description": "

A short label explaining to the user what this slider is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { - "name": "width", - "type_name": "int or None", + "name": "min_value", + "type_name": "a supported type or None", "is_optional": false, - "description": "

Desired width of the dataframe expressed in pixels. If None, the width\nwill be automatically calculated based on the column content.

\n", - "default": null - }, - { - "name": "height", - "type_name": "int or None", - "is_optional": false, - "description": "

Desired height of the dataframe expressed in pixels. If None, a\ndefault height is used.

\n", - "default": "height" - }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "

If True, set the dataframe width to the width of the parent container.\nThis takes precedence over the width argument.\nThis argument can only be supplied by keyword.

\n", - "default": null - }, - { - "name": "hide_index", - "type_name": "bool or None", - "is_optional": false, - "description": "

Whether to hide the index column(s). If None (default), the visibility of\nindex columns is automatically determined based on the data.

\n", - "default": null - }, - { - "name": "column_order", - "type_name": "iterable of str or None", - "is_optional": false, - "description": "

Specifies the display order of columns. This also affects which columns are\nvisible. For example, column_order=("col2", "col1") will display 'col2'\nfirst, followed by 'col1', and will hide all other non-index columns. If\nNone (default), the order is inherited from the original data structure.

\n", - "default": null + "description": "

The minimum permitted value.\nDefaults to 0 if the value is an int, 0.0 if a float,\nvalue - timedelta(days=14) if a date/datetime, time.min if a time

\n", + "default": "0" }, { - "name": "column_config", - "type_name": "dict or None", - "is_optional": false, - "description": "

Configures how columns are displayed, e.g. their title, visibility, type, or\nformat. This needs to be a dictionary where each key is a column name and\nthe value is one of:

\n
    \n
  • None to hide the column.
  • \n
  • A string to set the display label of the column.
  • \n
  • One of the column types defined under st.column_config, e.g.\nst.column_config.NumberColumn("Dollar values\u201d, format=\u201d$ %d") to show\na column as dollar amounts. See more info on the available column types\nand config options here.
  • \n
\n

To configure the index column(s), use _index as the column name.

\n", - "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L44" - }, - "DeltaGenerator.date_input": { - "name": "date_input", - "signature": "element.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, format=\"YYYY/MM/DD\", disabled=False, label_visibility=\"visible\")", - "examples": "
\n
\nimport datetime\nimport streamlit as st\n\nd = st.date_input("When's your birthday", datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n
\nimport datetime\nimport streamlit as st\n\ntoday = datetime.datetime.now()\nnext_year = today.year + 1\njan_1 = datetime.date(next_year, 1, 1)\ndec_31 = datetime.date(next_year, 12, 31)\n\nd = st.date_input(\n    "Select your vacation for next year",\n    (jan_1, datetime.date(next_year, 1, 7)),\n    jan_1,\n    dec_31,\n    format="MM.DD.YYYY",\n)\nd\n
\n\n \n
\n", - "description": "

Display a date input widget.

\n", - "args": [ - { - "name": "label", - "type_name": "str", + "name": "max_value", + "type_name": "a supported type or None", "is_optional": false, - "description": "

A short label explaining to the user what this date input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", - "default": null + "description": "

The maximum permitted value.\nDefaults to 100 if the value is an int, 1.0 if a float,\nvalue + timedelta(days=14) if a date/datetime, time.max if a time

\n", + "default": "100" }, { "name": "value", - "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", + "type_name": "a supported type or a tuple/list of supported types or None", "is_optional": false, - "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", - "default": "today" + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to min_value.

\n", + "default": "min_value" }, { - "name": "min_value", - "type_name": "datetime.date or datetime.datetime", + "name": "step", + "type_name": "int/float/timedelta or None", "is_optional": false, - "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", - "default": "value" + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", + "default": "1" }, { - "name": "max_value", - "type_name": "datetime.date or datetime.datetime", + "name": "format", + "type_name": "str or None", "is_optional": false, - "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", - "default": "value" + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. This does not impact the return value.\nFormatter for int/float supports: %d %e %f %g %i\nFormatter for date/time/datetime uses Moment.js notation:\nhttps://momentjs.com/docs/#/displaying/format/

\n", + "default": null }, { "name": "key", @@ -18184,14 +16466,14 @@ "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the input.

\n", + "description": "

An optional tooltip that gets displayed next to the slider.

\n", "default": null }, { "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this date_input's value changes.

\n", + "description": "

An optional callback invoked when this slider's value changes.

\n", "default": null }, { @@ -18208,88 +16490,179 @@ "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, - { - "name": "format", - "type_name": "str", - "is_optional": false, - "description": "

A format string controlling how the interface should display dates.\nSupports \u201cYYYY/MM/DD\u201d (default), \u201cDD/MM/YYYY\u201d, or \u201cMM/DD/YYYY\u201d.\nYou may also use a period (.) or hyphen (-) as separators.

\n", - "default": null - }, { "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "description": "

An optional boolean, which disables the slider if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", "default": "False" }, { "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", "default": "is" } ], "returns": [ { - "type_name": "datetime.date or a tuple with 0-2 dates", + "type_name": "int/float/date/time/datetime or tuple of int/float/date/time/datetime", "is_generator": false, - "description": "

The current value of the date input widget.

\n", + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/time_widgets.py#L415" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/slider.py#L178" }, - "DeltaGenerator.dg": { - "name": "dg", - "signature": "element.dg", - "description": "

Get our DeltaGenerator.

\n", + "DeltaGenerator.snow": { + "name": "snow", + "signature": "element.snow(self)", + "example": "
\n
\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", + "description": "Draw celebratory snowfall.", "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/alert.py#L156" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/snow.py#L25" }, - "DeltaGenerator.divider": { - "name": "divider", - "signature": "element.divider()", - "example": "
\n
\nimport streamlit as st\n\nst.divider()\n
\n
\n", - "description": "

Display a horizontal rule.

\n
\n

Note

\n

You can achieve the same effect with st.write("---") or\neven just "---" in your script (via magic).

\n
\n", - "args": [], + "DeltaGenerator.subheader": { + "name": "subheader", + "signature": "element.subheader(self, body, anchor=None)", + "example": "
\n
\nst.subheader('This is a subheader')\n
\n
\n", + "description": "Display text in subheader formatting.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display.

\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/markdown.py#L258" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/heading.py#L53" }, - "DeltaGenerator.download_button": { - "name": "download_button", - "signature": "element.download_button(label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", - "examples": "
\n

Download a large DataFrame as a CSV:

\n
\nimport streamlit as st\n\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\nimport streamlit as st\n\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nimport streamlit as st\n\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nimport streamlit as st\n\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n
\n", - "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", + "DeltaGenerator.success": { + "name": "success", + "signature": "element.success(self, body, *, icon=None)", + "example": "
\n
\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", + "description": "Display a success message.", "args": [ { - "name": "label", + "name": "icon", + "type_name": "None", + "is_optional": false, + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" + }, + { + "name": "body", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "description": "

The success text to display.

\n", "default": null - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/alert.py#L129" + }, + "DeltaGenerator.table": { + "name": "table", + "signature": "element.table(self, data=None)", + "example": "
\n
\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", + "args": [ { "name": "data", - "type_name": "str or bytes or file", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", "is_optional": false, - "description": "

The contents of the file to be downloaded. See example below for\ncaching techniques to avoid recomputing this data unnecessarily.

\n", + "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/dataframe_selector.py#L112" + }, + "DeltaGenerator.tabs": { + "name": "tabs", + "signature": "element.tabs(self, tabs)", + "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", + "args": [ { - "name": "file_name", + "name": "tabs", + "type_name": "list of strings", + "is_optional": false, + "description": "

Creates a tab for each string in the list. The string is used as the name of the tab.\nThe first tab is selected by default.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/layouts.py#L199" + }, + "DeltaGenerator.text": { + "name": "text", + "signature": "element.text(self, body)", + "example": "
\n
\nst.text('This is some text.')\n
\n
\n", + "description": "Write fixed-width and preformatted text.", + "args": [ + { + "name": "body", "type_name": "str", "is_optional": false, - "description": "

An optional string to use as the name of the file to be downloaded,\nsuch as 'my_file.csv'. If not specified, the name will be\nautomatically generated.

\n", + "description": "

The string to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/text.py#L27" + }, + "DeltaGenerator.text_area": { + "name": "text_area", + "signature": "element.text_area(self, label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", + "description": "Display a multi-line text input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { - "name": "mime", - "type_name": "str or None", + "name": "value", + "type_name": "object", "is_optional": false, - "description": "

The MIME type of the data. If None, defaults to "text/plain"\n(if data is of type str or is a textual file) or\n"application/octet-stream" (if data is of type bytes or is a\nbinary file).

\n", - "default": "s" + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Maximum number of characters allowed in text area.

\n", + "default": null }, { "name": "key", @@ -18302,14 +16675,14 @@ "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "description": "

An optional tooltip that gets displayed next to the textarea.

\n", "default": null }, { - "name": "on_click", + "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this button is clicked.

\n", + "description": "

An optional callback invoked when this text_area's value changes.

\n", "default": null }, { @@ -18327,192 +16700,97 @@ "default": null }, { - "name": "type", - "type_name": "\"secondary\" or \"primary\"", + "name": "placeholder", + "type_name": "str or None", "is_optional": false, - "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", - "default": "s" + "description": "

An optional string displayed when the text area is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null }, { "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "description": "

An optional boolean, which disables the text area if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", "default": "False" }, { - "name": "use_container_width", - "type_name": "bool", + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", "is_optional": false, - "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", - "default": null + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" } ], "returns": [ { - "type_name": "bool", + "type_name": "str", "is_generator": false, - "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "description": "

The current value of the text input widget.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/button.py#L170" - }, - "DeltaGenerator.empty": { - "name": "empty", - "signature": "element.empty()", - "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport streamlit as st\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nimport streamlit as st\n\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", - "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", - "args": [], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/empty.py#L24" - }, - "DeltaGenerator.error": { - "name": "error", - "signature": "element.error(body, *, icon=None)", - "example": "
\n
\nimport streamlit as st\n\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", - "description": "

Display error message.

\n", - "args": [ - { - "name": "body", - "type_name": "str", - "is_optional": false, - "description": "

The error text to display.

\n", - "default": null - }, - { - "name": "icon", - "type_name": "str or None", - "is_optional": false, - "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", - "default": "None" - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/alert.py#L27" - }, - "DeltaGenerator.exception": { - "name": "exception", - "signature": "element.exception(exception)", - "example": "
\n
\nimport streamlit as st\n\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", - "description": "

Display an exception.

\n", - "args": [ - { - "name": "exception", - "type_name": "Exception", - "is_optional": false, - "description": "

The exception to display.

\n", - "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/exception.py#L50" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/text_widgets.py#L250" }, - "DeltaGenerator.expander": { - "name": "expander", - "signature": "element.expander(label, expanded=False)", - "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n
\n", - "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "DeltaGenerator.text_input": { + "name": "text_input", + "signature": "element.text_input(self, label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a single-line text input widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", - "default": null - }, - { - "name": "expanded", - "type_name": "bool", - "is_optional": false, - "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", - "default": "s" - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/layouts.py#L319" - }, - "DeltaGenerator.experimental_data_editor": { - "name": "experimental_data_editor", - "signature": "element.experimental_data_editor(data, *, width=None, height=None, use_container_width=False, hide_index=None, column_order=None, column_config=None, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", - "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

Or you can customize the data editor via column_config, hide_index, column_order, or disabled:

\n
\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    [\n        {"command": "st.selectbox", "rating": 4, "is_widget": True},\n        {"command": "st.balloons", "rating": 5, "is_widget": False},\n        {"command": "st.time_input", "rating": 3, "is_widget": True},\n    ]\n)\nedited_df = st.data_editor(\n    df,\n    column_config={\n        "command": "Streamlit Command",\n        "rating": st.column_config.NumberColumn(\n            "Your rating",\n            help="How much do you like this command (1-5)?",\n            min_value=1,\n            max_value=5,\n            step=1,\n            format="%d \u2b50",\n        ),\n        "is_widget": "Widget ?",\n    },\n    disabled=["command", "is_widget"],\n    hide_index=True,\n)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n
\n", - "description": "

Display a data editor widget.

\n

The data editor widget allows you to edit dataframes and many other data structures in a table-like UI.

\n
\n

Warning

\n

When going from st.experimental_data_editor to st.data_editor in\n1.23.0, the data editor's representation in st.session_state was changed.\nThe edited_cells dictionary is now called edited_rows and uses a\ndifferent format ({0: {"column name": "edited value"}} instead of\n{"0:1": "edited value"}). You may need to adjust the code if your app uses\nst.experimental_data_editor in combination with st.session_state."

\n
\n", - "args": [ - { - "name": "data", - "type_name": "pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None", - "is_optional": false, - "description": "

The data to edit in the data editor.

\n
\n

Note

\n
    \n
  • Styles from pandas.Styler will only be applied to non-editable columns.
  • \n
  • Mixing data types within a column can make the column uneditable.
  • \n
  • Additionally, the following data types are not yet supported for editing:\ncomplex, list, tuple, bytes, bytearray, memoryview, dict, set, frozenset,\ndatetime.timedelta, decimal.Decimal, fractions.Fraction, pandas.Interval,\npandas.Period, pandas.Timedelta.
  • \n
\n
\n", + "description": "

A short label explaining to the user what this input is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { - "name": "width", - "type_name": "int or None", + "name": "value", + "type_name": "object", "is_optional": false, - "description": "

Desired width of the data editor expressed in pixels. If None, the width will\nbe automatically determined.

\n", + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", "default": null }, { - "name": "height", + "name": "max_chars", "type_name": "int or None", "is_optional": false, - "description": "

Desired height of the data editor expressed in pixels. If None, the height will\nbe automatically determined.

\n", - "default": null - }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "

If True, set the data editor width to the width of the parent container.\nThis takes precedence over the width argument. Defaults to False.

\n", - "default": "False" - }, - { - "name": "hide_index", - "type_name": "bool or None", - "is_optional": false, - "description": "

Whether to hide the index column(s). If None (default), the visibility of\nindex columns is automatically determined based on the data.

\n", - "default": null - }, - { - "name": "column_order", - "type_name": "iterable of str or None", - "is_optional": false, - "description": "

Specifies the display order of columns. This also affects which columns are\nvisible. For example, column_order=("col2", "col1") will display 'col2'\nfirst, followed by 'col1', and will hide all other non-index columns. If\nNone (default), the order is inherited from the original data structure.

\n", + "description": "

Max number of characters allowed in text input.

\n", "default": null }, { - "name": "column_config", - "type_name": "dict or None", + "name": "key", + "type_name": "str or int", "is_optional": false, - "description": "

Configures how columns are displayed, e.g. their title, visibility, type, or\nformat, as well as editing properties such as min/max value or step.\nThis needs to be a dictionary where each key is a column name and the value\nis one of:

\n
    \n
  • None to hide the column.
  • \n
  • A string to set the display label of the column.
  • \n
  • One of the column types defined under st.column_config, e.g.\nst.column_config.NumberColumn("Dollar values\u201d, format=\u201d$ %d") to show\na column as dollar amounts. See more info on the available column types\nand config options here.
  • \n
\n

To configure the index column(s), use _index as the column name.

\n", + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", "default": null }, { - "name": "num_rows", - "type_name": "\"fixed\" or \"dynamic\"", + "name": "type", + "type_name": "str", "is_optional": false, - "description": "

Specifies if the user can add and delete rows in the data editor.\nIf "fixed", the user cannot add or delete rows. If "dynamic", the user can\nadd and delete rows in the data editor, but column sorting is disabled.\nDefaults to "fixed".

\n", + "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", "default": "s" }, { - "name": "disabled", - "type_name": "bool or iterable of str", + "name": "help", + "type_name": "str", "is_optional": false, - "description": "

Controls the editing of columns. If True, editing is disabled for all columns.\nIf an iterable of column names is provided (e.g., disabled=("col1", "col2")),\nonly the specified columns will be disabled for editing. If False (default),\nall columns that support editing are editable.

\n", + "description": "

An optional tooltip that gets displayed next to the input.

\n", "default": null }, { - "name": "key", + "name": "autocomplete", "type_name": "str", "is_optional": false, - "description": "

An optional string to use as the unique key for this widget. If this\nis omitted, a key will be generated for the widget based on its\ncontent. Multiple widgets of the same type may not share the same\nkey.

\n", + "description": "

An optional value that will be passed to the <input> element's\nautocomplete property. If unspecified, this value will be set to\n"new-password" for "password" inputs, and the empty string for\n"default" inputs. For more details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

\n", "default": null }, { "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this data_editor's value changes.

\n", + "description": "

An optional callback invoked when this text_input's value changes.

\n", "default": null }, { @@ -18528,44 +16806,58 @@ "is_optional": false, "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text input is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" } ], "returns": [ { - "type_name": "pandas.DataFrame, pandas.Series, pyarrow.Table, numpy.ndarray, list, set, tuple, or dict.", + "type_name": "str", "is_generator": false, - "description": "

The edited data. The edited data is returned in its original data type if\nit corresponds to any of the supported return types. All other data types\nare returned as a pd.DataFrame.

\n", + "description": "

The current value of the text input widget.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/data_editor.py#L529" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/text_widgets.py#L70" }, - "DeltaGenerator.file_uploader": { - "name": "file_uploader", - "signature": "element.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nimport streamlit as st\nimport pandas as pd\nfrom io import StringIO\n\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nimport streamlit as st\n\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n
\n", - "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "DeltaGenerator.time_input": { + "name": "time_input", + "signature": "element.time_input(self, label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a time input widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this file uploader is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this time input is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { - "name": "type", - "type_name": "str or list of str or None", - "is_optional": false, - "description": "

Array of allowed extensions. ['png', 'jpg']\nThe default is None, which means all extensions are allowed.

\n", - "default": "None" - }, - { - "name": "accept_multiple_files", - "type_name": "bool", + "name": "value", + "type_name": "datetime.time/datetime.datetime", "is_optional": false, - "description": "

If True, allows the user to upload multiple files at the same time,\nin which case the return value will be a list of files.\nDefault: False

\n", - "default": "False" + "description": "

The value of this widget when it first renders. This will be\ncast to str internally. Defaults to the current time.

\n", + "default": "the" }, { "name": "key", @@ -18578,14 +16870,14 @@ "name": "help", "type_name": "str", "is_optional": false, - "description": "

A tooltip that gets displayed next to the file uploader.

\n", + "description": "

An optional tooltip that gets displayed next to the input.

\n", "default": null }, { "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this file_uploader's value\nchanges.

\n", + "description": "

An optional callback invoked when this time_input's value changes.

\n", "default": null }, { @@ -18606,570 +16898,680 @@ "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

An optional boolean, which disables the file uploader if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "description": "

An optional boolean, which disables the time input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", "default": "False" }, { "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", "default": "is" } ], "returns": [ { - "type_name": "None or UploadedFile or list of UploadedFile", + "type_name": "datetime.time", "is_generator": false, - "description": "
    \n
  • If accept_multiple_files is False, returns either None or\nan UploadedFile object.
  • \n
  • If accept_multiple_files is True, returns a list with the\nuploaded files as UploadedFile objects. If no files were\nuploaded, returns an empty list.
  • \n
\n

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "description": "

The current value of the time input widget.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/file_uploader.py#L222" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/time_widgets.py#L218" }, - "DeltaGenerator.form": { - "name": "form", - "signature": "element.form(key, clear_on_submit=False)", - "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n\n \n
\n", - "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
  • Within a form, the only widget that can have a callback function is\nst.form_submit_button.
  • \n
\n", + "DeltaGenerator.title": { + "name": "title", + "signature": "element.title(self, body, anchor=None)", + "example": "
\n
\nst.title('This is a title')\n
\n
\n", + "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", "args": [ { - "name": "key", + "name": "body", "type_name": "str", "is_optional": false, - "description": "

A string that identifies the form. Each form must have its own\nkey. (This key is not displayed to the user in the interface.)

\n", + "description": "

The text to display.

\n", "default": null }, { - "name": "clear_on_submit", - "type_name": "bool", + "name": "anchor", + "type_name": "str", "is_optional": false, - "description": "

If True, all widgets inside the form will be reset to their default\nvalues after the user presses the Submit button. Defaults to False.\n(Note that Custom Components are unaffected by this flag, and\nwill not be reset to their defaults on form submission.)

\n", - "default": "values" + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/form.py#L118" + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/heading.py#L81" }, - "DeltaGenerator.form_submit_button": { - "name": "form_submit_button", - "signature": "element.form_submit_button(label=\"Submit\", help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", - "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", + "DeltaGenerator.vega_lite_chart": { + "name": "vega_lite_chart", + "signature": "element.vega_lite_chart(self, data=None, spec=None, use_container_width=False, **kwargs)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(df, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", + "description": "Display a chart using the Vega-Lite library.", "args": [ { - "name": "label", - "type_name": "str", + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", "is_optional": false, - "description": "

A short label explaining to the user what this button is for.\nDefaults to "Submit".

\n", - "default": "s" + "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null }, { - "name": "help", - "type_name": "str or None", + "name": "spec", + "type_name": "dict or None", "is_optional": false, - "description": "

A tooltip that gets displayed when the button is hovered over.\nDefaults to None.

\n", - "default": "None" + "description": "

The Vega-Lite spec for the chart. If the spec was already passed in\nthe previous argument, this must be set to None. See\nhttps://vega.github.io/vega-lite/docs/ for more info.

\n", + "default": null }, { - "name": "on_click", - "type_name": "callable", + "name": "use_container_width", + "type_name": "bool", "is_optional": false, - "description": "

An optional callback invoked when this button is clicked.

\n", + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", "default": null }, { - "name": "args", - "type_name": "tuple", + "name": "**kwargs", + "type_name": "any", "is_optional": false, - "description": "

An optional tuple of args to pass to the callback.

\n", + "description": "

Same as spec, but as keywords.

\n", "default": null - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/dataframe_selector.py#L443" + }, + "DeltaGenerator.video": { + "name": "video", + "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)", + "example": "
\n
\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", + "description": "Display a video player.", + "args": [ { - "name": "kwargs", - "type_name": "dict", + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", "is_optional": false, - "description": "

An optional dict of kwargs to pass to the callback.

\n", + "description": "

io.open().\nRaw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", "default": null }, { - "name": "type", - "type_name": "\"secondary\" or \"primary\"", + "name": "format", + "type_name": "str", "is_optional": false, - "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "description": "

The mime type for the video file. Defaults to 'video/mp4'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", "default": "s" }, { - "name": "disabled", - "type_name": "bool", + "name": "start_time", + "type_name": "int", "is_optional": false, - "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", - "default": "False" + "description": "

The time from which this element should start playing.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/media.py#L81" + }, + "DeltaGenerator.warning": { + "name": "warning", + "signature": "element.warning(self, body, *, icon=None)", + "example": "
\n
\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", + "description": "Display warning message.", + "args": [ + { + "name": "icon", + "type_name": "None", + "is_optional": false, + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" }, { - "name": "use_container_width", - "type_name": "bool", + "name": "body", + "type_name": "str", "is_optional": false, - "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "description": "

The warning text to display.

\n", "default": null } ], - "returns": [ + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/alert.py#L68" + }, + "DeltaGenerator.write": { + "name": "write", + "signature": "element.write(self, *args, **kwargs)", + "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nwrite('Hello, *World!* :sunglasses:')\n
\n\n \n \n (view standalone Streamlit app)\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n \n (view standalone Streamlit app)\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n \n (view standalone Streamlit app)\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression and emoji shortcodes.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", + "default": null + }, { + "name": "unsafe_allow_html", "type_name": "bool", - "is_generator": false, - "description": "

True if the button was clicked.

\n", - "return_name": null + "is_optional": false, + "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n

Also note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.

\n

If you decide to turn on HTML anyway, we ask you to please tell us your\nexact use case here:\nhttps://discuss.streamlit.io/t/96 .

\n

This will help us come up with safe APIs that allow you to do what you\nwant.

\n", + "default": "False" } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/form.py#L218" - }, - "DeltaGenerator.graphviz_chart": { - "name": "graphviz_chart", - "signature": "element.graphviz_chart(figure_or_dot, use_container_width=False)", - "example": "
\n
\nimport streamlit as st\nimport graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n
\n", - "description": "

Display a graph using the dagre-d3 library.

\n", + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.13.0/lib/streamlit/elements/write.py#L44" + } + }, + "1.14.0": { + "streamlit.altair_chart": { + "name": "altair_chart", + "signature": "st.altair_chart(altair_chart, use_container_width=False)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a chart using the Altair library.", "args": [ { - "name": "figure_or_dot", - "type_name": "graphviz.dot.Graph, graphviz.dot.Digraph, str", + "name": "altair_chart", + "type_name": "altair.vegalite.v2.api.Chart", "is_optional": false, - "description": "

The Graphlib graph object or dot string to display

\n", + "description": "

The Altair chart object to display.

\n", "default": null }, { "name": "use_container_width", "type_name": "bool", "is_optional": false, - "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/graphviz_chart.py#L39" + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/dataframe_selector.py#L395" }, - "DeltaGenerator.header": { - "name": "header", - "signature": "element.header(body, anchor=None, *, help=None, divider=False)", - "examples": "
\n
\nimport streamlit as st\n\nst.header('This is a header with a divider', divider='rainbow')\nst.header('_Streamlit_ is :blue[cool] :sunglasses:')\n
\n\n \n
\n", - "description": "

Display text in header formatting.

\n", + "streamlit.area_chart": { + "name": "area_chart", + "signature": "st.area_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", "args": [ { - "name": "body", - "type_name": "str", + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, snowflake.snowpark.dataframe.DataFrame, Iterable, or dict", "is_optional": false, - "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null }, { - "name": "anchor", - "type_name": "str or False", + "name": "x", + "type_name": "str or None", "is_optional": false, - "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", "default": null }, { - "name": "help", - "type_name": "str", + "name": "y", + "type_name": "str, sequence of str, or None", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the header.

\n", + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", "default": null }, { - "name": "divider", - "type_name": "bool or \u201cblue\u201d, \u201cgreen\u201d, \u201corange\u201d, \u201cred\u201d, \u201cviolet\u201d, \u201cgray\u201d/\"grey\", or \u201crainbow\u201d", + "name": "width", + "type_name": "int", "is_optional": false, - "description": "

Shows a colored divider below the header. If True, successive\nheaders will cycle through divider colors. That is, the first\nheader will have a blue line, the second header will have a\ngreen line, and so on. If a string, the color can be set to one of\nthe following: blue, green, orange, red, violet, gray/grey, or\nrainbow.

\n", + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/heading.py#L41" + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/dataframe_selector.py#L228" }, - "DeltaGenerator.help": { - "name": "help", - "signature": "element.help(obj=)", - "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nimport streamlit as st\nimport pandas\n\nst.help(pandas.DataFrame)\n
\n\n \n

Want to quickly check what data type is output by a certain function?\nTry:

\n
\nimport streamlit as st\n\nx = my_poorly_documented_function()\nst.help(x)\n
\n

Want to quickly inspect an object? No sweat:

\n
\nclass Dog:\n  '''A typical dog.'''\n\n  def __init__(self, breed, color):\n    self.breed = breed\n    self.color = color\n\n  def bark(self):\n    return 'Woof!'\n\n\nfido = Dog('poodle', 'white')\n\nst.help(fido)\n
\n\n \n

And if you're using Magic, you can get help for functions, classes,\nand modules without even typing st.help:

\n
\nimport streamlit as st\nimport pandas\n\n# Get help for Pandas read_csv:\npandas.read_csv\n\n# Get help for Streamlit itself:\nst\n
\n\n \n
\n", - "description": "

Display help and other information for a given object.

\n

Depending on the type of object that is passed in, this displays the\nobject's name, type, value, signature, docstring, and member variables,\nmethods \u2014 as well as the values/docstring of members and methods.

\n", + "streamlit.audio": { + "name": "audio", + "signature": "st.audio(data, format=\"audio/wav\", start_time=0)", + "example": "
\n
\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an audio player.", "args": [ { - "name": "obj", - "type_name": "any", + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", "is_optional": false, - "description": "

The object whose information should be displayed. If left\nunspecified, this call will display help for Streamlit itself.

\n", + "description": "

io.open().\nRaw audio data, filename, or a URL pointing to the file to load.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "default": null + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/doc_string.py#L48" + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/media.py#L41" }, - "DeltaGenerator.id": { - "name": "id", - "signature": "element.id" + "streamlit.balloons": { + "name": "balloons", + "signature": "st.balloons()", + "example": "
\n
\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", + "description": "Draw celebratory balloons.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/balloons.py#L25" }, - "DeltaGenerator.image": { - "name": "image", - "signature": "element.image(image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", - "example": "
\n
\nimport streamlit as st\nfrom PIL import Image\n\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n
\n", - "description": "

Display an image or list of images.

\n", + "streamlit.bar_chart": { + "name": "bar_chart", + "signature": "st.bar_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nchart_data = pd.DataFrame(\n    np.random.randn(50, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", "args": [ { - "name": "image", - "type_name": "numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]", + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, snowflake.snowpark.dataframe.DataFrame, Iterable, or dict", "is_optional": false, - "description": "

Monochrome image of shape (w,h) or (w,h,1)\nOR a color image of shape (w,h,3)\nOR an RGBA image of shape (w,h,4)\nOR a URL to fetch the image from\nOR a path of a local image file\nOR an SVG XML string like <svg xmlns=...</svg>\nOR a list of one of the above, to display multiple images.

\n", + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null }, { - "name": "caption", - "type_name": "str or list of str", + "name": "x", + "type_name": "str or None", "is_optional": false, - "description": "

Image caption. If displaying multiple images, caption should be a\nlist of captions (one for each image).

\n", + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", "default": null }, { - "name": "width", - "type_name": "int or None", - "is_optional": false, - "description": "

Image width. None means use the image width,\nbut do not exceed the width of the column.\nShould be set for SVG images, as they have no default image width.

\n", - "default": "image" - }, - { - "name": "use_column_width", - "type_name": "\"auto\", \"always\", \"never\", or bool", + "name": "y", + "type_name": "str, sequence of str, or None", "is_optional": false, - "description": "

If "auto", set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf "always" or True, set the image's width to the column width.\nIf "never" or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", "default": null }, { - "name": "clamp", - "type_name": "bool", + "name": "width", + "type_name": "int", "is_optional": false, - "description": "

Clamp image pixel values to a valid range ([0-255] per channel).\nThis is only meaningful for byte array images; the parameter is\nignored for image URLs. If this is not set, and an image has an\nout-of-range value, an error will be thrown.

\n", + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", "default": null }, { - "name": "channels", - "type_name": "\"RGB\" or \"BGR\"", + "name": "height", + "type_name": "int", "is_optional": false, - "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to "RGB", meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to "BGR", instead.

\n", - "default": "s" + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null }, { - "name": "output_format", - "type_name": "\"JPEG\", \"PNG\", or \"auto\"", + "name": "use_container_width", + "type_name": "bool", "is_optional": false, - "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to "auto" which identifies the compression type based\non the type and format of the image argument.

\n", - "default": "s" + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/image.py#L87" + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/dataframe_selector.py#L311" }, - "DeltaGenerator.info": { - "name": "info", - "signature": "element.info(body, *, icon=None)", - "example": "
\n
\nimport streamlit as st\n\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", - "description": "

Display an informational message.

\n", + "streamlit.beta_columns": { + "name": "beta_columns", + "signature": "st.beta_columns(*args, **kwargs)", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put columns inside another column.

\n
\n", "args": [ { - "name": "body", - "type_name": "str", + "name": "spec", + "type_name": "int or list of numbers", "is_optional": false, - "description": "

The info text to display.

\n", + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", "default": null }, { - "name": "icon", - "type_name": "str or None", + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", "is_optional": false, - "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", - "default": "None" + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null } ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/beta_util.py#L43" + }, + "streamlit.beta_container": { + "name": "beta_container", + "signature": "st.beta_container(*args, **kwargs)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/alert.py#L91" + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/beta_util.py#L43" }, - "DeltaGenerator.json": { - "name": "json", - "signature": "element.json(body, *, expanded=True)", - "example": "
\n
\nimport streamlit as st\n\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n
\n", - "description": "

Display object or string as a pretty-printed JSON string.

\n", + "streamlit.beta_expander": { + "name": "beta_expander", + "signature": "st.beta_expander(*args, **kwargs)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write("""\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    """)\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write("""\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n""")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", "args": [ { - "name": "body", - "type_name": "object or str", + "name": "label", + "type_name": "str", "is_optional": false, - "description": "

The object to print as JSON. All referenced objects should be\nserializable to JSON as well. If object is a string, we assume it\ncontains serialized JSON.

\n", + "description": "

A string to use as the header for the expander.

\n", "default": null }, { "name": "expanded", "type_name": "bool", "is_optional": false, - "description": "

An optional boolean that allows the user to set whether the initial\nstate of this json element should be expanded. Defaults to True.\nThis argument can only be supplied by keyword.

\n", - "default": "True" + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/json.py#L35" + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/beta_util.py#L43" }, - "DeltaGenerator.latex": { - "name": "latex", - "signature": "element.latex(body, *, help=None)", - "example": "
\n
\nimport streamlit as st\n\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", - "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", + "streamlit.bokeh_chart": { + "name": "bokeh_chart", + "signature": "st.bokeh_chart(figure, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", "args": [ { - "name": "body", - "type_name": "str or SymPy expression", + "name": "figure", + "type_name": "bokeh.plotting.figure.Figure", "is_optional": false, - "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", + "description": "

A Bokeh figure to plot.

\n", "default": null }, { - "name": "help", - "type_name": "str", + "name": "use_container_width", + "type_name": "bool", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the LaTeX expression.

\n", + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Bokeh's native width value.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/markdown.py#L210" + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/bokeh_chart.py#L36" }, - "DeltaGenerator.line_chart": { - "name": "line_chart", - "signature": "element.line_chart(data=None, *, x=None, y=None, color=None, width=0, height=0, use_container_width=True)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\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 \n

You can also choose different columns to use for x and y, as well as set\nthe color dynamically based on a 3rd column (assuming your dataframe is in\nlong format):

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame({\n    'col1' : np.random.randn(20),\n    'col2' : np.random.randn(20),\n    'col3' : np.random.choice(['A','B','C'], 20)\n})\n\nst.line_chart(\n    chart_data,\n    x = 'col1',\n    y = 'col2',\n    color = 'col3'\n)\n
\n\n \n

Finally, if your dataframe is in wide format, you can group multiple\ncolumns under the y argument to show multiple lines with different\ncolors:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns = ['col1', 'col2', 'col3'])\n\nst.line_chart(\n    chart_data,\n    x = 'col1',\n    y = ['col2', 'col3'],\n    color = ['#FF0000', '#0000FF']  # Optional\n)\n
\n\n \n
\n", - "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "streamlit.button": { + "name": "button", + "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False)", + "example": "
\n
\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a button widget.", "args": [ { - "name": "data", - "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict or None", + "name": "label", + "type_name": "str", "is_optional": false, - "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "description": "

A short label explaining to the user what this button is for.

\n", "default": null }, { - "name": "x", - "type_name": "str or None", + "name": "key", + "type_name": "str or int", "is_optional": false, - "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", "default": null }, { - "name": "y", - "type_name": "str, sequence of str, or None", + "name": "help", + "type_name": "str", "is_optional": false, - "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", "default": null }, { - "name": "color", - "type_name": "str, tuple, sequence of str, sequence of tuple, or None", + "name": "on_click", + "type_name": "callable", "is_optional": false, - "description": "

The color to use for different lines in this chart. This argument\ncan only be supplied by keyword.

\n

For a line chart with just one line, this can be:

\n
    \n
  • None, to use the default color.
  • \n
  • A hex string like "#ffaa00" or "#ffaa0088".
  • \n
  • An RGB or RGBA tuple with the red, green, blue, and alpha\ncomponents specified as ints from 0 to 255 or floats from 0.0 to\n1.0.
  • \n
\n

For a line chart with multiple lines, where the dataframe is in\nlong format (that is, y is None or just one column), this can be:

\n
    \n
  • None, to use the default colors.

    \n
  • \n
  • The name of a column in the dataset. Data points will be grouped\ninto lines of the same color based on the value of this column.\nIn addition, if the values in this column match one of the color\nformats above (hex string or color tuple), then that color will\nbe used.

    \n

    For example: if the dataset has 1000 rows, but this column can\nonly contains the values "adult", "child", "baby", then\nthose 1000 datapoints will be grouped into three lines, whose\ncolors will be automatically selected from the default palette.

    \n

    But, if for the same 1000-row dataset, this column contained\nthe values "#ffaa00", "#f0f", "#0000ff", then then those 1000\ndatapoints would still be grouped into three lines, but their\ncolors would be "#ffaa00", "#f0f", "#0000ff" this time around.

    \n
  • \n
\n

For a line chart with multiple lines, where the dataframe is in\nwide format (that is, y is a sequence of columns), this can be:

\n
    \n
  • None, to use the default colors.
  • \n
  • A list of string colors or color tuples to be used for each of\nthe lines in the chart. This list should have the same length\nas the number of y values (e.g. color=["#fd0", "#f0f", "#04f"]\nfor three lines).
  • \n
\n", - "default": "color" + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null }, { - "name": "width", - "type_name": "int", + "name": "args", + "type_name": "tuple", "is_optional": false, - "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "description": "

An optional tuple of args to pass to the callback.

\n", "default": null }, { - "name": "height", - "type_name": "int", + "name": "kwargs", + "type_name": "dict", "is_optional": false, - "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, { - "name": "use_container_width", + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", - "default": null + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" } ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L231" + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/button.py#L61" }, - "DeltaGenerator.map": { - "name": "map", - "signature": "element.map(data=None, *, latitude=None, longitude=None, color=None, size=None, zoom=None, use_container_width=True)", - "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n

You can also customize the size and color of the datapoints:

\n
\nst.map(df, size=20, color='#0044ff')\n
\n

And finally, you can choose different columns to use for the latitude\nand longitude components, as well as set size and color of each\ndatapoint dynamically based on other columns:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame({\n    "col1": np.random.randn(1000) / 50 + 37.76,\n    "col2": np.random.randn(1000) / 50 + -122.4,\n    "col3": np.random.randn(1000) * 100,\n    "col4": np.random.rand(1000, 4).tolist(),\n})\n\nst.map(df,\n    latitude='col1',\n    longitude='col2',\n    size='col3',\n    color='col4')\n
\n\n \n
\n", - "description": "

Display a map with a scatterplot overlaid onto it.

\n

This is a wrapper around st.pydeck_chart to quickly create\nscatterplot charts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "streamlit.cache": { + "name": "cache", + "signature": "st.cache(func=None, persist=False, allow_output_mutation=False, show_spinner=True, suppress_st_warning=False, hash_funcs=None, max_entries=None, ttl=None)", + "example": "
\n
\n@st.cache\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\n@st.cache(persist=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To disable hashing return values, set the allow_output_mutation parameter to True:

\n
\n@st.cache(allow_output_mutation=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. MongoClient) to a hash function (id) like this:

\n
\n@st.cache(hash_funcs={MongoClient: id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "pymongo.mongo_client.MongoClient") to the hash function instead:

\n
\n@st.cache(hash_funcs={"pymongo.mongo_client.MongoClient": id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n
\n", + "description": "Function decorator to memoize function executions.", "args": [ { - "name": "data", - "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "name": "func", + "type_name": "callable", "is_optional": false, - "description": "

The data to be plotted.

\n", + "description": "

The function to cache. Streamlit hashes the function and dependent code.

\n", "default": null }, { - "name": "latitude", - "type_name": "str or None", + "name": "persist", + "type_name": "boolean", "is_optional": false, - "description": "

The name of the column containing the latitude coordinates of\nthe datapoints in the chart. This argument can only be supplied\nby keyword.

\n

If None, the latitude data will come from any column named 'lat',\n'latitude', 'LAT', or 'LATITUDE'.

\n", + "description": "

Whether to persist the cache on disk.

\n", "default": null }, { - "name": "longitude", - "type_name": "str or None", + "name": "allow_output_mutation", + "type_name": "boolean", "is_optional": false, - "description": "

The name of the column containing the longitude coordinates of\nthe datapoints in the chart. This argument can only be supplied\nby keyword.

\n

If None, the longitude data will come from any column named 'lon',\n'longitude', 'LON', or 'LONGITUDE'.

\n", + "description": "

Streamlit shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.

\n

If you know what you're doing and would like to override this warning, set this to True.

\n", "default": null }, { - "name": "color", - "type_name": "str or tuple or None", + "name": "show_spinner", + "type_name": "boolean", "is_optional": false, - "description": "

The color of the circles representing each datapoint. This argument\ncan only be supplied by keyword.

\n

Can be:

\n
    \n
  • None, to use the default color.
  • \n
  • A hex string like "#ffaa00" or "#ffaa0088".
  • \n
  • An RGB or RGBA tuple with the red, green, blue, and alpha\ncomponents specified as ints from 0 to 255 or floats from 0.0 to\n1.0.
  • \n
  • The name of the column to use for the color. Cells in this column\nshould contain colors represented as a hex string or color tuple,\nas described above.
  • \n
\n", - "default": "color" + "description": "

Enable the spinner. Default is True to show a spinner when there is\na cache miss.

\n", + "default": "True" }, { - "name": "size", - "type_name": "str or float or None", + "name": "suppress_st_warning", + "type_name": "boolean", "is_optional": false, - "description": "

The size of the circles representing each point, in meters. This\nargument can only be supplied by keyword.

\n

This can be:

\n
    \n
  • None, to use the default size.
  • \n
  • A number like 100, to specify a single size to use for all\ndatapoints.
  • \n
  • The name of the column to use for the size. This allows each\ndatapoint to be represented by a circle of a different size.
  • \n
\n", - "default": "size" + "description": "

Suppress warnings about calling Streamlit functions from within\nthe cached function.

\n", + "default": null }, { - "name": "zoom", - "type_name": "int", + "name": "hash_funcs", + "type_name": "dict or None", "is_optional": false, - "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels.\nThis argument can only be supplied by keyword.

\n", + "description": "

Mapping of types or fully qualified names to hash functions. This is used to override\nthe behavior of the hasher inside Streamlit's caching mechanism: when the hasher\nencounters an object, it will first check to see if its type matches a key in this\ndict and, if so, will use the provided function to generate a hash for it. See below\nfor an example of how this can be used.

\n", "default": null }, { - "name": "use_container_width", - "type_name": "bool", + "name": "max_entries", + "type_name": "int or None", "is_optional": false, - "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", - "default": null + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None" + }, + { + "name": "ttl", + "type_name": "float or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.

\n", + "default": "None" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/map.py#L91" + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/runtime/legacy_caching/caching.py#L400" }, - "DeltaGenerator.markdown": { - "name": "markdown", - "signature": "element.markdown(body, unsafe_allow_html=False, *, help=None)", - "examples": "
\n
\nimport streamlit as st\n\nst.markdown("*Streamlit* is **really** ***cool***.")\nst.markdown('''\n    :red[Streamlit] :orange[can] :green[write] :blue[text] :violet[in]\n    :gray[pretty] :rainbow[colors].''')\nst.markdown("Here's a bouquet &mdash;\\\n            :tulip::cherry_blossom::rose::hibiscus::sunflower::blossom:")\n\nmulti = '''If you end a line with two spaces,\na soft return is used for the next line.\n\nTwo (or more) newline characters in a row will result in a hard return.\n'''\nst.markdown(multi)\n
\n\n \n
\n", - "description": "

Display string formatted as Markdown.

\n", + "streamlit.camera_input": { + "name": "camera_input", + "signature": "st.camera_input(label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", + "description": "Display a widget that returns pictures from the user's webcam.", "args": [ { - "name": "body", + "name": "label", "type_name": "str", "is_optional": false, - "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", + "description": "

A short label explaining to the user what this widget is used for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { - "name": "unsafe_allow_html", - "type_name": "bool", + "name": "key", + "type_name": "str or int", "is_optional": false, - "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", "default": null }, { "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the Markdown.

\n", - "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/markdown.py#L31" - }, - "DeltaGenerator.metric": { - "name": "metric", - "signature": "element.metric(label, value, delta=None, delta_color=\"normal\", help=None, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n

st.metric looks especially nice in combination with st.columns:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n

The delta indicator color can also be inverted or turned off:

\n
\nimport streamlit as st\n\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n
\n", - "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", - "args": [ - { - "name": "label", - "type_name": "str", - "is_optional": false, - "description": "

The header or title for the metric. The label can optionally contain\nMarkdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "description": "

A tooltip that gets displayed next to the camera input.

\n", "default": null }, { - "name": "value", - "type_name": "int, float, str, or None", + "name": "on_change", + "type_name": "callable", "is_optional": false, - "description": "

Value of the metric. None is rendered as a long dash.

\n", + "description": "

An optional callback invoked when this camera_input's value\nchanges.

\n", "default": null }, { - "name": "delta", - "type_name": "int, float, str, or None", + "name": "args", + "type_name": "tuple", "is_optional": false, - "description": "

Indicator of how the metric changed, rendered with an arrow below\nthe metric. If delta is negative (int/float) or starts with a minus\nsign (str), the arrow points down and the text is red; else the\narrow points up and the text is green. If None (default), no delta\nindicator is shown.

\n", + "description": "

An optional tuple of args to pass to the callback.

\n", "default": null }, { - "name": "delta_color", - "type_name": "\"normal\", \"inverse\", or \"off\"", + "name": "kwargs", + "type_name": "dict", "is_optional": false, - "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", + "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, { - "name": "help", - "type_name": "str", + "name": "disabled", + "type_name": "bool", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the metric label.

\n", - "default": null + "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" }, { "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", "default": "is" } ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/metric.py#L46" + "returns": [ + { + "type_name": "None or UploadedFile", + "is_generator": false, + "description": "

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/camera_input.py#L109" }, - "DeltaGenerator.multiselect": { - "name": "multiselect", - "signature": "element.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, max_selections=None, placeholder=\"Choose an option\", disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n
\n", - "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", + "streamlit.caption": { + "name": "caption", + "signature": "st.caption(body, unsafe_allow_html=False)", + "example": "
\n
\nst.caption('This is a string that explains something above.')\n
\n
\n", + "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", "args": [ { - "name": "label", + "name": "body", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

The text to display.

\n", "default": null }, { - "name": "options", - "type_name": "Sequence[V], numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "name": "unsafe_allow_html", + "type_name": "bool", "is_optional": false, - "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", "default": null - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/markdown.py#L107" + }, + "streamlit.checkbox": { + "name": "checkbox", + "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a checkbox widget.", + "args": [ { - "name": "default", - "type_name": "[V], V, or None", + "name": "label", + "type_name": "str", "is_optional": false, - "description": "

List of default values. Can also be a single value.

\n", - "default": "values" + "description": "

A short label explaining to the user what this checkbox is for.

\n", + "default": null }, { - "name": "format_func", - "type_name": "function", + "name": "value", + "type_name": "bool", "is_optional": false, - "description": "

Function to modify the display of selectbox options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe multiselect.

\n", + "description": "

Preselect the checkbox when it first renders. This will be\ncast to bool internally.

\n", "default": null }, { @@ -19183,14 +17585,14 @@ "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the multiselect.

\n", + "description": "

An optional tooltip that gets displayed next to the checkbox.

\n", "default": null }, { "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this multiselect's value changes.

\n", + "description": "

An optional callback invoked when this checkbox's value changes.

\n", "default": null }, { @@ -19207,92 +17609,67 @@ "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, - { - "name": "max_selections", - "type_name": "int", - "is_optional": false, - "description": "

The max selections that can be selected at a time.\nThis argument can only be supplied by keyword.

\n", - "default": null - }, - { - "name": "placeholder", - "type_name": "str", - "is_optional": false, - "description": "

A string to display when no options are selected. Defaults to 'Choose an option'.

\n", - "default": "s" - }, { "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

An optional boolean, which disables the multiselect widget if set\nto True. The default is False. This argument can only be supplied\nby keyword.

\n", + "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", "default": "False" - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" } ], "returns": [ { - "type_name": "list", + "type_name": "bool", "is_generator": false, - "description": "

A list with the selected options

\n", + "description": "

Whether or not the checkbox is checked.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/multiselect.py#L146" + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/checkbox.py#L48" }, - "DeltaGenerator.number_input": { - "name": "number_input", - "signature": "element.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n
\n", - "description": "

Display a numeric input widget.

\n
\n

Note

\n

Integer values exceeding +/- (1<<53) - 1 cannot be accurately\nstored or returned by the widget due to serialization contstraints\nbetween the Python server and JavaScript client. You must handle\nsuch numbers as floats, leading to a loss in precision.

\n
\n", + "streamlit.code": { + "name": "code", + "signature": "st.code(body, language=\"python\")", + "example": "
\n
\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", + "description": "

Display a code block with optional syntax highlighting.

\n

(This is a convenience wrapper around st.markdown())

\n", "args": [ { - "name": "label", + "name": "body", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

The string to display as code.

\n", "default": null }, { - "name": "min_value", - "type_name": "int, float, or None", + "name": "language", + "type_name": "str or None", "is_optional": false, - "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", - "default": null - }, + "description": "

The language that the code is written in, for syntax highlighting.\nIf None, the code will be unstyled. Defaults to "python".

\n

For a list of available language values, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/markdown.py#L74" + }, + "streamlit.color_picker": { + "name": "color_picker", + "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a color picker widget.", + "args": [ { - "name": "max_value", - "type_name": "int, float, or None", + "name": "label", + "type_name": "str", "is_optional": false, - "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", + "description": "

A short label explaining to the user what this input is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { "name": "value", - "type_name": "int, float, or None", - "is_optional": false, - "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", - "default": "min_value" - }, - { - "name": "step", - "type_name": "int, float, or None", - "is_optional": false, - "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", - "default": "1" - }, - { - "name": "format", - "type_name": "str or None", + "type_name": "str", "is_optional": false, - "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. Output must be purely numeric. This does not impact\nthe return value. Valid formatters: %d %e %f %g %i %u

\n", - "default": null + "description": "

The hex value of this widget when it first renders. If None,\ndefaults to black.

\n", + "default": "black" }, { "name": "key", @@ -19305,14 +17682,14 @@ "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the input.

\n", + "description": "

An optional tooltip that gets displayed next to the color picker.

\n", "default": null }, { "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this number_input's value changes.

\n", + "description": "

An optional callback invoked when this color_picker's value\nchanges.

\n", "default": null }, { @@ -19333,192 +17710,138 @@ "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

An optional boolean, which disables the number input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", "default": "False" }, { "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", "default": "is" } ], "returns": [ { - "type_name": "int or float", + "type_name": "str", "is_generator": false, - "description": "

The current value of the numeric input widget. The return type\nwill match the data type of the value parameter.

\n", + "description": "

The selected color as a hex string.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/number_input.py#L67" + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/color_picker.py#L52" }, - "DeltaGenerator.plotly_chart": { - "name": "plotly_chart", - "signature": "element.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", theme=\"streamlit\", **kwargs)", - "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport numpy as np\nimport plotly.figure_factory as ff\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n        hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n
\n", - "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", + "streamlit.columns": { + "name": "columns", + "signature": "st.columns(spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put columns inside another column.

\n
\n", "args": [ { - "name": "figure_or_data", - "type_name": "plotly.graph_objs.Figure, plotly.graph_objs.Data,", - "is_optional": false, - "description": "

dict/list of plotly.graph_objs.Figure/Data

\n

See https://plot.ly/python/ for examples of graph descriptions.

\n", - "default": null - }, - { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", - "default": null - }, - { - "name": "sharing", - "type_name": "\"streamlit\", \"private\", \"secret\", or \"public\"", + "name": "spec", + "type_name": "int or list of numbers", "is_optional": false, - "description": "

Use "streamlit" to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", "default": null }, { - "name": "theme", - "type_name": "\"streamlit\" or None", + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", "is_optional": false, - "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", - "default": "behavior" - }, - { - "name": "**kwargs", - "type_name": null, - "is_optional": null, - "description": "

Any argument accepted by Plotly's plot() function.

\n", - "default": null + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" } ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/plotly_chart.py#L81" - }, - "DeltaGenerator.progress": { - "name": "progress", - "signature": "element.progress(value, text=None)", - "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport streamlit as st\nimport time\n\nprogress_text = "Operation in progress. Please wait."\nmy_bar = st.progress(0, text=progress_text)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1, text=progress_text)\n
\n
\n", - "description": "

Display a progress bar.

\n", - "args": [ - { - "name": "value", - "type_name": "int or float", - "is_optional": false, - "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", - "default": null - }, + "returns": [ { - "name": "text", - "type_name": "str or None", - "is_optional": false, - "description": "

A message to display above the progress bar. The text can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", - "default": null + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null } ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/layouts.py#L74" + }, + "streamlit.container": { + "name": "container", + "signature": "st.container()", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/progress.py#L66" + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/layouts.py#L29" }, - "DeltaGenerator.pydeck_chart": { - "name": "pydeck_chart", - "signature": "element.pydeck_chart(pydeck_obj=None, use_container_width=False)", - "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport pydeck as pdk\n\nchart_data = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=chart_data,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=chart_data,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", - "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "streamlit.dataframe": { + "name": "dataframe", + "signature": "st.dataframe(data=None, width=None, height=None, *, use_container_width=False)", + "examples": "
\n
\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\nst.dataframe(df, 200, 100)\n
\n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a dataframe as an interactive table.", "args": [ { - "name": "pydeck_obj", - "type_name": "pydeck.Deck or None", + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, snowflake.snowpark.dataframe.DataFrame, Iterable, dict, or None", "is_optional": false, - "description": "

Object specifying the PyDeck chart to draw.

\n", + "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. (It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.)\nStyler support is experimental!\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", "default": null }, { - "name": "use_container_width", - "type_name": "bool", - "is_optional": false, - "description": "", - "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/deck_gl_json_chart.py#L37" - }, - "DeltaGenerator.pyplot": { - "name": "pyplot", - "signature": "element.pyplot(fig=None, clear_figure=None, use_container_width=True, **kwargs)", - "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", - "example": "
\n
\nimport streamlit as st\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n
\n", - "description": "

Display a matplotlib.pyplot figure.

\n", - "args": [ - { - "name": "fig", - "type_name": "Matplotlib Figure", + "name": "width", + "type_name": "int or None", "is_optional": false, - "description": "

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

\n", + "description": "

Desired width of the dataframe expressed in pixels. If None, the width\nwill be automatically calculated based on the column content.

\n", "default": null }, { - "name": "clear_figure", - "type_name": "bool", + "name": "height", + "type_name": "int or None", "is_optional": false, - "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", - "default": "based" + "description": "

Desired height of the dataframe expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" }, { "name": "use_container_width", "type_name": "bool", "is_optional": false, - "description": "

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

\n", - "default": "s" - }, - { - "name": "**kwargs", - "type_name": "any", - "is_optional": false, - "description": "

Arguments to pass to Matplotlib's savefig function.

\n", + "description": "

If True, set the dataframe width to the width of the parent container.\nThis takes precedence over the width argument.\nThis argument can only be supplied by keyword.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/pyplot.py#L38" + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/dataframe_selector.py#L37" }, - "DeltaGenerator.radio": { - "name": "radio", - "signature": "element.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, captions=None, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\ngenre = st.radio(\n    "What's your favorite movie genre",\n    [":rainbow[Comedy]", "***Drama***", "Documentary :movie_camera:"],\n    captions = ["Laugh out loud.", "Get the popcorn.", "Never stop learning."])\n\nif genre == ':rainbow[Comedy]':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn\\'t select comedy.")\n
\n\n \n
\n", - "description": "

Display a radio button widget.

\n", + "streamlit.date_input": { + "name": "date_input", + "signature": "st.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nd = st.date_input(\n    "When's your birthday",\n    datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a date input widget.", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this radio group is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this date input is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { - "name": "options", - "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "name": "value", + "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", "is_optional": false, - "description": "

Labels for the radio options. Labels can include markdown as\ndescribed in the label parameter and will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", - "default": null + "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", + "default": "today" }, { - "name": "index", - "type_name": "int", + "name": "min_value", + "type_name": "datetime.date or datetime.datetime", "is_optional": false, - "description": "

The index of the preselected option on first render.

\n", - "default": null + "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", + "default": "value" }, { - "name": "format_func", - "type_name": "function", + "name": "max_value", + "type_name": "datetime.date or datetime.datetime", "is_optional": false, - "description": "

Function to modify the display of radio options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe radio.

\n", - "default": null + "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", + "default": "value" }, { "name": "key", @@ -19531,14 +17854,14 @@ "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the radio.

\n", + "description": "

An optional tooltip that gets displayed next to the input.

\n", "default": null }, { "name": "on_change", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this radio's value changes.

\n", + "description": "

An optional callback invoked when this date_input's value changes.

\n", "default": null }, { @@ -19559,74 +17882,60 @@ "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

An optional boolean, which disables the radio button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", "default": "False" }, - { - "name": "horizontal", - "type_name": "bool", - "is_optional": false, - "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", - "default": "false" - }, - { - "name": "captions", - "type_name": "iterable of str or None", - "is_optional": false, - "description": "

A list of captions to show below each radio button. If None (default),\nno captions are shown.

\n", - "default": null - }, { "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", "default": "is" } ], "returns": [ { - "type_name": "any", + "type_name": "datetime.date or a tuple with 0-2 dates", "is_generator": false, - "description": "

The selected option.

\n", + "description": "

The current value of the date input widget.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/radio.py#L76" + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/time_widgets.py#L356" }, - "DeltaGenerator.select_slider": { - "name": "select_slider", - "signature": "element.select_slider(label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "examples": "
\nimport streamlit as st\n\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nimport streamlit as st\n\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n ", - "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", + "streamlit.download_button": { + "name": "download_button", + "signature": "st.download_button(label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False)", + "examples": "
\n

Download a large DataFrame as a CSV:

\n
\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this button is for.

\n", "default": null }, { - "name": "options", - "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "name": "data", + "type_name": "str or bytes or file", "is_optional": false, - "description": "

Labels for the slider options. All options will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", + "description": "

The contents of the file to be downloaded. See example below for\ncaching techniques to avoid recomputing this data unnecessarily.

\n", "default": null }, { - "name": "value", - "type_name": "a supported type or a tuple/list of supported types or None", + "name": "file_name", + "type_name": "str", "is_optional": false, - "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to first option.

\n", - "default": "first" + "description": "

An optional string to use as the name of the file to be downloaded,\nsuch as 'my_file.csv'. If not specified, the name will be\nautomatically generated.

\n", + "default": null }, { - "name": "format_func", - "type_name": "function", + "name": "mime", + "type_name": "str or None", "is_optional": false, - "description": "

Function to modify the display of the labels from the options.\nargument. It receives the option as an argument and its output\nwill be cast to str.

\n", - "default": null + "description": "

The MIME type of the data. If None, defaults to "text/plain"\n(if data is of type str or is a textual file) or\n"application/octet-stream" (if data is of type bytes or is a\nbinary file).

\n", + "default": "s" }, { "name": "key", @@ -19639,14 +17948,14 @@ "name": "help", "type_name": "str", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the select slider.

\n", + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", "default": null }, { - "name": "on_change", + "name": "on_click", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this select_slider's value changes.

\n", + "description": "

An optional callback invoked when this button is clicked.

\n", "default": null }, { @@ -19667,968 +17976,76736 @@ "name": "disabled", "type_name": "bool", "is_optional": false, - "description": "

An optional boolean, which disables the select slider if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", "default": "False" - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" } ], "returns": [ { - "type_name": "any value or tuple of any value", + "type_name": "bool", "is_generator": false, - "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/select_slider.py#L107" + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/button.py#L143" }, - "DeltaGenerator.selectbox": { - "name": "selectbox", - "signature": "element.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=\"Select...\", disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n
\n", - "description": "

Display a select widget.

\n", + "streamlit.echo": { + "name": "echo", + "signature": "st.echo(code_location=\"above\")", + "example": "
\n
\nwith st.echo():\n    st.write('This code will be printed')\n
\n
\n", + "description": "Use in a `with` block to draw some code on the app, then execute it.", + "args": [ + { + "name": "code_location", + "type_name": "\"above\" or \"below\"", + "is_optional": false, + "description": "

Whether to show the echoed code before or after the results of the\nexecuted code block.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/echo.py#L27" + }, + "streamlit.empty": { + "name": "empty", + "signature": "st.empty()", + "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", + "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/empty.py#L24" + }, + "streamlit.error": { + "name": "error", + "signature": "st.error(body, *, icon=None)", + "example": "
\n
\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", + "description": "Display error message.", + "args": [ + { + "name": "icon", + "type_name": "None", + "is_optional": false, + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" + }, + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The error text to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/alert.py#L39" + }, + "streamlit.exception": { + "name": "exception", + "signature": "st.exception(exception)", + "example": "
\n
\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", + "description": "Display an exception.", + "args": [ + { + "name": "exception", + "type_name": "Exception", + "is_optional": false, + "description": "

The exception to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/exception.py#L50" + }, + "streamlit.expander": { + "name": "expander", + "signature": "st.expander(label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write("""\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    """)\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write("""\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n""")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A string to use as the header for the expander.

\n", "default": null }, { - "name": "options", - "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "name": "expanded", + "type_name": "bool", "is_optional": false, - "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/layouts.py#L287" + }, + "streamlit.experimental_get_query_params": { + "name": "experimental_get_query_params", + "signature": "st.experimental_get_query_params()", + "example": "
\n

Let's say the user's web browser is at\nhttp://localhost:8501/?show_map=True&selected=asia&selected=america.\nThen, you can get the query parameters using the following:

\n
\nst.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\n

Note that the values in the returned dict are always lists. This is\nbecause we internally use Python's urllib.parse.parse_qs(), which behaves\nthis way. And this behavior makes sense when you consider that every item\nin a query string is potentially a 1-element array.

\n
\n", + "description": "Return the query parameters that is currently showing in the browser's URL bar.", + "args": [], + "returns": [ + { + "type_name": "dict", + "is_generator": false, + "description": "

The current query parameters as a dict. "Query parameters" are the part of the URL that comes\nafter the first "?".

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/commands/query_params.py#L23" + }, + "streamlit.experimental_memo": { + "name": "experimental_memo", + "signature": "st.experimental_memo(func=None, *, persist=None, show_spinner=True, suppress_st_warning=False, max_entries=None, ttl=None)", + "example": "
\n
\n@st.experimental_memo\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\n@st.experimental_memo(persist="disk")\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

By default, all parameters to a memoized function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\n@st.experimental_memo\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nconnection = make_database_connection()\nd1 = fetch_and_clean_data(connection, num_rows=10)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nanother_connection = make_database_connection()\nd2 = fetch_and_clean_data(another_connection, num_rows=10)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _database_connection parameter was different\n# in both calls.\n
\n

A memoized function's cache can be procedurally cleared:

\n
\n@st.experimental_memo\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nfetch_and_clean_data.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Function decorator to memoize function executions.

\n

Memoized data is stored in "pickled" form, which means that the return\nvalue of a memoized function must be pickleable.

\n

Each caller of a memoized function gets its own copy of the cached data.

\n

You can clear a memoized function's cache with f.clear().

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to memoize. Streamlit hashes the function's source code.

\n", "default": null }, { - "name": "index", - "type_name": "int", + "name": "persist", + "type_name": "str or None", "is_optional": false, - "description": "

The index of the preselected option on first render.

\n", + "description": "

Optional location to persist cached data to. Currently, the only\nvalid value is "disk", which will persist to the local disk.

\n", "default": null }, { - "name": "format_func", - "type_name": "function", + "name": "show_spinner", + "type_name": "boolean", "is_optional": false, - "description": "

Function to modify the display of the labels. It receives the option\nas an argument and its output will be cast to str.

\n", - "default": null + "description": "

Enable the spinner. Default is True to show a spinner when there is\na cache miss.

\n", + "default": "True" }, { - "name": "key", - "type_name": "str or int", + "name": "suppress_st_warning", + "type_name": "boolean", "is_optional": false, - "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "description": "

Suppress warnings about calling Streamlit functions from within\nthe cached function.

\n", "default": null }, { - "name": "help", - "type_name": "str", + "name": "max_entries", + "type_name": "int or None", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the selectbox.

\n", - "default": null + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None" }, { - "name": "on_change", + "name": "ttl", + "type_name": "float or timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.\nNote that ttl is incompatible with persist="disk" - ttl will be\nignored if persist is specified.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/runtime/caching/memo_decorator.py#L225" + }, + "streamlit.experimental_rerun": { + "name": "experimental_rerun", + "signature": "st.experimental_rerun()", + "description": "

Rerun the script immediately.

\n

When st.experimental_rerun() is called, the script is halted - no\nmore statements will be run, and the script will be queued to re-run\nfrom the top.

\n

If this function is called outside of Streamlit, it will raise an\nException.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/commands/execution_control.py#L45" + }, + "streamlit.experimental_set_query_params": { + "name": "experimental_set_query_params", + "signature": "st.experimental_set_query_params(**query_params)", + "example": "
\n

To point the user's web browser to something like\n"http://localhost:8501/?show_map=True&selected=asia&selected=america",\nyou would do the following:

\n
\nst.experimental_set_query_params(\n    show_map=True,\n    selected=["asia", "america"],\n)\n
\n
\n", + "description": "Set the query parameters that are shown in the browser's URL bar.", + "args": [ + { + "name": "**query_params", + "type_name": "dict", + "is_optional": false, + "description": "

The query parameters to set, as key-value pairs.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/commands/query_params.py#L54" + }, + "streamlit.experimental_show": { + "name": "experimental_show", + "signature": "st.experimental_show(*args)", + "notes": "
\n

This is an experimental feature with usage limitations:

\n
    \n
  • The method must be called with the name show.
  • \n
  • Must be called in one line of code, and only once per line.
  • \n
  • \n
    When passing multiple arguments the inclusion of , or ) in a string
    \n
    argument may cause an error.
    \n
    \n
  • \n
\n
\n", + "example": "
\n
\ndataframe = pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n})\nst.experimental_show(dataframe)\n
\n
\n", + "description": "

Write arguments and argument names to your app for debugging purposes.

\n

Show() has similar properties to write():

\n
\n
    \n
  1. You can pass in multiple arguments, all of which will be debugged.
  2. \n
  3. It returns None, so it's "slot" in the app cannot be reused.
  4. \n
\n
\n

Note: This is an experimental feature. See\nhttps://docs.streamlit.io/library/advanced-features/prerelease#experimental for more information.

\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to debug in the App.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/show.py#L23" + }, + "streamlit.experimental_singleton": { + "name": "experimental_singleton", + "signature": "st.experimental_singleton(func=None, *, show_spinner=True, suppress_st_warning=False)", + "example": "
\n
\n@st.experimental_singleton\ndef get_database_session(url):\n    # Create a database session object that points to the URL.\n    return session\n\ns1 = get_database_session(SESSION_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(SESSION_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the connection object in s1 is the same as in s2.\n\ns3 = get_database_session(SESSION_URL_2)\n# This is a different URL, so the function executes.\n
\n

By default, all parameters to a singleton function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\n@st.experimental_singleton\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\ns1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _sessionmaker parameter was different\n# in both calls.\n
\n

A singleton function's cache can be procedurally cleared:

\n
\n@st.experimental_singleton\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\nget_database_session.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Function decorator to store singleton objects.

\n

Each singleton object is shared across all users connected to the app.\nSingleton objects must be thread-safe, because they can be accessed from\nmultiple threads concurrently.

\n

(If thread-safety is an issue, consider using st.session_state to\nstore per-session singleton objects instead.)

\n

You can clear a memoized function's cache with f.clear().

\n", + "args": [ + { + "name": "func", "type_name": "callable", "is_optional": false, - "description": "

An optional callback invoked when this selectbox's value changes.

\n", + "description": "

The function that creates the singleton. Streamlit hashes the\nfunction's source code.

\n", + "default": null + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the singleton is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "suppress_st_warning", + "type_name": "boolean", + "is_optional": false, + "description": "

Suppress warnings about calling Streamlit functions from within\nthe singleton function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/runtime/caching/singleton_decorator.py#L151" + }, + "streamlit.file_uploader": { + "name": "file_uploader", + "signature": "st.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this file uploader is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str or list of str or None", + "is_optional": false, + "description": "

Array of allowed extensions. ['png', 'jpg']\nThe default is None, which means all extensions are allowed.

\n", + "default": "None" + }, + { + "name": "accept_multiple_files", + "type_name": "bool", + "is_optional": false, + "description": "

If True, allows the user to upload multiple files at the same time,\nin which case the return value will be a list of files.\nDefault: False

\n", + "default": "False" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the file uploader.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this file_uploader's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the file uploader if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile or list of UploadedFile", + "is_generator": false, + "description": "
    \n
  • If accept_multiple_files is False, returns either None or\nan UploadedFile object.
  • \n
  • If accept_multiple_files is True, returns a list with the\nuploaded files as UploadedFile objects. If no files were\nuploaded, returns an empty list.
  • \n
\n

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/file_uploader.py#L205" + }, + "streamlit.form": { + "name": "form", + "signature": "st.form(key, clear_on_submit=False)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n

Inserting elements out of order:

\n
\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n
\n", + "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

A string that identifies the form. Each form must have its own\nkey. (This key is not displayed to the user in the interface.)

\n", + "default": null + }, + { + "name": "clear_on_submit", + "type_name": "bool", + "is_optional": false, + "description": "

If True, all widgets inside the form will be reset to their default\nvalues after the user presses the Submit button. Defaults to False.\n(Note that Custom Components are unaffected by this flag, and\nwill not be reset to their defaults on form submission.)

\n", + "default": "values" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/form.py#L116" + }, + "streamlit.form_submit_button": { + "name": "form_submit_button", + "signature": "st.form_submit_button(label=\"Submit\", help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False)", + "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nDefaults to "Submit".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

A tooltip that gets displayed when the button is hovered over.\nDefaults to None.

\n", + "default": "None" + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/form.py#L205" + }, + "streamlit.get_option": { + "name": "get_option", + "signature": "st.get_option(key)", + "description": "

Return the current value of a given Streamlit config option.

\n

Run streamlit config show in the terminal to see all available options.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

The config option key of the form "section.optionName". To see all\navailable options, run streamlit config show on a terminal.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/config.py#L129" + }, + "streamlit.graphviz_chart": { + "name": "graphviz_chart", + "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nimport graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a graph using the dagre-d3 library.", + "args": [ + { + "name": "figure_or_dot", + "type_name": "graphviz.dot.Graph, graphviz.dot.Digraph, str", + "is_optional": false, + "description": "

The Graphlib graph object or dot string to display

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/graphviz_chart.py#L39" + }, + "streamlit.header": { + "name": "header", + "signature": "st.header(body, anchor=None)", + "example": "
\n
\nst.header('This is a header')\n
\n
\n", + "description": "Display text in header formatting.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display.

\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/heading.py#L27" + }, + "streamlit.help": { + "name": "help", + "signature": "st.help(obj)", + "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nst.help(pandas.DataFrame)\n
\n

Want to quickly check what datatype is output by a certain function?\nTry:

\n
\nx = my_poorly_documented_function()\nst.help(x)\n
\n
\n", + "description": "

Display object's doc string, nicely formatted.

\n

Displays the doc string for this object.

\n", + "args": [ + { + "name": "obj", + "type_name": "Object", + "is_optional": false, + "description": "

The object whose docstring should be displayed.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/doc_string.py#L44" + }, + "streamlit.image": { + "name": "image", + "signature": "st.image(image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", + "example": "
\n
\nfrom PIL import Image\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an image or list of images.", + "args": [ + { + "name": "image", + "type_name": "numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]", + "is_optional": false, + "description": "

Monochrome image of shape (w,h) or (w,h,1)\nOR a color image of shape (w,h,3)\nOR an RGBA image of shape (w,h,4)\nOR a URL to fetch the image from\nOR a path of a local image file\nOR an SVG XML string like <svg xmlns=...</svg>\nOR a list of one of the above, to display multiple images.

\n", + "default": null + }, + { + "name": "caption", + "type_name": "str or list of str", + "is_optional": false, + "description": "

Image caption. If displaying multiple images, caption should be a\nlist of captions (one for each image).

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Image width. None means use the image width,\nbut do not exceed the width of the column.\nShould be set for SVG images, as they have no default image width.

\n", + "default": "image" + }, + { + "name": "use_column_width", + "type_name": "'auto' or 'always' or 'never' or bool", + "is_optional": false, + "description": "

If 'auto', set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf 'always' or True, set the image's width to the column width.\nIf 'never' or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", + "default": null + }, + { + "name": "clamp", + "type_name": "bool", + "is_optional": false, + "description": "

Clamp image pixel values to a valid range ([0-255] per channel).\nThis is only meaningful for byte array images; the parameter is\nignored for image URLs. If this is not set, and an image has an\nout-of-range value, an error will be thrown.

\n", + "default": null + }, + { + "name": "channels", + "type_name": "'RGB' or 'BGR'", + "is_optional": false, + "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to 'RGB', meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to 'BGR', instead.

\n", + "default": "s" + }, + { + "name": "output_format", + "type_name": "'JPEG', 'PNG', or 'auto'", + "is_optional": false, + "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to 'auto' which identifies the compression type based\non the type and format of the image argument.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/image.py#L66" + }, + "streamlit.info": { + "name": "info", + "signature": "st.info(body, *, icon=None)", + "example": "
\n
\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", + "description": "Display an informational message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The info text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "None", + "is_optional": false, + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/alert.py#L97" + }, + "streamlit.json": { + "name": "json", + "signature": "st.json(body, *, expanded=True)", + "example": "
\n
\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display object or string as a pretty-printed JSON string.", + "args": [ + { + "name": "body", + "type_name": "object or str", + "is_optional": false, + "description": "

The object to print as JSON. All referenced objects should be\nserializable to JSON as well. If object is a string, we assume it\ncontains serialized JSON.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean that allows the user to set whether the initial\nstate of this json element should be expanded. Defaults to True.\nThis argument can only be supplied by keyword.

\n", + "default": "True" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/json.py#L35" + }, + "streamlit.latex": { + "name": "latex", + "signature": "st.latex(body)", + "example": "
\n
\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", + "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", + "args": [ + { + "name": "body", + "type_name": "str or SymPy expression", + "is_optional": false, + "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/markdown.py#L143" + }, + "streamlit.line_chart": { + "name": "line_chart", + "signature": "st.line_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\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 \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, snowflake.snowpark.dataframe.DataFrame, Iterable, dict or None", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/dataframe_selector.py#L145" + }, + "streamlit.map": { + "name": "map", + "signature": "st.map(data=None, zoom=None, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a map with points on it.

\n

This is a wrapper around st.pydeck_chart to quickly create scatterplot\ncharts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more\ninfo on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,", + "is_optional": false, + "description": "

or None\nThe data to be plotted. Must have columns called 'lat', 'lon',\n'latitude', or 'longitude'.

\n", + "default": null + }, + { + "name": "zoom", + "type_name": "int", + "is_optional": false, + "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/map.py#L75" + }, + "streamlit.markdown": { + "name": "markdown", + "signature": "st.markdown(body, unsafe_allow_html=False)", + "example": "
\n
\nst.markdown('Streamlit is **_really_ cool**.')\n
\n
\n", + "description": "Display string formatted as Markdown.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/markdown.py#L29" + }, + "streamlit.metric": { + "name": "metric", + "signature": "st.metric(label, value, delta=None, delta_color=\"normal\", help=None)", + "example": "
\n
\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n \n (view standalone Streamlit app)\n \n

st.metric looks especially nice in combination with st.columns:

\n
\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n \n (view standalone Streamlit app)\n \n

The delta indicator color can also be inverted or turned off:

\n
\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

The header or Title for the metric

\n", + "default": null + }, + { + "name": "value", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Value of the metric. None is rendered as a long dash.

\n", + "default": null + }, + { + "name": "delta", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Indicator of how the metric changed, rendered with an arrow below\nthe metric. If delta is negative (int/float) or starts with a minus\nsign (str), the arrow points down and the text is red; else the\narrow points up and the text is green. If None (default), no delta\nindicator is shown.

\n", + "default": null + }, + { + "name": "delta_color", + "type_name": "str", + "is_optional": false, + "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the metric label.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/metric.py#L44" + }, + "streamlit.multiselect": { + "name": "multiselect", + "signature": "st.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", max_selections=None)", + "example": "
\n
\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence[V], numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null + }, + { + "name": "default", + "type_name": "[V], V, or None", + "is_optional": false, + "description": "

List of default values. Can also be a single value.

\n", + "default": "values" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of selectbox options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe multiselect.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the multiselect.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this multiselect's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the multiselect widget if set\nto True. The default is False. This argument can only be supplied\nby keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "max_selections", + "type_name": "int", + "is_optional": false, + "description": "

The max selections that can be selected at a time.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list", + "is_generator": false, + "description": "

A list with the selected options

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/multiselect.py#L145" + }, + "streamlit.number_input": { + "name": "number_input", + "signature": "st.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a numeric input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. Output must be purely numeric. This does not impact\nthe return value. Valid formatters: %d %e %f %g %i %u

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this number_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the number input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int or float", + "is_generator": false, + "description": "

The current value of the numeric input widget. The return type\nwill match the data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/number_input.py#L66" + }, + "streamlit.plotly_chart": { + "name": "plotly_chart", + "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)", + "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport plotly.figure_factory as ff\nimport numpy as np\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n        hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", + "args": [ + { + "name": "figure_or_data", + "type_name": "plotly.graph_objs.Figure, plotly.graph_objs.Data,", + "is_optional": false, + "description": "

dict/list of plotly.graph_objs.Figure/Data

\n

See https://plot.ly/python/ for examples of graph descriptions.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + }, + { + "name": "sharing", + "type_name": "{'streamlit', 'private', 'secret', 'public'}", + "is_optional": false, + "description": "

Use 'streamlit' to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", + "default": null + }, + { + "name": "**kwargs", + "type_name": null, + "is_optional": null, + "description": "

Any argument accepted by Plotly's plot() function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/plotly_chart.py#L69" + }, + "streamlit.progress": { + "name": "progress", + "signature": "st.progress(value)", + "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport time\n\nmy_bar = st.progress(0)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1)\n
\n
\n", + "description": "Display a progress bar.", + "args": [ + { + "name": "value", + "type_name": "int or float", + "is_optional": false, + "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/progress.py#L32" + }, + "streamlit.pydeck_chart": { + "name": "pydeck_chart", + "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)", + "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\ndf = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=df,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=df,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", + "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "pydeck_obj", + "type_name": "pydeck.Deck or None", + "is_optional": false, + "description": "

Object specifying the PyDeck chart to draw.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/deck_gl_json_chart.py#L36" + }, + "streamlit.pyplot": { + "name": "pyplot", + "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)", + "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", + "example": "
\n
\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a matplotlib.pyplot figure.", + "args": [ + { + "name": "fig", + "type_name": "Matplotlib Figure", + "is_optional": false, + "description": "

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

\n", + "default": null + }, + { + "name": "clear_figure", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", + "default": "based" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Arguments to pass to Matplotlib's savefig function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/pyplot.py#L38" + }, + "streamlit.radio": { + "name": "radio", + "signature": "st.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, label_visibility=\"visible\")", + "example": "
\n
\ngenre = st.radio(\n    "What's your favorite movie genre",\n    ('Comedy', 'Drama', 'Documentary'))\n\nif genre == 'Comedy':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn't select comedy.")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a radio button widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this radio group is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the radio options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of radio options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe radio.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the radio.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this radio's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the radio button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "horizontal", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", + "default": "false" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/radio.py#L75" + }, + "streamlit.select_slider": { + "name": "select_slider", + "signature": "st.select_slider(label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n \n (view standalone Streamlit app)\n \n ", + "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the slider options. All options will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", + "default": null + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to first option.

\n", + "default": "first" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels from the options.\nargument. It receives the option as an argument and its output\nwill be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the select slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this select_slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the select slider if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any value or tuple of any value", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/select_slider.py#L106" + }, + "streamlit.selectbox": { + "name": "selectbox", + "signature": "st.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a select widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels. It receives the option\nas an argument and its output will be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the selectbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this selectbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the selectbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/selectbox.py#L71" + }, + "streamlit.set_option": { + "name": "set_option", + "signature": "st.set_option(key, value)", + "description": "

Set config option.

\n
\n
Currently, only the following config options can be set within the script itself:
\n
    \n
  • client.caching
  • \n
  • client.displayEnabled
  • \n
  • deprecation.*
  • \n
\n
\n
\n

Calling with any other options will raise StreamlitAPIException.

\n

Run streamlit config show in the terminal to see all available options.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

The config option key of the form "section.optionName". To see all\navailable options, run streamlit config show on a terminal.

\n", + "default": null + }, + { + "name": "value", + "type_name": null, + "is_optional": null, + "description": "

The new value to assign to this config option.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/config.py#L90" + }, + "streamlit.set_page_config": { + "name": "set_page_config", + "signature": "st.set_page_config(page_title=None, page_icon=None, layout=\"centered\", initial_sidebar_state=\"auto\", menu_items=None)", + "example": "
\nst.set_page_config(\n    page_title="Ex-stream-ly Cool App",\n    page_icon="\ud83e\uddca",\n    layout="wide",\n    initial_sidebar_state="expanded",\n    menu_items={\n        'Get Help': 'https://www.extremelycoolapp.com/help',\n        'Report a bug': "https://www.extremelycoolapp.com/bug",\n        'About': "# This is a header. This is an *extremely* cool app!"\n    }\n)\n
\n", + "description": "

Configures the default settings of the page.

\n
\n

Note

\n

This must be the first Streamlit command used in your app, and must only\nbe set once.

\n
\n", + "args": [ + { + "name": "page_title", + "type_name": "str or None", + "is_optional": false, + "description": "

The page title, shown in the browser tab. If None, defaults to the\nfilename of the script ("app.py" would show "app \u2022 Streamlit").

\n", + "default": "the" + }, + { + "name": "page_icon", + "type_name": "Anything supported by st.image or str or None", + "is_optional": false, + "description": "

The page favicon.\nBesides the types supported by st.image (like URLs or numpy arrays),\nyou can pass in an emoji as a string ("\ud83e\udd88") or a shortcode (":shark:").\nIf you're feeling lucky, try "random" for a random emoji!\nEmoji icons are courtesy of Twemoji and loaded from MaxCDN.

\n", + "default": null + }, + { + "name": "layout", + "type_name": "\"centered\" or \"wide\"", + "is_optional": false, + "description": "

How the page content should be laid out. Defaults to "centered",\nwhich constrains the elements into a centered column of fixed width;\n"wide" uses the entire screen.

\n", + "default": "s" + }, + { + "name": "initial_sidebar_state", + "type_name": "\"auto\" or \"expanded\" or \"collapsed\"", + "is_optional": false, + "description": "

How the sidebar should start out. Defaults to "auto",\nwhich hides the sidebar on mobile-sized devices, and shows it otherwise.\n"expanded" shows the sidebar initially; "collapsed" hides it.

\n", + "default": "s" + }, + { + "name": "menu_items", + "type_name": "dict", + "is_optional": false, + "description": "

Configure the menu that appears on the top-right side of this app.\nThe keys in this dict denote the menu item you'd like to configure:

\n
    \n
  • \n
    "Get help": str or None
    \n
    The URL this menu item should point to.\nIf None, hides this menu item.
    \n
    \n
  • \n
  • \n
    "Report a Bug": str or None
    \n
    The URL this menu item should point to.\nIf None, hides this menu item.
    \n
    \n
  • \n
  • \n
    "About": str or None
    \n
    A markdown string to show in the About dialog.\nIf None, only shows Streamlit's default About text.
    \n
    \n
  • \n
\n

The URL may also refer to an email address e.g. mailto:john@example.com.

\n", + "default": "About" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/commands/page_config.py#L114" + }, + "streamlit.slider": { + "name": "slider", + "signature": "st.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nfrom datetime import time\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nfrom datetime import datetime\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The minimum permitted value.\nDefaults to 0 if the value is an int, 0.0 if a float,\nvalue - timedelta(days=14) if a date/datetime, time.min if a time

\n", + "default": "0" + }, + { + "name": "max_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The maximum permitted value.\nDefaults to 100 if the value is an int, 1.0 if a float,\nvalue + timedelta(days=14) if a date/datetime, time.max if a time

\n", + "default": "100" + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to min_value.

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int/float/timedelta or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. This does not impact the return value.\nFormatter for int/float supports: %d %e %f %g %i\nFormatter for date/time/datetime uses Moment.js notation:\nhttps://momentjs.com/docs/#/displaying/format/

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the slider if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int/float/date/time/datetime or tuple of int/float/date/time/datetime", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/slider.py#L171" + }, + "streamlit.snow": { + "name": "snow", + "signature": "st.snow()", + "example": "
\n
\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", + "description": "Draw celebratory snowfall.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/snow.py#L25" + }, + "streamlit.spinner": { + "name": "spinner", + "signature": "st.spinner(text=\"In progress...\")", + "example": "
\n
\nwith st.spinner('Wait for it...'):\n    time.sleep(5)\nst.success('Done!')\n
\n
\n", + "description": "Temporarily displays a message while executing a block of code.", + "args": [ + { + "name": "text", + "type_name": "str", + "is_optional": false, + "description": "

A message to display while executing that block

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/spinner.py#L23" + }, + "streamlit.stop": { + "name": "stop", + "signature": "st.stop()", + "example": "
\n
\nname = st.text_input('Name')\nif not name:\n  st.warning('Please input a name.')\n  st.stop()\nst.success('Thank you for inputting a name.')\n
\n
\n", + "description": "

Stops execution immediately.

\n

Streamlit will not run any statements after st.stop().\nWe recommend rendering a message to explain why the script has stopped.\nWhen run outside of Streamlit, this will raise an Exception.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/commands/execution_control.py#L25" + }, + "streamlit.subheader": { + "name": "subheader", + "signature": "st.subheader(body, anchor=None)", + "example": "
\n
\nst.subheader('This is a subheader')\n
\n
\n", + "description": "Display text in subheader formatting.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display.

\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/heading.py#L54" + }, + "streamlit.success": { + "name": "success", + "signature": "st.success(body, *, icon=None)", + "example": "
\n
\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", + "description": "Display a success message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The success text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "None", + "is_optional": false, + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/alert.py#L127" + }, + "streamlit.table": { + "name": "table", + "signature": "st.table(data=None)", + "example": "
\n
\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, snowflake.snowpark.dataframe.DataFrame, Iterable, dict, or None", + "is_optional": false, + "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/dataframe_selector.py#L111" + }, + "streamlit.tabs": { + "name": "tabs", + "signature": "st.tabs(tabs)", + "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", + "args": [ + { + "name": "tabs", + "type_name": "list of strings", + "is_optional": false, + "description": "

Creates a tab for each string in the list. The string is used as the name of the tab.\nThe first tab is selected by default.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/layouts.py#L199" + }, + "streamlit.text": { + "name": "text", + "signature": "st.text(body)", + "example": "
\n
\nst.text('This is some text.')\n
\n
\n", + "description": "Write fixed-width and preformatted text.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/text.py#L27" + }, + "streamlit.text_area": { + "name": "text_area", + "signature": "st.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", + "description": "Display a multi-line text input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Maximum number of characters allowed in text area.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the textarea.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_area's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text area is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text area if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/text_widgets.py#L249" + }, + "streamlit.text_input": { + "name": "text_input", + "signature": "st.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a single-line text input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Max number of characters allowed in text input.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str", + "is_optional": false, + "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "autocomplete", + "type_name": "str", + "is_optional": false, + "description": "

An optional value that will be passed to the <input> element's\nautocomplete property. If unspecified, this value will be set to\n"new-password" for "password" inputs, and the empty string for\n"default" inputs. For more details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text input is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/text_widgets.py#L69" + }, + "streamlit.time_input": { + "name": "time_input", + "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a time input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this time input is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.time/datetime.datetime", + "is_optional": false, + "description": "

The value of this widget when it first renders. This will be\ncast to str internally. Defaults to the current time.

\n", + "default": "the" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this time_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the time input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.time", + "is_generator": false, + "description": "

The current value of the time input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/time_widgets.py#L212" + }, + "streamlit.title": { + "name": "title", + "signature": "st.title(body, anchor=None)", + "example": "
\n
\nst.title('This is a title')\n
\n
\n", + "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display.

\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/heading.py#L82" + }, + "streamlit.vega_lite_chart": { + "name": "vega_lite_chart", + "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, **kwargs)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(df, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", + "description": "Display a chart using the Vega-Lite library.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "spec", + "type_name": "dict or None", + "is_optional": false, + "description": "

The Vega-Lite spec for the chart. If the spec was already passed in\nthe previous argument, this must be set to None. See\nhttps://vega.github.io/vega-lite/docs/ for more info.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", + "default": null + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Same as spec, but as keywords.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/dataframe_selector.py#L442" + }, + "streamlit.video": { + "name": "video", + "signature": "st.video(data, format=\"video/mp4\", start_time=0)", + "example": "
\n
\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", + "description": "Display a video player.", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "default": null + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the video file. Defaults to 'video/mp4'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/media.py#L80" + }, + "streamlit.warning": { + "name": "warning", + "signature": "st.warning(body, *, icon=None)", + "example": "
\n
\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", + "description": "Display warning message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The warning text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "None", + "is_optional": false, + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/alert.py#L68" + }, + "streamlit.write": { + "name": "write", + "signature": "st.write(*args, unsafe_allow_html=False, **kwargs)", + "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nwrite('Hello, *World!* :sunglasses:')\n
\n\n \n \n (view standalone Streamlit app)\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n \n (view standalone Streamlit app)\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n \n (view standalone Streamlit app)\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression and emoji shortcodes.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": "False" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/write.py#L47" + }, + "streamlit.experimental_memo.clear": { + "name": "experimental_memo.clear", + "signature": "st.experimental_memo.clear()", + "description": "Clear all in-memory and on-disk memo caches.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/runtime/caching/memo_decorator.py#L378" + }, + "streamlit.experimental_singleton.clear": { + "name": "experimental_singleton.clear", + "signature": "st.experimental_singleton.clear()", + "description": "Clear all singleton caches.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/runtime/caching/singleton_decorator.py#L251" + }, + "streamlit.components.v1.declare_component": { + "name": "declare_component", + "signature": "st.components.v1.declare_component(name, path=None, url=None)", + "description": "Create and register a custom component.", + "args": [ + { + "name": "name", + "type_name": "str", + "is_optional": false, + "description": "

A short, descriptive name for the component. Like, "slider".

\n", + "default": null + }, + { + "name": "path", + "type_name": "str or None", + "is_optional": false, + "description": "

The path to serve the component's frontend files from. Either\npath or url must be specified, but not both.

\n", + "default": null + }, + { + "name": "url", + "type_name": "str or None", + "is_optional": false, + "description": "

The URL that the component is served from. Either path or url\nmust be specified, but not both.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "CustomComponent", + "is_generator": false, + "description": "

A CustomComponent that can be called like a function.\nCalling the component will create a new instance of the component\nin the Streamlit app.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/components/v1/components.py#L246" + }, + "streamlit.components.v1.html": { + "name": "html", + "signature": "st.components.v1.html(html, width=None, height=None, scrolling=False)", + "description": "Display an HTML string in an iframe.", + "args": [ + { + "name": "html", + "type_name": "str", + "is_optional": false, + "description": "

The HTML string to embed in the iframe.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", + "default": "the" + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", + "default": "150" + }, + { + "name": "scrolling", + "type_name": "bool", + "is_optional": false, + "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", + "default": "False" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/iframe.py#L59" + }, + "streamlit.components.v1.iframe": { + "name": "iframe", + "signature": "st.components.v1.iframe(src, width=None, height=None, scrolling=False)", + "description": "Load a remote URL in an iframe.", + "args": [ + { + "name": "src", + "type_name": "str", + "is_optional": false, + "description": "

The URL of the page to embed.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", + "default": "the" + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", + "default": "150" + }, + { + "name": "scrolling", + "type_name": "bool", + "is_optional": false, + "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", + "default": "False" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/iframe.py#L25" + }, + "DeltaGenerator.add_rows": { + "name": "add_rows", + "signature": "element.add_rows(self, data=None, **kwargs)", + "example": "
\n
\ndf1 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table = st.table(df1)\n\ndf2 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table.add_rows(df2)\n# Now the table shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

You can do the same thing with plots. For example, if you want to add\nmore data to a line chart:

\n
\n# Assuming df1 and df2 from the example above still exist...\nmy_chart = st.line_chart(df1)\nmy_chart.add_rows(df2)\n# Now the chart shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

And for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:

\n
\nmy_chart = st.vega_lite_chart({\n    'mark': 'line',\n    'encoding': {'x': 'a', 'y': 'b'},\n    'datasets': {\n      'some_fancy_name': df1,  # <-- named dataset\n     },\n    'data': {'name': 'some_fancy_name'},\n}),\nmy_chart.add_rows(some_fancy_name=df2)  # <-- name used as keyword\n
\n
\n", + "description": "Concatenate a dataframe to the bottom of the current one.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, snowflake.snowpark.dataframe.DataFrame, Iterable, dict, or None", + "is_optional": false, + "description": "

Table to concat. Optional.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "**kwargs", + "type_name": "pandas.DataFrame, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

The named dataset to concat. Optional. You can only pass in 1\ndataset (including the one in the data parameter).

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/dataframe_selector.py#L512" + }, + "DeltaGenerator.altair_chart": { + "name": "altair_chart", + "signature": "element.altair_chart(self, altair_chart, use_container_width=False)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a chart using the Altair library.", + "args": [ + { + "name": "altair_chart", + "type_name": "altair.vegalite.v2.api.Chart", + "is_optional": false, + "description": "

The Altair chart object to display.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/dataframe_selector.py#L395" + }, + "DeltaGenerator.area_chart": { + "name": "area_chart", + "signature": "element.area_chart(self, data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, snowflake.snowpark.dataframe.DataFrame, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/dataframe_selector.py#L228" + }, + "DeltaGenerator.audio": { + "name": "audio", + "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0)", + "example": "
\n
\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an audio player.", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw audio data, filename, or a URL pointing to the file to load.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "default": null + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/media.py#L41" + }, + "DeltaGenerator.balloons": { + "name": "balloons", + "signature": "element.balloons(self)", + "example": "
\n
\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", + "description": "Draw celebratory balloons.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/balloons.py#L25" + }, + "DeltaGenerator.bar_chart": { + "name": "bar_chart", + "signature": "element.bar_chart(self, data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nchart_data = pd.DataFrame(\n    np.random.randn(50, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, snowflake.snowpark.dataframe.DataFrame, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/dataframe_selector.py#L311" + }, + "DeltaGenerator.beta_columns": { + "name": "beta_columns", + "signature": "element.beta_columns(*args, **kwargs)", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put columns inside another column.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/beta_util.py#L43" + }, + "DeltaGenerator.beta_container": { + "name": "beta_container", + "signature": "element.beta_container(*args, **kwargs)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/beta_util.py#L43" + }, + "DeltaGenerator.beta_expander": { + "name": "beta_expander", + "signature": "element.beta_expander(*args, **kwargs)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write("""\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    """)\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write("""\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n""")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/beta_util.py#L43" + }, + "DeltaGenerator.bokeh_chart": { + "name": "bokeh_chart", + "signature": "element.bokeh_chart(self, figure, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", + "args": [ + { + "name": "figure", + "type_name": "bokeh.plotting.figure.Figure", + "is_optional": false, + "description": "

A Bokeh figure to plot.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Bokeh's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/bokeh_chart.py#L36" + }, + "DeltaGenerator.button": { + "name": "button", + "signature": "element.button(self, label, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False)", + "example": "
\n
\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a button widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/button.py#L61" + }, + "DeltaGenerator.camera_input": { + "name": "camera_input", + "signature": "element.camera_input(self, label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", + "description": "Display a widget that returns pictures from the user's webcam.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this widget is used for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the camera input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this camera_input's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile", + "is_generator": false, + "description": "

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/camera_input.py#L109" + }, + "DeltaGenerator.caption": { + "name": "caption", + "signature": "element.caption(self, body, unsafe_allow_html=False)", + "example": "
\n
\nst.caption('This is a string that explains something above.')\n
\n
\n", + "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display.

\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/markdown.py#L107" + }, + "DeltaGenerator.checkbox": { + "name": "checkbox", + "signature": "element.checkbox(self, label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a checkbox widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this checkbox is for.

\n", + "default": null + }, + { + "name": "value", + "type_name": "bool", + "is_optional": false, + "description": "

Preselect the checkbox when it first renders. This will be\ncast to bool internally.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the checkbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this checkbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

Whether or not the checkbox is checked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/checkbox.py#L48" + }, + "DeltaGenerator.code": { + "name": "code", + "signature": "element.code(self, body, language=\"python\")", + "example": "
\n
\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", + "description": "

Display a code block with optional syntax highlighting.

\n

(This is a convenience wrapper around st.markdown())

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as code.

\n", + "default": null + }, + { + "name": "language", + "type_name": "str or None", + "is_optional": false, + "description": "

The language that the code is written in, for syntax highlighting.\nIf None, the code will be unstyled. Defaults to "python".

\n

For a list of available language values, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/markdown.py#L74" + }, + "DeltaGenerator.color_picker": { + "name": "color_picker", + "signature": "element.color_picker(self, label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a color picker widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "str", + "is_optional": false, + "description": "

The hex value of this widget when it first renders. If None,\ndefaults to black.

\n", + "default": "black" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the color picker.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this color_picker's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The selected color as a hex string.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/color_picker.py#L52" + }, + "DeltaGenerator.columns": { + "name": "columns", + "signature": "element.columns(self, spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put columns inside another column.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/layouts.py#L74" + }, + "DeltaGenerator.container": { + "name": "container", + "signature": "element.container(self)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/layouts.py#L29" + }, + "DeltaGenerator.dataframe": { + "name": "dataframe", + "signature": "element.dataframe(self, data=None, width=None, height=None, *, use_container_width=False)", + "examples": "
\n
\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\nst.dataframe(df, 200, 100)\n
\n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a dataframe as an interactive table.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, snowflake.snowpark.dataframe.DataFrame, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. (It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.)\nStyler support is experimental!\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the dataframe expressed in pixels. If None, the width\nwill be automatically calculated based on the column content.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the dataframe expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the dataframe width to the width of the parent container.\nThis takes precedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/dataframe_selector.py#L37" + }, + "DeltaGenerator.date_input": { + "name": "date_input", + "signature": "element.date_input(self, label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nd = st.date_input(\n    "When's your birthday",\n    datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a date input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this date input is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", + "is_optional": false, + "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", + "default": "today" + }, + { + "name": "min_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", + "default": "value" + }, + { + "name": "max_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", + "default": "value" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this date_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.date or a tuple with 0-2 dates", + "is_generator": false, + "description": "

The current value of the date input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/time_widgets.py#L356" + }, + "DeltaGenerator.determine_delta_color_and_direction": { + "name": "determine_delta_color_and_direction", + "signature": "element.determine_delta_color_and_direction(self, delta_color, delta)" + }, + "DeltaGenerator.download_button": { + "name": "download_button", + "signature": "element.download_button(self, label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False)", + "examples": "
\n

Download a large DataFrame as a CSV:

\n
\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.

\n", + "default": null + }, + { + "name": "data", + "type_name": "str or bytes or file", + "is_optional": false, + "description": "

The contents of the file to be downloaded. See example below for\ncaching techniques to avoid recomputing this data unnecessarily.

\n", + "default": null + }, + { + "name": "file_name", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the name of the file to be downloaded,\nsuch as 'my_file.csv'. If not specified, the name will be\nautomatically generated.

\n", + "default": null + }, + { + "name": "mime", + "type_name": "str or None", + "is_optional": false, + "description": "

The MIME type of the data. If None, defaults to "text/plain"\n(if data is of type str or is a textual file) or\n"application/octet-stream" (if data is of type bytes or is a\nbinary file).

\n", + "default": "s" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/button.py#L143" + }, + "DeltaGenerator.empty": { + "name": "empty", + "signature": "element.empty(self)", + "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", + "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/empty.py#L24" + }, + "DeltaGenerator.error": { + "name": "error", + "signature": "element.error(self, body, *, icon=None)", + "example": "
\n
\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", + "description": "Display error message.", + "args": [ + { + "name": "icon", + "type_name": "None", + "is_optional": false, + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" + }, + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The error text to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/alert.py#L39" + }, + "DeltaGenerator.exception": { + "name": "exception", + "signature": "element.exception(self, exception)", + "example": "
\n
\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", + "description": "Display an exception.", + "args": [ + { + "name": "exception", + "type_name": "Exception", + "is_optional": false, + "description": "

The exception to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/exception.py#L50" + }, + "DeltaGenerator.expander": { + "name": "expander", + "signature": "element.expander(self, label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write("""\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    """)\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write("""\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n""")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/layouts.py#L287" + }, + "DeltaGenerator.file_uploader": { + "name": "file_uploader", + "signature": "element.file_uploader(self, label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this file uploader is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str or list of str or None", + "is_optional": false, + "description": "

Array of allowed extensions. ['png', 'jpg']\nThe default is None, which means all extensions are allowed.

\n", + "default": "None" + }, + { + "name": "accept_multiple_files", + "type_name": "bool", + "is_optional": false, + "description": "

If True, allows the user to upload multiple files at the same time,\nin which case the return value will be a list of files.\nDefault: False

\n", + "default": "False" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the file uploader.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this file_uploader's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the file uploader if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile or list of UploadedFile", + "is_generator": false, + "description": "
    \n
  • If accept_multiple_files is False, returns either None or\nan UploadedFile object.
  • \n
  • If accept_multiple_files is True, returns a list with the\nuploaded files as UploadedFile objects. If no files were\nuploaded, returns an empty list.
  • \n
\n

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/file_uploader.py#L205" + }, + "DeltaGenerator.form": { + "name": "form", + "signature": "element.form(self, key, clear_on_submit=False)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n

Inserting elements out of order:

\n
\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n
\n", + "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

A string that identifies the form. Each form must have its own\nkey. (This key is not displayed to the user in the interface.)

\n", + "default": null + }, + { + "name": "clear_on_submit", + "type_name": "bool", + "is_optional": false, + "description": "

If True, all widgets inside the form will be reset to their default\nvalues after the user presses the Submit button. Defaults to False.\n(Note that Custom Components are unaffected by this flag, and\nwill not be reset to their defaults on form submission.)

\n", + "default": "values" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/form.py#L116" + }, + "DeltaGenerator.form_submit_button": { + "name": "form_submit_button", + "signature": "element.form_submit_button(self, label=\"Submit\", help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False)", + "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nDefaults to "Submit".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

A tooltip that gets displayed when the button is hovered over.\nDefaults to None.

\n", + "default": "None" + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/form.py#L205" + }, + "DeltaGenerator.graphviz_chart": { + "name": "graphviz_chart", + "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nimport graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a graph using the dagre-d3 library.", + "args": [ + { + "name": "figure_or_dot", + "type_name": "graphviz.dot.Graph, graphviz.dot.Digraph, str", + "is_optional": false, + "description": "

The Graphlib graph object or dot string to display

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/graphviz_chart.py#L39" + }, + "DeltaGenerator.header": { + "name": "header", + "signature": "element.header(self, body, anchor=None)", + "example": "
\n
\nst.header('This is a header')\n
\n
\n", + "description": "Display text in header formatting.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display.

\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/heading.py#L27" + }, + "DeltaGenerator.help": { + "name": "help", + "signature": "element.help(self, obj)", + "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nst.help(pandas.DataFrame)\n
\n

Want to quickly check what datatype is output by a certain function?\nTry:

\n
\nx = my_poorly_documented_function()\nst.help(x)\n
\n
\n", + "description": "

Display object's doc string, nicely formatted.

\n

Displays the doc string for this object.

\n", + "args": [ + { + "name": "obj", + "type_name": "Object", + "is_optional": false, + "description": "

The object whose docstring should be displayed.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/doc_string.py#L44" + }, + "DeltaGenerator.image": { + "name": "image", + "signature": "element.image(self, image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", + "example": "
\n
\nfrom PIL import Image\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an image or list of images.", + "args": [ + { + "name": "image", + "type_name": "numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]", + "is_optional": false, + "description": "

Monochrome image of shape (w,h) or (w,h,1)\nOR a color image of shape (w,h,3)\nOR an RGBA image of shape (w,h,4)\nOR a URL to fetch the image from\nOR a path of a local image file\nOR an SVG XML string like <svg xmlns=...</svg>\nOR a list of one of the above, to display multiple images.

\n", + "default": null + }, + { + "name": "caption", + "type_name": "str or list of str", + "is_optional": false, + "description": "

Image caption. If displaying multiple images, caption should be a\nlist of captions (one for each image).

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Image width. None means use the image width,\nbut do not exceed the width of the column.\nShould be set for SVG images, as they have no default image width.

\n", + "default": "image" + }, + { + "name": "use_column_width", + "type_name": "'auto' or 'always' or 'never' or bool", + "is_optional": false, + "description": "

If 'auto', set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf 'always' or True, set the image's width to the column width.\nIf 'never' or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", + "default": null + }, + { + "name": "clamp", + "type_name": "bool", + "is_optional": false, + "description": "

Clamp image pixel values to a valid range ([0-255] per channel).\nThis is only meaningful for byte array images; the parameter is\nignored for image URLs. If this is not set, and an image has an\nout-of-range value, an error will be thrown.

\n", + "default": null + }, + { + "name": "channels", + "type_name": "'RGB' or 'BGR'", + "is_optional": false, + "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to 'RGB', meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to 'BGR', instead.

\n", + "default": "s" + }, + { + "name": "output_format", + "type_name": "'JPEG', 'PNG', or 'auto'", + "is_optional": false, + "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to 'auto' which identifies the compression type based\non the type and format of the image argument.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/image.py#L66" + }, + "DeltaGenerator.info": { + "name": "info", + "signature": "element.info(self, body, *, icon=None)", + "example": "
\n
\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", + "description": "Display an informational message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The info text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "None", + "is_optional": false, + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/alert.py#L97" + }, + "DeltaGenerator.is_negative": { + "name": "is_negative", + "signature": "element.is_negative(delta)" + }, + "DeltaGenerator.json": { + "name": "json", + "signature": "element.json(self, body, *, expanded=True)", + "example": "
\n
\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display object or string as a pretty-printed JSON string.", + "args": [ + { + "name": "body", + "type_name": "object or str", + "is_optional": false, + "description": "

The object to print as JSON. All referenced objects should be\nserializable to JSON as well. If object is a string, we assume it\ncontains serialized JSON.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean that allows the user to set whether the initial\nstate of this json element should be expanded. Defaults to True.\nThis argument can only be supplied by keyword.

\n", + "default": "True" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/json.py#L35" + }, + "DeltaGenerator.latex": { + "name": "latex", + "signature": "element.latex(self, body)", + "example": "
\n
\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", + "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", + "args": [ + { + "name": "body", + "type_name": "str or SymPy expression", + "is_optional": false, + "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/markdown.py#L143" + }, + "DeltaGenerator.line_chart": { + "name": "line_chart", + "signature": "element.line_chart(self, data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\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 \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, snowflake.snowpark.dataframe.DataFrame, Iterable, dict or None", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/dataframe_selector.py#L145" + }, + "DeltaGenerator.map": { + "name": "map", + "signature": "element.map(self, data=None, zoom=None, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a map with points on it.

\n

This is a wrapper around st.pydeck_chart to quickly create scatterplot\ncharts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more\ninfo on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,", + "is_optional": false, + "description": "

or None\nThe data to be plotted. Must have columns called 'lat', 'lon',\n'latitude', or 'longitude'.

\n", + "default": null + }, + { + "name": "zoom", + "type_name": "int", + "is_optional": false, + "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/map.py#L75" + }, + "DeltaGenerator.markdown": { + "name": "markdown", + "signature": "element.markdown(self, body, unsafe_allow_html=False)", + "example": "
\n
\nst.markdown('Streamlit is **_really_ cool**.')\n
\n
\n", + "description": "Display string formatted as Markdown.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/markdown.py#L29" + }, + "DeltaGenerator.metric": { + "name": "metric", + "signature": "element.metric(self, label, value, delta=None, delta_color=\"normal\", help=None)", + "example": "
\n
\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n \n (view standalone Streamlit app)\n \n

st.metric looks especially nice in combination with st.columns:

\n
\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n \n (view standalone Streamlit app)\n \n

The delta indicator color can also be inverted or turned off:

\n
\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

The header or Title for the metric

\n", + "default": null + }, + { + "name": "value", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Value of the metric. None is rendered as a long dash.

\n", + "default": null + }, + { + "name": "delta", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Indicator of how the metric changed, rendered with an arrow below\nthe metric. If delta is negative (int/float) or starts with a minus\nsign (str), the arrow points down and the text is red; else the\narrow points up and the text is green. If None (default), no delta\nindicator is shown.

\n", + "default": null + }, + { + "name": "delta_color", + "type_name": "str", + "is_optional": false, + "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the metric label.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/metric.py#L44" + }, + "DeltaGenerator.multiselect": { + "name": "multiselect", + "signature": "element.multiselect(self, label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", max_selections=None)", + "example": "
\n
\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence[V], numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null + }, + { + "name": "default", + "type_name": "[V], V, or None", + "is_optional": false, + "description": "

List of default values. Can also be a single value.

\n", + "default": "values" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of selectbox options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe multiselect.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the multiselect.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this multiselect's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the multiselect widget if set\nto True. The default is False. This argument can only be supplied\nby keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "max_selections", + "type_name": "int", + "is_optional": false, + "description": "

The max selections that can be selected at a time.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list", + "is_generator": false, + "description": "

A list with the selected options

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/multiselect.py#L145" + }, + "DeltaGenerator.number_input": { + "name": "number_input", + "signature": "element.number_input(self, label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a numeric input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. Output must be purely numeric. This does not impact\nthe return value. Valid formatters: %d %e %f %g %i %u

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this number_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the number input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int or float", + "is_generator": false, + "description": "

The current value of the numeric input widget. The return type\nwill match the data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/number_input.py#L66" + }, + "DeltaGenerator.parse_delta": { + "name": "parse_delta", + "signature": "element.parse_delta(delta)" + }, + "DeltaGenerator.parse_label": { + "name": "parse_label", + "signature": "element.parse_label(label)" + }, + "DeltaGenerator.parse_value": { + "name": "parse_value", + "signature": "element.parse_value(value)" + }, + "DeltaGenerator.plotly_chart": { + "name": "plotly_chart", + "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)", + "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport plotly.figure_factory as ff\nimport numpy as np\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n        hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", + "args": [ + { + "name": "figure_or_data", + "type_name": "plotly.graph_objs.Figure, plotly.graph_objs.Data,", + "is_optional": false, + "description": "

dict/list of plotly.graph_objs.Figure/Data

\n

See https://plot.ly/python/ for examples of graph descriptions.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + }, + { + "name": "sharing", + "type_name": "{'streamlit', 'private', 'secret', 'public'}", + "is_optional": false, + "description": "

Use 'streamlit' to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", + "default": null + }, + { + "name": "**kwargs", + "type_name": null, + "is_optional": null, + "description": "

Any argument accepted by Plotly's plot() function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/plotly_chart.py#L69" + }, + "DeltaGenerator.progress": { + "name": "progress", + "signature": "element.progress(self, value)", + "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport time\n\nmy_bar = st.progress(0)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1)\n
\n
\n", + "description": "Display a progress bar.", + "args": [ + { + "name": "value", + "type_name": "int or float", + "is_optional": false, + "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/progress.py#L32" + }, + "DeltaGenerator.pydeck_chart": { + "name": "pydeck_chart", + "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)", + "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\ndf = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=df,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=df,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", + "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "pydeck_obj", + "type_name": "pydeck.Deck or None", + "is_optional": false, + "description": "

Object specifying the PyDeck chart to draw.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/deck_gl_json_chart.py#L36" + }, + "DeltaGenerator.pyplot": { + "name": "pyplot", + "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)", + "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", + "example": "
\n
\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a matplotlib.pyplot figure.", + "args": [ + { + "name": "fig", + "type_name": "Matplotlib Figure", + "is_optional": false, + "description": "

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

\n", + "default": null + }, + { + "name": "clear_figure", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", + "default": "based" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Arguments to pass to Matplotlib's savefig function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/pyplot.py#L38" + }, + "DeltaGenerator.radio": { + "name": "radio", + "signature": "element.radio(self, label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, label_visibility=\"visible\")", + "example": "
\n
\ngenre = st.radio(\n    "What's your favorite movie genre",\n    ('Comedy', 'Drama', 'Documentary'))\n\nif genre == 'Comedy':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn't select comedy.")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a radio button widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this radio group is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the radio options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of radio options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe radio.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the radio.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this radio's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the radio button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "horizontal", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", + "default": "false" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/radio.py#L75" + }, + "DeltaGenerator.select_slider": { + "name": "select_slider", + "signature": "element.select_slider(self, label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n \n (view standalone Streamlit app)\n \n ", + "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the slider options. All options will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", + "default": null + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to first option.

\n", + "default": "first" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels from the options.\nargument. It receives the option as an argument and its output\nwill be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the select slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this select_slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the select slider if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any value or tuple of any value", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/select_slider.py#L106" + }, + "DeltaGenerator.selectbox": { + "name": "selectbox", + "signature": "element.selectbox(self, label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a select widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels. It receives the option\nas an argument and its output will be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the selectbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this selectbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the selectbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/selectbox.py#L71" + }, + "DeltaGenerator.slider": { + "name": "slider", + "signature": "element.slider(self, label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nfrom datetime import time\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nfrom datetime import datetime\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The minimum permitted value.\nDefaults to 0 if the value is an int, 0.0 if a float,\nvalue - timedelta(days=14) if a date/datetime, time.min if a time

\n", + "default": "0" + }, + { + "name": "max_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The maximum permitted value.\nDefaults to 100 if the value is an int, 1.0 if a float,\nvalue + timedelta(days=14) if a date/datetime, time.max if a time

\n", + "default": "100" + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to min_value.

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int/float/timedelta or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. This does not impact the return value.\nFormatter for int/float supports: %d %e %f %g %i\nFormatter for date/time/datetime uses Moment.js notation:\nhttps://momentjs.com/docs/#/displaying/format/

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the slider if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int/float/date/time/datetime or tuple of int/float/date/time/datetime", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/slider.py#L171" + }, + "DeltaGenerator.snow": { + "name": "snow", + "signature": "element.snow(self)", + "example": "
\n
\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", + "description": "Draw celebratory snowfall.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/snow.py#L25" + }, + "DeltaGenerator.subheader": { + "name": "subheader", + "signature": "element.subheader(self, body, anchor=None)", + "example": "
\n
\nst.subheader('This is a subheader')\n
\n
\n", + "description": "Display text in subheader formatting.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display.

\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/heading.py#L54" + }, + "DeltaGenerator.success": { + "name": "success", + "signature": "element.success(self, body, *, icon=None)", + "example": "
\n
\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", + "description": "Display a success message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The success text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "None", + "is_optional": false, + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/alert.py#L127" + }, + "DeltaGenerator.table": { + "name": "table", + "signature": "element.table(self, data=None)", + "example": "
\n
\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, snowflake.snowpark.dataframe.DataFrame, Iterable, dict, or None", + "is_optional": false, + "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/dataframe_selector.py#L111" + }, + "DeltaGenerator.tabs": { + "name": "tabs", + "signature": "element.tabs(self, tabs)", + "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", + "args": [ + { + "name": "tabs", + "type_name": "list of strings", + "is_optional": false, + "description": "

Creates a tab for each string in the list. The string is used as the name of the tab.\nThe first tab is selected by default.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/layouts.py#L199" + }, + "DeltaGenerator.text": { + "name": "text", + "signature": "element.text(self, body)", + "example": "
\n
\nst.text('This is some text.')\n
\n
\n", + "description": "Write fixed-width and preformatted text.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/text.py#L27" + }, + "DeltaGenerator.text_area": { + "name": "text_area", + "signature": "element.text_area(self, label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", + "description": "Display a multi-line text input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Maximum number of characters allowed in text area.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the textarea.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_area's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text area is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text area if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/text_widgets.py#L249" + }, + "DeltaGenerator.text_input": { + "name": "text_input", + "signature": "element.text_input(self, label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a single-line text input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Max number of characters allowed in text input.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str", + "is_optional": false, + "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "autocomplete", + "type_name": "str", + "is_optional": false, + "description": "

An optional value that will be passed to the <input> element's\nautocomplete property. If unspecified, this value will be set to\n"new-password" for "password" inputs, and the empty string for\n"default" inputs. For more details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text input is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/text_widgets.py#L69" + }, + "DeltaGenerator.time_input": { + "name": "time_input", + "signature": "element.time_input(self, label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a time input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this time input is for.\nFor accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.time/datetime.datetime", + "is_optional": false, + "description": "

The value of this widget when it first renders. This will be\ncast to str internally. Defaults to the current time.

\n", + "default": "the" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this time_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the time input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.time", + "is_generator": false, + "description": "

The current value of the time input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/time_widgets.py#L212" + }, + "DeltaGenerator.title": { + "name": "title", + "signature": "element.title(self, body, anchor=None)", + "example": "
\n
\nst.title('This is a title')\n
\n
\n", + "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display.

\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/heading.py#L82" + }, + "DeltaGenerator.vega_lite_chart": { + "name": "vega_lite_chart", + "signature": "element.vega_lite_chart(self, data=None, spec=None, use_container_width=False, **kwargs)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(df, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", + "description": "Display a chart using the Vega-Lite library.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "spec", + "type_name": "dict or None", + "is_optional": false, + "description": "

The Vega-Lite spec for the chart. If the spec was already passed in\nthe previous argument, this must be set to None. See\nhttps://vega.github.io/vega-lite/docs/ for more info.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", + "default": null + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Same as spec, but as keywords.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/dataframe_selector.py#L442" + }, + "DeltaGenerator.video": { + "name": "video", + "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)", + "example": "
\n
\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", + "description": "Display a video player.", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "default": null + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the video file. Defaults to 'video/mp4'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/media.py#L80" + }, + "DeltaGenerator.warning": { + "name": "warning", + "signature": "element.warning(self, body, *, icon=None)", + "example": "
\n
\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", + "description": "Display warning message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The warning text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "None", + "is_optional": false, + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/alert.py#L68" + }, + "DeltaGenerator.write": { + "name": "write", + "signature": "element.write(self, *args, unsafe_allow_html=False, **kwargs)", + "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nwrite('Hello, *World!* :sunglasses:')\n
\n\n \n \n (view standalone Streamlit app)\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n \n (view standalone Streamlit app)\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n \n (view standalone Streamlit app)\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression and emoji shortcodes.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": "False" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.14.0/lib/streamlit/elements/write.py#L47" + } + }, + "1.15.0": { + "streamlit.altair_chart": { + "name": "altair_chart", + "signature": "st.altair_chart(altair_chart, use_container_width=False, theme=None)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(chart_data).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a chart using the Altair library.", + "args": [ + { + "name": "altair_chart", + "type_name": "altair.vegalite.v2.api.Chart", + "is_optional": false, + "description": "

The Altair chart object to display.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/dataframe_selector.py#L412" + }, + "streamlit.area_chart": { + "name": "area_chart", + "signature": "st.area_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/dataframe_selector.py#L239" + }, + "streamlit.audio": { + "name": "audio", + "signature": "st.audio(data, format=\"audio/wav\", start_time=0, *, sample_rate=None)", + "example": "
\n
\nimport streamlit as st\nimport numpy as np\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n\nsample_rate = 44100  # 44100 samples per second\nseconds = 2  # Note duration of 2 seconds\nfrequency_la = 440  # Our played note will be 440 Hz\n# Generate array with seconds*sample_rate steps, ranging between 0 and seconds\nt = np.linspace(0, seconds, seconds * sample_rate, False)\n# Generate a 440 Hz sine wave\nnote_la = np.sin(frequency_la * t * 2 * np.pi)\n\nst.audio(note_la, sample_rate=sample_rate)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an audio player.", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw audio data, filename, or a URL pointing to the file to load.\nRaw data formats must include all necessary file headers to match the file\nformat specified via format.\nIf data is a numpy array, it must either be a 1D array of the waveform\nor a 2D array of shape (num_channels, num_samples) with waveforms\nfor all channels. See the default channel order at\nhttp://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx

\n", + "default": "channel" + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + }, + { + "name": "sample_rate", + "type_name": "int or None", + "is_optional": false, + "description": "

The sample rate of the audio data in samples per second. Only required if\ndata is a numpy array.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/media.py#L42" + }, + "streamlit.balloons": { + "name": "balloons", + "signature": "st.balloons()", + "example": "
\n
\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", + "description": "Draw celebratory balloons.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/balloons.py#L25" + }, + "streamlit.bar_chart": { + "name": "bar_chart", + "signature": "st.bar_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/dataframe_selector.py#L325" + }, + "streamlit.beta_columns": { + "name": "beta_columns", + "signature": "st.beta_columns(*args, **kwargs)", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put columns inside another column.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/beta_util.py#L43" + }, + "streamlit.beta_container": { + "name": "beta_container", + "signature": "st.beta_container(*args, **kwargs)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/beta_util.py#L43" + }, + "streamlit.beta_expander": { + "name": "beta_expander", + "signature": "st.beta_expander(*args, **kwargs)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write("""\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    """)\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write("""\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n""")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/beta_util.py#L43" + }, + "streamlit.bokeh_chart": { + "name": "bokeh_chart", + "signature": "st.bokeh_chart(figure, use_container_width=False)", + "example": "
\n
\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", + "args": [ + { + "name": "figure", + "type_name": "bokeh.plotting.figure.Figure", + "is_optional": false, + "description": "

A Bokeh figure to plot.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Bokeh's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/bokeh_chart.py#L36" + }, + "streamlit.button": { + "name": "button", + "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False)", + "example": "
\n
\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a button widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, and Emojis.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/button.py#L61" + }, + "streamlit.cache": { + "name": "cache", + "signature": "st.cache(func=None, persist=False, allow_output_mutation=False, show_spinner=True, suppress_st_warning=False, hash_funcs=None, max_entries=None, ttl=None)", + "example": "
\n
\n@st.cache\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\n@st.cache(persist=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To disable hashing return values, set the allow_output_mutation parameter to True:

\n
\n@st.cache(allow_output_mutation=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. MongoClient) to a hash function (id) like this:

\n
\n@st.cache(hash_funcs={MongoClient: id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "pymongo.mongo_client.MongoClient") to the hash function instead:

\n
\n@st.cache(hash_funcs={"pymongo.mongo_client.MongoClient": id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n
\n", + "description": "Function decorator to memoize function executions.", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to cache. Streamlit hashes the function and dependent code.

\n", + "default": null + }, + { + "name": "persist", + "type_name": "boolean", + "is_optional": false, + "description": "

Whether to persist the cache on disk.

\n", + "default": null + }, + { + "name": "allow_output_mutation", + "type_name": "boolean", + "is_optional": false, + "description": "

Streamlit shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.

\n

If you know what you're doing and would like to override this warning, set this to True.

\n", + "default": null + }, + { + "name": "show_spinner", + "type_name": "boolean", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na cache miss.

\n", + "default": "True" + }, + { + "name": "suppress_st_warning", + "type_name": "boolean", + "is_optional": false, + "description": "

Suppress warnings about calling Streamlit commands from within\nthe cached function.

\n", + "default": null + }, + { + "name": "hash_funcs", + "type_name": "dict or None", + "is_optional": false, + "description": "

Mapping of types or fully qualified names to hash functions. This is used to override\nthe behavior of the hasher inside Streamlit's caching mechanism: when the hasher\nencounters an object, it will first check to see if its type matches a key in this\ndict and, if so, will use the provided function to generate a hash for it. See below\nfor an example of how this can be used.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None" + }, + { + "name": "ttl", + "type_name": "float or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/runtime/legacy_caching/caching.py#L401" + }, + "streamlit.camera_input": { + "name": "camera_input", + "signature": "st.camera_input(label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", + "description": "Display a widget that returns pictures from the user's webcam.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this widget is used for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the camera input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this camera_input's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile", + "is_generator": false, + "description": "

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/camera_input.py#L109" + }, + "streamlit.caption": { + "name": "caption", + "signature": "st.caption(body, unsafe_allow_html=False)", + "example": "
\n
\nst.caption('This is a string that explains something above.')\n
\n
\n", + "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display.

\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/markdown.py#L107" + }, + "streamlit.checkbox": { + "name": "checkbox", + "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\nimport streamlit as st\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a checkbox widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this checkbox is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n", + "default": null + }, + { + "name": "value", + "type_name": "bool", + "is_optional": false, + "description": "

Preselect the checkbox when it first renders. This will be\ncast to bool internally.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the checkbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this checkbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

Whether or not the checkbox is checked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/checkbox.py#L48" + }, + "streamlit.code": { + "name": "code", + "signature": "st.code(body, language=\"python\")", + "example": "
\n
\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", + "description": "

Display a code block with optional syntax highlighting.

\n

(This is a convenience wrapper around st.markdown())

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as code.

\n", + "default": null + }, + { + "name": "language", + "type_name": "str or None", + "is_optional": false, + "description": "

The language that the code is written in, for syntax highlighting.\nIf None, the code will be unstyled. Defaults to "python".

\n

For a list of available language values, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/markdown.py#L74" + }, + "streamlit.color_picker": { + "name": "color_picker", + "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a color picker widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "str", + "is_optional": false, + "description": "

The hex value of this widget when it first renders. If None,\ndefaults to black.

\n", + "default": "black" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the color picker.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this color_picker's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The selected color as a hex string.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/color_picker.py#L52" + }, + "streamlit.columns": { + "name": "columns", + "signature": "st.columns(spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put columns inside another column.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/layouts.py#L74" + }, + "streamlit.container": { + "name": "container", + "signature": "st.container()", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/layouts.py#L29" + }, + "streamlit.dataframe": { + "name": "dataframe", + "signature": "st.dataframe(data=None, width=None, height=None, *, use_container_width=False)", + "examples": "
\n
\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\nst.dataframe(df, 200, 100)\n
\n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a dataframe as an interactive table.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. (It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.)\nStyler support is experimental!\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the dataframe expressed in pixels. If None, the width\nwill be automatically calculated based on the column content.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the dataframe expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the dataframe width to the width of the parent container.\nThis takes precedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/dataframe_selector.py#L39" + }, + "streamlit.date_input": { + "name": "date_input", + "signature": "st.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nd = st.date_input(\n    "When's your birthday",\n    datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a date input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this date input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", + "is_optional": false, + "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", + "default": "today" + }, + { + "name": "min_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", + "default": "value" + }, + { + "name": "max_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", + "default": "value" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this date_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.date or a tuple with 0-2 dates", + "is_generator": false, + "description": "

The current value of the date input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/time_widgets.py#L359" + }, + "streamlit.download_button": { + "name": "download_button", + "signature": "st.download_button(label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False)", + "examples": "
\n

Download a large DataFrame as a CSV:

\n
\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, and Emojis.

\n", + "default": null + }, + { + "name": "data", + "type_name": "str or bytes or file", + "is_optional": false, + "description": "

The contents of the file to be downloaded. See example below for\ncaching techniques to avoid recomputing this data unnecessarily.

\n", + "default": null + }, + { + "name": "file_name", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the name of the file to be downloaded,\nsuch as 'my_file.csv'. If not specified, the name will be\nautomatically generated.

\n", + "default": null + }, + { + "name": "mime", + "type_name": "str or None", + "is_optional": false, + "description": "

The MIME type of the data. If None, defaults to "text/plain"\n(if data is of type str or is a textual file) or\n"application/octet-stream" (if data is of type bytes or is a\nbinary file).

\n", + "default": "s" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/button.py#L145" + }, + "streamlit.echo": { + "name": "echo", + "signature": "st.echo(code_location=\"above\")", + "example": "
\n
\nwith st.echo():\n    st.write('This code will be printed')\n
\n
\n", + "description": "Use in a `with` block to draw some code on the app, then execute it.", + "args": [ + { + "name": "code_location", + "type_name": "\"above\" or \"below\"", + "is_optional": false, + "description": "

Whether to show the echoed code before or after the results of the\nexecuted code block.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/echo.py#L27" + }, + "streamlit.empty": { + "name": "empty", + "signature": "st.empty()", + "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", + "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/empty.py#L24" + }, + "streamlit.error": { + "name": "error", + "signature": "st.error(body, *, icon=None)", + "example": "
\n
\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", + "description": "Display error message.", + "args": [ + { + "name": "icon", + "type_name": "None", + "is_optional": false, + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" + }, + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The error text to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/alert.py#L39" + }, + "streamlit.exception": { + "name": "exception", + "signature": "st.exception(exception)", + "example": "
\n
\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", + "description": "Display an exception.", + "args": [ + { + "name": "exception", + "type_name": "Exception", + "is_optional": false, + "description": "

The exception to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/exception.py#L50" + }, + "streamlit.expander": { + "name": "expander", + "signature": "st.expander(label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write("""\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    """)\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write("""\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n""")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/layouts.py#L290" + }, + "streamlit.experimental_get_query_params": { + "name": "experimental_get_query_params", + "signature": "st.experimental_get_query_params()", + "example": "
\n

Let's say the user's web browser is at\nhttp://localhost:8501/?show_map=True&selected=asia&selected=america.\nThen, you can get the query parameters using the following:

\n
\nst.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\n

Note that the values in the returned dict are always lists. This is\nbecause we internally use Python's urllib.parse.parse_qs(), which behaves\nthis way. And this behavior makes sense when you consider that every item\nin a query string is potentially a 1-element array.

\n
\n", + "description": "Return the query parameters that is currently showing in the browser's URL bar.", + "args": [], + "returns": [ + { + "type_name": "dict", + "is_generator": false, + "description": "

The current query parameters as a dict. "Query parameters" are the part of the URL that comes\nafter the first "?".

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/commands/query_params.py#L23" + }, + "streamlit.experimental_memo": { + "name": "experimental_memo", + "signature": "st.experimental_memo(func=None, *, persist=None, show_spinner=True, suppress_st_warning=False, max_entries=None, ttl=None, experimental_allow_widgets=False)", + "example": "
\n
\n@st.experimental_memo\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\n@st.experimental_memo(persist="disk")\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

By default, all parameters to a memoized function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\n@st.experimental_memo\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nconnection = make_database_connection()\nd1 = fetch_and_clean_data(connection, num_rows=10)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nanother_connection = make_database_connection()\nd2 = fetch_and_clean_data(another_connection, num_rows=10)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _database_connection parameter was different\n# in both calls.\n
\n

A memoized function's cache can be procedurally cleared:

\n
\n@st.experimental_memo\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nfetch_and_clean_data.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Function decorator to memoize function executions.

\n

Memoized data is stored in "pickled" form, which means that the return\nvalue of a memoized function must be pickleable.

\n

Each caller of a memoized function gets its own copy of the cached data.

\n

You can clear a memoized function's cache with f.clear().

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to memoize. Streamlit hashes the function's source code.

\n", + "default": null + }, + { + "name": "persist", + "type_name": "str or None", + "is_optional": false, + "description": "

Optional location to persist cached data to. Currently, the only\nvalid value is "disk", which will persist to the local disk.

\n", + "default": null + }, + { + "name": "show_spinner", + "type_name": "boolean", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na cache miss.

\n", + "default": "True" + }, + { + "name": "suppress_st_warning", + "type_name": "boolean", + "is_optional": false, + "description": "

Suppress warnings about calling Streamlit commands from within\nthe cached function.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None" + }, + { + "name": "ttl", + "type_name": "float or timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.\nNote that ttl is incompatible with persist="disk" - ttl will be\nignored if persist is specified.

\n", + "default": "None" + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the memoized function. Defaults to False.

\n", + "default": "False" + }, + { + "name": ".. note", + "type_name": ":", + "is_optional": false, + "description": "

Support for widgets in cached functions is currently experimental.\nTo enable it, set the parameter experimental_allow_widgets=True\nin @st.experimental_memo. Note that this may lead to excessive memory\nuse since the widget value is treated as an additional input parameter\nto the cache. We may remove support for this option at any time without notice.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/runtime/caching/memo_decorator.py#L233" + }, + "streamlit.experimental_rerun": { + "name": "experimental_rerun", + "signature": "st.experimental_rerun()", + "description": "

Rerun the script immediately.

\n

When st.experimental_rerun() is called, the script is halted - no\nmore statements will be run, and the script will be queued to re-run\nfrom the top.

\n

If this function is called outside of Streamlit, it will raise an\nException.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/commands/execution_control.py#L45" + }, + "streamlit.experimental_set_query_params": { + "name": "experimental_set_query_params", + "signature": "st.experimental_set_query_params(**query_params)", + "example": "
\n

To point the user's web browser to something like\n"http://localhost:8501/?show_map=True&selected=asia&selected=america",\nyou would do the following:

\n
\nst.experimental_set_query_params(\n    show_map=True,\n    selected=["asia", "america"],\n)\n
\n
\n", + "description": "Set the query parameters that are shown in the browser's URL bar.", + "args": [ + { + "name": "**query_params", + "type_name": "dict", + "is_optional": false, + "description": "

The query parameters to set, as key-value pairs.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/commands/query_params.py#L54" + }, + "streamlit.experimental_show": { + "name": "experimental_show", + "signature": "st.experimental_show(*args)", + "notes": "
\n

This is an experimental feature with usage limitations:

\n
    \n
  • The method must be called with the name show.
  • \n
  • Must be called in one line of code, and only once per line.
  • \n
  • \n
    When passing multiple arguments the inclusion of , or ) in a string
    \n
    argument may cause an error.
    \n
    \n
  • \n
\n
\n", + "example": "
\n
\ndataframe = pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n})\nst.experimental_show(dataframe)\n
\n
\n", + "description": "

Write arguments and argument names to your app for debugging purposes.

\n

Show() has similar properties to write():

\n
\n
    \n
  1. You can pass in multiple arguments, all of which will be debugged.
  2. \n
  3. It returns None, so it's "slot" in the app cannot be reused.
  4. \n
\n
\n

Note: This is an experimental feature. See\nhttps://docs.streamlit.io/library/advanced-features/prerelease#experimental for more information.

\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to debug in the App.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/show.py#L23" + }, + "streamlit.experimental_singleton": { + "name": "experimental_singleton", + "signature": "st.experimental_singleton(func=None, *, show_spinner=True, suppress_st_warning=False, experimental_allow_widgets=False)", + "example": "
\n
\n@st.experimental_singleton\ndef get_database_session(url):\n    # Create a database session object that points to the URL.\n    return session\n\ns1 = get_database_session(SESSION_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(SESSION_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the connection object in s1 is the same as in s2.\n\ns3 = get_database_session(SESSION_URL_2)\n# This is a different URL, so the function executes.\n
\n

By default, all parameters to a singleton function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\n@st.experimental_singleton\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\ns1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _sessionmaker parameter was different\n# in both calls.\n
\n

A singleton function's cache can be procedurally cleared:

\n
\n@st.experimental_singleton\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\nget_database_session.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Function decorator to store singleton objects.

\n

Each singleton object is shared across all users connected to the app.\nSingleton objects must be thread-safe, because they can be accessed from\nmultiple threads concurrently.

\n

(If thread-safety is an issue, consider using st.session_state to\nstore per-session singleton objects instead.)

\n

You can clear a memoized function's cache with f.clear().

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function that creates the singleton. Streamlit hashes the\nfunction's source code.

\n", + "default": null + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the singleton is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "suppress_st_warning", + "type_name": "boolean", + "is_optional": false, + "description": "

Suppress warnings about calling Streamlit commands from within\nthe singleton function.

\n", + "default": null + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the singleton function. Defaults to False.

\n", + "default": "False" + }, + { + "name": ".. note", + "type_name": ":", + "is_optional": false, + "description": "

Support for widgets in cached functions is currently experimental.\nTo enable it, set the parameter experimental_allow_widgets=True\nin @st.experimental_singleton. Note that this may lead to excessive\nmemory use since the widget value is treated as an additional input\nparameter to the cache. We may remove support for this option at any\ntime without notice.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/runtime/caching/singleton_decorator.py#L162" + }, + "streamlit.file_uploader": { + "name": "file_uploader", + "signature": "st.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this file uploader is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str or list of str or None", + "is_optional": false, + "description": "

Array of allowed extensions. ['png', 'jpg']\nThe default is None, which means all extensions are allowed.

\n", + "default": "None" + }, + { + "name": "accept_multiple_files", + "type_name": "bool", + "is_optional": false, + "description": "

If True, allows the user to upload multiple files at the same time,\nin which case the return value will be a list of files.\nDefault: False

\n", + "default": "False" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the file uploader.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this file_uploader's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the file uploader if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile or list of UploadedFile", + "is_generator": false, + "description": "
    \n
  • If accept_multiple_files is False, returns either None or\nan UploadedFile object.
  • \n
  • If accept_multiple_files is True, returns a list with the\nuploaded files as UploadedFile objects. If no files were\nuploaded, returns an empty list.
  • \n
\n

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/file_uploader.py#L205" + }, + "streamlit.form": { + "name": "form", + "signature": "st.form(key, clear_on_submit=False)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n

Inserting elements out of order:

\n
\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n
\n", + "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

A string that identifies the form. Each form must have its own\nkey. (This key is not displayed to the user in the interface.)

\n", + "default": null + }, + { + "name": "clear_on_submit", + "type_name": "bool", + "is_optional": false, + "description": "

If True, all widgets inside the form will be reset to their default\nvalues after the user presses the Submit button. Defaults to False.\n(Note that Custom Components are unaffected by this flag, and\nwill not be reset to their defaults on form submission.)

\n", + "default": "values" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/form.py#L116" + }, + "streamlit.form_submit_button": { + "name": "form_submit_button", + "signature": "st.form_submit_button(label=\"Submit\", help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False)", + "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nDefaults to "Submit".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

A tooltip that gets displayed when the button is hovered over.\nDefaults to None.

\n", + "default": "None" + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/form.py#L206" + }, + "streamlit.get_option": { + "name": "get_option", + "signature": "st.get_option(key)", + "description": "

Return the current value of a given Streamlit config option.

\n

Run streamlit config show in the terminal to see all available options.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

The config option key of the form "section.optionName". To see all\navailable options, run streamlit config show on a terminal.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/config.py#L129" + }, + "streamlit.graphviz_chart": { + "name": "graphviz_chart", + "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)", + "example": "
\n
\nimport graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a graph using the dagre-d3 library.", + "args": [ + { + "name": "figure_or_dot", + "type_name": "graphviz.dot.Graph, graphviz.dot.Digraph, str", + "is_optional": false, + "description": "

The Graphlib graph object or dot string to display

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/graphviz_chart.py#L39" + }, + "streamlit.header": { + "name": "header", + "signature": "st.header(body, anchor=None)", + "example": "
\n
\nst.header('This is a header')\n
\n
\n", + "description": "Display text in header formatting.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display.

\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/heading.py#L27" + }, + "streamlit.help": { + "name": "help", + "signature": "st.help(obj)", + "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nst.help(pandas.DataFrame)\n
\n

Want to quickly check what datatype is output by a certain function?\nTry:

\n
\nx = my_poorly_documented_function()\nst.help(x)\n
\n
\n", + "description": "

Display object's doc string, nicely formatted.

\n

Displays the doc string for this object.

\n", + "args": [ + { + "name": "obj", + "type_name": "Object", + "is_optional": false, + "description": "

The object whose docstring should be displayed.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/doc_string.py#L44" + }, + "streamlit.image": { + "name": "image", + "signature": "st.image(image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", + "example": "
\n
\nfrom PIL import Image\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an image or list of images.", + "args": [ + { + "name": "image", + "type_name": "numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]", + "is_optional": false, + "description": "

Monochrome image of shape (w,h) or (w,h,1)\nOR a color image of shape (w,h,3)\nOR an RGBA image of shape (w,h,4)\nOR a URL to fetch the image from\nOR a path of a local image file\nOR an SVG XML string like <svg xmlns=...</svg>\nOR a list of one of the above, to display multiple images.

\n", + "default": null + }, + { + "name": "caption", + "type_name": "str or list of str", + "is_optional": false, + "description": "

Image caption. If displaying multiple images, caption should be a\nlist of captions (one for each image).

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Image width. None means use the image width,\nbut do not exceed the width of the column.\nShould be set for SVG images, as they have no default image width.

\n", + "default": "image" + }, + { + "name": "use_column_width", + "type_name": "'auto' or 'always' or 'never' or bool", + "is_optional": false, + "description": "

If 'auto', set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf 'always' or True, set the image's width to the column width.\nIf 'never' or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", + "default": null + }, + { + "name": "clamp", + "type_name": "bool", + "is_optional": false, + "description": "

Clamp image pixel values to a valid range ([0-255] per channel).\nThis is only meaningful for byte array images; the parameter is\nignored for image URLs. If this is not set, and an image has an\nout-of-range value, an error will be thrown.

\n", + "default": null + }, + { + "name": "channels", + "type_name": "'RGB' or 'BGR'", + "is_optional": false, + "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to 'RGB', meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to 'BGR', instead.

\n", + "default": "s" + }, + { + "name": "output_format", + "type_name": "'JPEG', 'PNG', or 'auto'", + "is_optional": false, + "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to 'auto' which identifies the compression type based\non the type and format of the image argument.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/image.py#L67" + }, + "streamlit.info": { + "name": "info", + "signature": "st.info(body, *, icon=None)", + "example": "
\n
\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", + "description": "Display an informational message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The info text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "None", + "is_optional": false, + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/alert.py#L97" + }, + "streamlit.json": { + "name": "json", + "signature": "st.json(body, *, expanded=True)", + "example": "
\n
\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display object or string as a pretty-printed JSON string.", + "args": [ + { + "name": "body", + "type_name": "object or str", + "is_optional": false, + "description": "

The object to print as JSON. All referenced objects should be\nserializable to JSON as well. If object is a string, we assume it\ncontains serialized JSON.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean that allows the user to set whether the initial\nstate of this json element should be expanded. Defaults to True.\nThis argument can only be supplied by keyword.

\n", + "default": "True" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/json.py#L35" + }, + "streamlit.latex": { + "name": "latex", + "signature": "st.latex(body)", + "example": "
\n
\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", + "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", + "args": [ + { + "name": "body", + "type_name": "str or SymPy expression", + "is_optional": false, + "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/markdown.py#L143" + }, + "streamlit.line_chart": { + "name": "line_chart", + "signature": "st.line_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\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 \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict or None", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/dataframe_selector.py#L153" + }, + "streamlit.map": { + "name": "map", + "signature": "st.map(data=None, zoom=None, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a map with points on it.

\n

This is a wrapper around st.pydeck_chart to quickly create scatterplot\ncharts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more\ninfo on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict,", + "is_optional": false, + "description": "

or None\nThe data to be plotted. Must have columns called 'lat', 'lon',\n'latitude', or 'longitude'.

\n", + "default": null + }, + { + "name": "zoom", + "type_name": "int", + "is_optional": false, + "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/map.py#L76" + }, + "streamlit.markdown": { + "name": "markdown", + "signature": "st.markdown(body, unsafe_allow_html=False)", + "example": "
\n
\nst.markdown('Streamlit is **_really_ cool**.')\n
\n
\n", + "description": "Display string formatted as Markdown.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/markdown.py#L29" + }, + "streamlit.metric": { + "name": "metric", + "signature": "st.metric(label, value, delta=None, delta_color=\"normal\", help=None)", + "example": "
\n
\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n \n (view standalone Streamlit app)\n \n

st.metric looks especially nice in combination with st.columns:

\n
\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n \n (view standalone Streamlit app)\n \n

The delta indicator color can also be inverted or turned off:

\n
\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

The header or title for the metric. The label can optionally contain\nMarkdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Value of the metric. None is rendered as a long dash.

\n", + "default": null + }, + { + "name": "delta", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Indicator of how the metric changed, rendered with an arrow below\nthe metric. If delta is negative (int/float) or starts with a minus\nsign (str), the arrow points down and the text is red; else the\narrow points up and the text is green. If None (default), no delta\nindicator is shown.

\n", + "default": null + }, + { + "name": "delta_color", + "type_name": "str", + "is_optional": false, + "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the metric label.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/metric.py#L44" + }, + "streamlit.multiselect": { + "name": "multiselect", + "signature": "st.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", max_selections=None)", + "example": "
\n
\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence[V], numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null + }, + { + "name": "default", + "type_name": "[V], V, or None", + "is_optional": false, + "description": "

List of default values. Can also be a single value.

\n", + "default": "values" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of selectbox options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe multiselect.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the multiselect.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this multiselect's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the multiselect widget if set\nto True. The default is False. This argument can only be supplied\nby keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "max_selections", + "type_name": "int", + "is_optional": false, + "description": "

The max selections that can be selected at a time.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list", + "is_generator": false, + "description": "

A list with the selected options

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/multiselect.py#L145" + }, + "streamlit.number_input": { + "name": "number_input", + "signature": "st.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a numeric input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. Output must be purely numeric. This does not impact\nthe return value. Valid formatters: %d %e %f %g %i %u

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this number_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the number input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int or float", + "is_generator": false, + "description": "

The current value of the numeric input widget. The return type\nwill match the data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/number_input.py#L66" + }, + "streamlit.plotly_chart": { + "name": "plotly_chart", + "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", theme=None, **kwargs)", + "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python::

\n
import numpy as np\nimport plotly.figure_factory as ff\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n        hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", + "args": [ + { + "name": "figure_or_data", + "type_name": "plotly.graph_objs.Figure, plotly.graph_objs.Data,", + "is_optional": false, + "description": "

dict/list of plotly.graph_objs.Figure/Data

\n

See https://plot.ly/python/ for examples of graph descriptions.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + }, + { + "name": "sharing", + "type_name": "{'streamlit', 'private', 'secret', 'public'}", + "is_optional": false, + "description": "

Use 'streamlit' to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": null, + "is_optional": null, + "description": "

Any argument accepted by Plotly's plot() function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/plotly_chart.py#L70" + }, + "streamlit.progress": { + "name": "progress", + "signature": "st.progress(value)", + "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport time\n\nmy_bar = st.progress(0)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1)\n
\n
\n", + "description": "Display a progress bar.", + "args": [ + { + "name": "value", + "type_name": "int or float", + "is_optional": false, + "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/progress.py#L32" + }, + "streamlit.pydeck_chart": { + "name": "pydeck_chart", + "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)", + "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\nimport pandas as pd\nimport numpy as np\nimport pydeck as pdk\n\nchart_data = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=chart_data,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=chart_data,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", + "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "pydeck_obj", + "type_name": "pydeck.Deck or None", + "is_optional": false, + "description": "

Object specifying the PyDeck chart to draw.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/deck_gl_json_chart.py#L36" + }, + "streamlit.pyplot": { + "name": "pyplot", + "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)", + "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", + "example": "
\n
\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a matplotlib.pyplot figure.", + "args": [ + { + "name": "fig", + "type_name": "Matplotlib Figure", + "is_optional": false, + "description": "

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

\n", + "default": null + }, + { + "name": "clear_figure", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", + "default": "based" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Arguments to pass to Matplotlib's savefig function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/pyplot.py#L38" + }, + "streamlit.radio": { + "name": "radio", + "signature": "st.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, label_visibility=\"visible\")", + "example": "
\n
\ngenre = st.radio(\n    "What's your favorite movie genre",\n    ('Comedy', 'Drama', 'Documentary'))\n\nif genre == 'Comedy':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn't select comedy.")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a radio button widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this radio group is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the radio options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of radio options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe radio.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the radio.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this radio's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the radio button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "horizontal", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", + "default": "false" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/radio.py#L75" + }, + "streamlit.select_slider": { + "name": "select_slider", + "signature": "st.select_slider(label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n \n (view standalone Streamlit app)\n \n ", + "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the slider options. All options will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", + "default": null + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to first option.

\n", + "default": "first" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels from the options.\nargument. It receives the option as an argument and its output\nwill be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the select slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this select_slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the select slider if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any value or tuple of any value", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/select_slider.py#L106" + }, + "streamlit.selectbox": { + "name": "selectbox", + "signature": "st.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a select widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels. It receives the option\nas an argument and its output will be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the selectbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this selectbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the selectbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/selectbox.py#L71" + }, + "streamlit.set_option": { + "name": "set_option", + "signature": "st.set_option(key, value)", + "description": "

Set config option.

\n
\n
Currently, only the following config options can be set within the script itself:
\n
    \n
  • client.caching
  • \n
  • client.displayEnabled
  • \n
  • deprecation.*
  • \n
\n
\n
\n

Calling with any other options will raise StreamlitAPIException.

\n

Run streamlit config show in the terminal to see all available options.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

The config option key of the form "section.optionName". To see all\navailable options, run streamlit config show on a terminal.

\n", + "default": null + }, + { + "name": "value", + "type_name": null, + "is_optional": null, + "description": "

The new value to assign to this config option.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/config.py#L90" + }, + "streamlit.set_page_config": { + "name": "set_page_config", + "signature": "st.set_page_config(page_title=None, page_icon=None, layout=\"centered\", initial_sidebar_state=\"auto\", menu_items=None)", + "example": "
\nst.set_page_config(\n    page_title="Ex-stream-ly Cool App",\n    page_icon="\ud83e\uddca",\n    layout="wide",\n    initial_sidebar_state="expanded",\n    menu_items={\n        'Get Help': 'https://www.extremelycoolapp.com/help',\n        'Report a bug': "https://www.extremelycoolapp.com/bug",\n        'About': "# This is a header. This is an *extremely* cool app!"\n    }\n)\n
\n", + "description": "

Configures the default settings of the page.

\n
\n

Note

\n

This must be the first Streamlit command used in your app, and must only\nbe set once.

\n
\n", + "args": [ + { + "name": "page_title", + "type_name": "str or None", + "is_optional": false, + "description": "

The page title, shown in the browser tab. If None, defaults to the\nfilename of the script ("app.py" would show "app \u2022 Streamlit").

\n", + "default": "the" + }, + { + "name": "page_icon", + "type_name": "Anything supported by st.image or str or None", + "is_optional": false, + "description": "

The page favicon.\nBesides the types supported by st.image (like URLs or numpy arrays),\nyou can pass in an emoji as a string ("\ud83e\udd88") or a shortcode (":shark:").\nIf you're feeling lucky, try "random" for a random emoji!\nEmoji icons are courtesy of Twemoji and loaded from MaxCDN.

\n", + "default": null + }, + { + "name": "layout", + "type_name": "\"centered\" or \"wide\"", + "is_optional": false, + "description": "

How the page content should be laid out. Defaults to "centered",\nwhich constrains the elements into a centered column of fixed width;\n"wide" uses the entire screen.

\n", + "default": "s" + }, + { + "name": "initial_sidebar_state", + "type_name": "\"auto\" or \"expanded\" or \"collapsed\"", + "is_optional": false, + "description": "

How the sidebar should start out. Defaults to "auto",\nwhich hides the sidebar on mobile-sized devices, and shows it otherwise.\n"expanded" shows the sidebar initially; "collapsed" hides it.

\n", + "default": "s" + }, + { + "name": "menu_items", + "type_name": "dict", + "is_optional": false, + "description": "

Configure the menu that appears on the top-right side of this app.\nThe keys in this dict denote the menu item you'd like to configure:

\n
    \n
  • \n
    "Get help": str or None
    \n
    The URL this menu item should point to.\nIf None, hides this menu item.
    \n
    \n
  • \n
  • \n
    "Report a Bug": str or None
    \n
    The URL this menu item should point to.\nIf None, hides this menu item.
    \n
    \n
  • \n
  • \n
    "About": str or None
    \n
    A markdown string to show in the About dialog.\nIf None, only shows Streamlit's default About text.
    \n
    \n
  • \n
\n

The URL may also refer to an email address e.g. mailto:john@example.com.

\n", + "default": "About" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/commands/page_config.py#L114" + }, + "streamlit.slider": { + "name": "slider", + "signature": "st.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nfrom datetime import time\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nfrom datetime import datetime\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The minimum permitted value.\nDefaults to 0 if the value is an int, 0.0 if a float,\nvalue - timedelta(days=14) if a date/datetime, time.min if a time

\n", + "default": "0" + }, + { + "name": "max_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The maximum permitted value.\nDefaults to 100 if the value is an int, 1.0 if a float,\nvalue + timedelta(days=14) if a date/datetime, time.max if a time

\n", + "default": "100" + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to min_value.

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int/float/timedelta or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. This does not impact the return value.\nFormatter for int/float supports: %d %e %f %g %i\nFormatter for date/time/datetime uses Moment.js notation:\nhttps://momentjs.com/docs/#/displaying/format/

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the slider if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int/float/date/time/datetime or tuple of int/float/date/time/datetime", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/slider.py#L171" + }, + "streamlit.snow": { + "name": "snow", + "signature": "st.snow()", + "example": "
\n
\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", + "description": "Draw celebratory snowfall.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/snow.py#L25" + }, + "streamlit.spinner": { + "name": "spinner", + "signature": "st.spinner(text=\"In progress...\")", + "example": "
\n
\nwith st.spinner('Wait for it...'):\n    time.sleep(5)\nst.success('Done!')\n
\n
\n", + "description": "Temporarily displays a message while executing a block of code.", + "args": [ + { + "name": "text", + "type_name": "str", + "is_optional": false, + "description": "

A message to display while executing that block

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/spinner.py#L23" + }, + "streamlit.stop": { + "name": "stop", + "signature": "st.stop()", + "example": "
\n
\nname = st.text_input('Name')\nif not name:\n  st.warning('Please input a name.')\n  st.stop()\nst.success('Thank you for inputting a name.')\n
\n
\n", + "description": "

Stops execution immediately.

\n

Streamlit will not run any statements after st.stop().\nWe recommend rendering a message to explain why the script has stopped.\nWhen run outside of Streamlit, this will raise an Exception.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/commands/execution_control.py#L25" + }, + "streamlit.subheader": { + "name": "subheader", + "signature": "st.subheader(body, anchor=None)", + "example": "
\n
\nst.subheader('This is a subheader')\n
\n
\n", + "description": "Display text in subheader formatting.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display.

\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/heading.py#L54" + }, + "streamlit.success": { + "name": "success", + "signature": "st.success(body, *, icon=None)", + "example": "
\n
\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", + "description": "Display a success message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The success text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "None", + "is_optional": false, + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/alert.py#L127" + }, + "streamlit.table": { + "name": "table", + "signature": "st.table(data=None)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/dataframe_selector.py#L116" + }, + "streamlit.tabs": { + "name": "tabs", + "signature": "st.tabs(tabs)", + "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", + "args": [ + { + "name": "tabs", + "type_name": "list of strings", + "is_optional": false, + "description": "

Creates a tab for each string in the list. The first tab is selected by default.\nThe string is used as the name of the tab and can optionally contain Markdown,\nsupporting the following elements: Bold, Italics, Strikethroughs, Inline Code,\nEmojis, and Links.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/layouts.py#L199" + }, + "streamlit.text": { + "name": "text", + "signature": "st.text(body)", + "example": "
\n
\nst.text('This is some text.')\n
\n
\n", + "description": "Write fixed-width and preformatted text.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/text.py#L27" + }, + "streamlit.text_area": { + "name": "text_area", + "signature": "st.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", + "description": "Display a multi-line text input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Maximum number of characters allowed in text area.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the textarea.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_area's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text area is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text area if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/text_widgets.py#L252" + }, + "streamlit.text_input": { + "name": "text_input", + "signature": "st.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a single-line text input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Max number of characters allowed in text input.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str", + "is_optional": false, + "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "autocomplete", + "type_name": "str", + "is_optional": false, + "description": "

An optional value that will be passed to the <input> element's\nautocomplete property. If unspecified, this value will be set to\n"new-password" for "password" inputs, and the empty string for\n"default" inputs. For more details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text input is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/text_widgets.py#L69" + }, + "streamlit.time_input": { + "name": "time_input", + "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a time input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this time input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.time/datetime.datetime", + "is_optional": false, + "description": "

The value of this widget when it first renders. This will be\ncast to str internally. Defaults to the current time.

\n", + "default": "the" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this time_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the time input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.time", + "is_generator": false, + "description": "

The current value of the time input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/time_widgets.py#L212" + }, + "streamlit.title": { + "name": "title", + "signature": "st.title(body, anchor=None)", + "example": "
\n
\nst.title('This is a title')\n
\n
\n", + "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display.

\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/heading.py#L82" + }, + "streamlit.vega_lite_chart": { + "name": "vega_lite_chart", + "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, theme=None, **kwargs)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(chart_data, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", + "description": "Display a chart using the Vega-Lite library.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "spec", + "type_name": "dict or None", + "is_optional": false, + "description": "

The Vega-Lite spec for the chart. If the spec was already passed in\nthe previous argument, this must be set to None. See\nhttps://vega.github.io/vega-lite/docs/ for more info.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Same as spec, but as keywords.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/dataframe_selector.py#L464" + }, + "streamlit.video": { + "name": "video", + "signature": "st.video(data, format=\"video/mp4\", start_time=0)", + "example": "
\n
\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", + "description": "Display a video player.", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "default": null + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the video file. Defaults to 'video/mp4'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/media.py#L115" + }, + "streamlit.warning": { + "name": "warning", + "signature": "st.warning(body, *, icon=None)", + "example": "
\n
\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", + "description": "Display warning message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The warning text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "None", + "is_optional": false, + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/alert.py#L68" + }, + "streamlit.write": { + "name": "write", + "signature": "st.write(*args, unsafe_allow_html=False, **kwargs)", + "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nwrite('Hello, *World!* :sunglasses:')\n
\n\n \n \n (view standalone Streamlit app)\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n \n (view standalone Streamlit app)\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n \n (view standalone Streamlit app)\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression and emoji shortcodes.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": "False" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/write.py#L47" + }, + "streamlit.experimental_memo.clear": { + "name": "experimental_memo.clear", + "signature": "st.experimental_memo.clear()", + "description": "Clear all in-memory and on-disk memo caches.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/runtime/caching/memo_decorator.py#L399" + }, + "streamlit.experimental_singleton.clear": { + "name": "experimental_singleton.clear", + "signature": "st.experimental_singleton.clear()", + "description": "Clear all singleton caches.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/runtime/caching/singleton_decorator.py#L276" + }, + "streamlit.components.v1.declare_component": { + "name": "declare_component", + "signature": "st.components.v1.declare_component(name, path=None, url=None)", + "description": "Create and register a custom component.", + "args": [ + { + "name": "name", + "type_name": "str", + "is_optional": false, + "description": "

A short, descriptive name for the component. Like, "slider".

\n", + "default": null + }, + { + "name": "path", + "type_name": "str or None", + "is_optional": false, + "description": "

The path to serve the component's frontend files from. Either\npath or url must be specified, but not both.

\n", + "default": null + }, + { + "name": "url", + "type_name": "str or None", + "is_optional": false, + "description": "

The URL that the component is served from. Either path or url\nmust be specified, but not both.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "CustomComponent", + "is_generator": false, + "description": "

A CustomComponent that can be called like a function.\nCalling the component will create a new instance of the component\nin the Streamlit app.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/components/v1/components.py#L246" + }, + "streamlit.components.v1.html": { + "name": "html", + "signature": "st.components.v1.html(html, width=None, height=None, scrolling=False)", + "description": "Display an HTML string in an iframe.", + "args": [ + { + "name": "html", + "type_name": "str", + "is_optional": false, + "description": "

The HTML string to embed in the iframe.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", + "default": "the" + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", + "default": "150" + }, + { + "name": "scrolling", + "type_name": "bool", + "is_optional": false, + "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", + "default": "False" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/iframe.py#L59" + }, + "streamlit.components.v1.iframe": { + "name": "iframe", + "signature": "st.components.v1.iframe(src, width=None, height=None, scrolling=False)", + "description": "Load a remote URL in an iframe.", + "args": [ + { + "name": "src", + "type_name": "str", + "is_optional": false, + "description": "

The URL of the page to embed.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", + "default": "the" + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", + "default": "150" + }, + { + "name": "scrolling", + "type_name": "bool", + "is_optional": false, + "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", + "default": "False" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/iframe.py#L25" + }, + "DeltaGenerator.add_rows": { + "name": "add_rows", + "signature": "element.add_rows(self, data=None, **kwargs)", + "example": "
\n
\ndf1 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table = st.table(df1)\n\ndf2 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table.add_rows(df2)\n# Now the table shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

You can do the same thing with plots. For example, if you want to add\nmore data to a line chart:

\n
\n# Assuming df1 and df2 from the example above still exist...\nmy_chart = st.line_chart(df1)\nmy_chart.add_rows(df2)\n# Now the chart shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

And for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:

\n
\nmy_chart = st.vega_lite_chart({\n    'mark': 'line',\n    'encoding': {'x': 'a', 'y': 'b'},\n    'datasets': {\n      'some_fancy_name': df1,  # <-- named dataset\n     },\n    'data': {'name': 'some_fancy_name'},\n}),\nmy_chart.add_rows(some_fancy_name=df2)  # <-- name used as keyword\n
\n
\n", + "description": "Concatenate a dataframe to the bottom of the current one.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, Iterable, dict, or None", + "is_optional": false, + "description": "

Table to concat. Optional.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "**kwargs", + "type_name": "pandas.DataFrame, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

The named dataset to concat. Optional. You can only pass in 1\ndataset (including the one in the data parameter).

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/dataframe_selector.py#L538" + }, + "DeltaGenerator.altair_chart": { + "name": "altair_chart", + "signature": "element.altair_chart(self, altair_chart, use_container_width=False, theme=None)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(chart_data).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a chart using the Altair library.", + "args": [ + { + "name": "altair_chart", + "type_name": "altair.vegalite.v2.api.Chart", + "is_optional": false, + "description": "

The Altair chart object to display.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/dataframe_selector.py#L412" + }, + "DeltaGenerator.area_chart": { + "name": "area_chart", + "signature": "element.area_chart(self, data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/dataframe_selector.py#L239" + }, + "DeltaGenerator.audio": { + "name": "audio", + "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0, *, sample_rate=None)", + "example": "
\n
\nimport streamlit as st\nimport numpy as np\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n\nsample_rate = 44100  # 44100 samples per second\nseconds = 2  # Note duration of 2 seconds\nfrequency_la = 440  # Our played note will be 440 Hz\n# Generate array with seconds*sample_rate steps, ranging between 0 and seconds\nt = np.linspace(0, seconds, seconds * sample_rate, False)\n# Generate a 440 Hz sine wave\nnote_la = np.sin(frequency_la * t * 2 * np.pi)\n\nst.audio(note_la, sample_rate=sample_rate)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an audio player.", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw audio data, filename, or a URL pointing to the file to load.\nRaw data formats must include all necessary file headers to match the file\nformat specified via format.\nIf data is a numpy array, it must either be a 1D array of the waveform\nor a 2D array of shape (num_channels, num_samples) with waveforms\nfor all channels. See the default channel order at\nhttp://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx

\n", + "default": "channel" + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + }, + { + "name": "sample_rate", + "type_name": "int or None", + "is_optional": false, + "description": "

The sample rate of the audio data in samples per second. Only required if\ndata is a numpy array.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/media.py#L42" + }, + "DeltaGenerator.balloons": { + "name": "balloons", + "signature": "element.balloons(self)", + "example": "
\n
\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", + "description": "Draw celebratory balloons.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/balloons.py#L25" + }, + "DeltaGenerator.bar_chart": { + "name": "bar_chart", + "signature": "element.bar_chart(self, data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/dataframe_selector.py#L325" + }, + "DeltaGenerator.beta_columns": { + "name": "beta_columns", + "signature": "element.beta_columns(*args, **kwargs)", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put columns inside another column.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/beta_util.py#L43" + }, + "DeltaGenerator.beta_container": { + "name": "beta_container", + "signature": "element.beta_container(*args, **kwargs)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/beta_util.py#L43" + }, + "DeltaGenerator.beta_expander": { + "name": "beta_expander", + "signature": "element.beta_expander(*args, **kwargs)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write("""\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    """)\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write("""\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n""")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/beta_util.py#L43" + }, + "DeltaGenerator.bokeh_chart": { + "name": "bokeh_chart", + "signature": "element.bokeh_chart(self, figure, use_container_width=False)", + "example": "
\n
\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", + "args": [ + { + "name": "figure", + "type_name": "bokeh.plotting.figure.Figure", + "is_optional": false, + "description": "

A Bokeh figure to plot.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Bokeh's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/bokeh_chart.py#L36" + }, + "DeltaGenerator.button": { + "name": "button", + "signature": "element.button(self, label, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False)", + "example": "
\n
\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a button widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, and Emojis.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/button.py#L61" + }, + "DeltaGenerator.camera_input": { + "name": "camera_input", + "signature": "element.camera_input(self, label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", + "description": "Display a widget that returns pictures from the user's webcam.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this widget is used for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the camera input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this camera_input's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile", + "is_generator": false, + "description": "

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/camera_input.py#L109" + }, + "DeltaGenerator.caption": { + "name": "caption", + "signature": "element.caption(self, body, unsafe_allow_html=False)", + "example": "
\n
\nst.caption('This is a string that explains something above.')\n
\n
\n", + "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display.

\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/markdown.py#L107" + }, + "DeltaGenerator.checkbox": { + "name": "checkbox", + "signature": "element.checkbox(self, label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)", + "example": "
\n
\nimport streamlit as st\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a checkbox widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this checkbox is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n", + "default": null + }, + { + "name": "value", + "type_name": "bool", + "is_optional": false, + "description": "

Preselect the checkbox when it first renders. This will be\ncast to bool internally.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the checkbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this checkbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

Whether or not the checkbox is checked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/checkbox.py#L48" + }, + "DeltaGenerator.code": { + "name": "code", + "signature": "element.code(self, body, language=\"python\")", + "example": "
\n
\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", + "description": "

Display a code block with optional syntax highlighting.

\n

(This is a convenience wrapper around st.markdown())

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as code.

\n", + "default": null + }, + { + "name": "language", + "type_name": "str or None", + "is_optional": false, + "description": "

The language that the code is written in, for syntax highlighting.\nIf None, the code will be unstyled. Defaults to "python".

\n

For a list of available language values, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/markdown.py#L74" + }, + "DeltaGenerator.color_picker": { + "name": "color_picker", + "signature": "element.color_picker(self, label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a color picker widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "str", + "is_optional": false, + "description": "

The hex value of this widget when it first renders. If None,\ndefaults to black.

\n", + "default": "black" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the color picker.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this color_picker's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The selected color as a hex string.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/color_picker.py#L52" + }, + "DeltaGenerator.columns": { + "name": "columns", + "signature": "element.columns(self, spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put columns inside another column.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/layouts.py#L74" + }, + "DeltaGenerator.container": { + "name": "container", + "signature": "element.container(self)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/layouts.py#L29" + }, + "DeltaGenerator.dataframe": { + "name": "dataframe", + "signature": "element.dataframe(self, data=None, width=None, height=None, *, use_container_width=False)", + "examples": "
\n
\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\nst.dataframe(df, 200, 100)\n
\n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a dataframe as an interactive table.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. (It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.)\nStyler support is experimental!\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the dataframe expressed in pixels. If None, the width\nwill be automatically calculated based on the column content.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the dataframe expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the dataframe width to the width of the parent container.\nThis takes precedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/dataframe_selector.py#L39" + }, + "DeltaGenerator.date_input": { + "name": "date_input", + "signature": "element.date_input(self, label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nd = st.date_input(\n    "When's your birthday",\n    datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a date input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this date input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", + "is_optional": false, + "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", + "default": "today" + }, + { + "name": "min_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", + "default": "value" + }, + { + "name": "max_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", + "default": "value" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this date_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.date or a tuple with 0-2 dates", + "is_generator": false, + "description": "

The current value of the date input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/time_widgets.py#L359" + }, + "DeltaGenerator.determine_delta_color_and_direction": { + "name": "determine_delta_color_and_direction", + "signature": "element.determine_delta_color_and_direction(self, delta_color, delta)" + }, + "DeltaGenerator.download_button": { + "name": "download_button", + "signature": "element.download_button(self, label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False)", + "examples": "
\n

Download a large DataFrame as a CSV:

\n
\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, and Emojis.

\n", + "default": null + }, + { + "name": "data", + "type_name": "str or bytes or file", + "is_optional": false, + "description": "

The contents of the file to be downloaded. See example below for\ncaching techniques to avoid recomputing this data unnecessarily.

\n", + "default": null + }, + { + "name": "file_name", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the name of the file to be downloaded,\nsuch as 'my_file.csv'. If not specified, the name will be\nautomatically generated.

\n", + "default": null + }, + { + "name": "mime", + "type_name": "str or None", + "is_optional": false, + "description": "

The MIME type of the data. If None, defaults to "text/plain"\n(if data is of type str or is a textual file) or\n"application/octet-stream" (if data is of type bytes or is a\nbinary file).

\n", + "default": "s" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/button.py#L145" + }, + "DeltaGenerator.empty": { + "name": "empty", + "signature": "element.empty(self)", + "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", + "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/empty.py#L24" + }, + "DeltaGenerator.error": { + "name": "error", + "signature": "element.error(self, body, *, icon=None)", + "example": "
\n
\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", + "description": "Display error message.", + "args": [ + { + "name": "icon", + "type_name": "None", + "is_optional": false, + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" + }, + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The error text to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/alert.py#L39" + }, + "DeltaGenerator.exception": { + "name": "exception", + "signature": "element.exception(self, exception)", + "example": "
\n
\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", + "description": "Display an exception.", + "args": [ + { + "name": "exception", + "type_name": "Exception", + "is_optional": false, + "description": "

The exception to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/exception.py#L50" + }, + "DeltaGenerator.expander": { + "name": "expander", + "signature": "element.expander(self, label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write("""\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    """)\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write("""\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n""")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/layouts.py#L290" + }, + "DeltaGenerator.file_uploader": { + "name": "file_uploader", + "signature": "element.file_uploader(self, label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this file uploader is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str or list of str or None", + "is_optional": false, + "description": "

Array of allowed extensions. ['png', 'jpg']\nThe default is None, which means all extensions are allowed.

\n", + "default": "None" + }, + { + "name": "accept_multiple_files", + "type_name": "bool", + "is_optional": false, + "description": "

If True, allows the user to upload multiple files at the same time,\nin which case the return value will be a list of files.\nDefault: False

\n", + "default": "False" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the file uploader.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this file_uploader's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the file uploader if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile or list of UploadedFile", + "is_generator": false, + "description": "
    \n
  • If accept_multiple_files is False, returns either None or\nan UploadedFile object.
  • \n
  • If accept_multiple_files is True, returns a list with the\nuploaded files as UploadedFile objects. If no files were\nuploaded, returns an empty list.
  • \n
\n

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/file_uploader.py#L205" + }, + "DeltaGenerator.form": { + "name": "form", + "signature": "element.form(self, key, clear_on_submit=False)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n

Inserting elements out of order:

\n
\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n
\n", + "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

A string that identifies the form. Each form must have its own\nkey. (This key is not displayed to the user in the interface.)

\n", + "default": null + }, + { + "name": "clear_on_submit", + "type_name": "bool", + "is_optional": false, + "description": "

If True, all widgets inside the form will be reset to their default\nvalues after the user presses the Submit button. Defaults to False.\n(Note that Custom Components are unaffected by this flag, and\nwill not be reset to their defaults on form submission.)

\n", + "default": "values" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/form.py#L116" + }, + "DeltaGenerator.form_submit_button": { + "name": "form_submit_button", + "signature": "element.form_submit_button(self, label=\"Submit\", help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False)", + "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nDefaults to "Submit".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

A tooltip that gets displayed when the button is hovered over.\nDefaults to None.

\n", + "default": "None" + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/form.py#L206" + }, + "DeltaGenerator.graphviz_chart": { + "name": "graphviz_chart", + "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)", + "example": "
\n
\nimport graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a graph using the dagre-d3 library.", + "args": [ + { + "name": "figure_or_dot", + "type_name": "graphviz.dot.Graph, graphviz.dot.Digraph, str", + "is_optional": false, + "description": "

The Graphlib graph object or dot string to display

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/graphviz_chart.py#L39" + }, + "DeltaGenerator.header": { + "name": "header", + "signature": "element.header(self, body, anchor=None)", + "example": "
\n
\nst.header('This is a header')\n
\n
\n", + "description": "Display text in header formatting.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display.

\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/heading.py#L27" + }, + "DeltaGenerator.help": { + "name": "help", + "signature": "element.help(self, obj)", + "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nst.help(pandas.DataFrame)\n
\n

Want to quickly check what datatype is output by a certain function?\nTry:

\n
\nx = my_poorly_documented_function()\nst.help(x)\n
\n
\n", + "description": "

Display object's doc string, nicely formatted.

\n

Displays the doc string for this object.

\n", + "args": [ + { + "name": "obj", + "type_name": "Object", + "is_optional": false, + "description": "

The object whose docstring should be displayed.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/doc_string.py#L44" + }, + "DeltaGenerator.image": { + "name": "image", + "signature": "element.image(self, image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", + "example": "
\n
\nfrom PIL import Image\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an image or list of images.", + "args": [ + { + "name": "image", + "type_name": "numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]", + "is_optional": false, + "description": "

Monochrome image of shape (w,h) or (w,h,1)\nOR a color image of shape (w,h,3)\nOR an RGBA image of shape (w,h,4)\nOR a URL to fetch the image from\nOR a path of a local image file\nOR an SVG XML string like <svg xmlns=...</svg>\nOR a list of one of the above, to display multiple images.

\n", + "default": null + }, + { + "name": "caption", + "type_name": "str or list of str", + "is_optional": false, + "description": "

Image caption. If displaying multiple images, caption should be a\nlist of captions (one for each image).

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Image width. None means use the image width,\nbut do not exceed the width of the column.\nShould be set for SVG images, as they have no default image width.

\n", + "default": "image" + }, + { + "name": "use_column_width", + "type_name": "'auto' or 'always' or 'never' or bool", + "is_optional": false, + "description": "

If 'auto', set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf 'always' or True, set the image's width to the column width.\nIf 'never' or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", + "default": null + }, + { + "name": "clamp", + "type_name": "bool", + "is_optional": false, + "description": "

Clamp image pixel values to a valid range ([0-255] per channel).\nThis is only meaningful for byte array images; the parameter is\nignored for image URLs. If this is not set, and an image has an\nout-of-range value, an error will be thrown.

\n", + "default": null + }, + { + "name": "channels", + "type_name": "'RGB' or 'BGR'", + "is_optional": false, + "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to 'RGB', meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to 'BGR', instead.

\n", + "default": "s" + }, + { + "name": "output_format", + "type_name": "'JPEG', 'PNG', or 'auto'", + "is_optional": false, + "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to 'auto' which identifies the compression type based\non the type and format of the image argument.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/image.py#L67" + }, + "DeltaGenerator.info": { + "name": "info", + "signature": "element.info(self, body, *, icon=None)", + "example": "
\n
\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", + "description": "Display an informational message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The info text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "None", + "is_optional": false, + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/alert.py#L97" + }, + "DeltaGenerator.is_negative": { + "name": "is_negative", + "signature": "element.is_negative(delta)" + }, + "DeltaGenerator.json": { + "name": "json", + "signature": "element.json(self, body, *, expanded=True)", + "example": "
\n
\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display object or string as a pretty-printed JSON string.", + "args": [ + { + "name": "body", + "type_name": "object or str", + "is_optional": false, + "description": "

The object to print as JSON. All referenced objects should be\nserializable to JSON as well. If object is a string, we assume it\ncontains serialized JSON.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean that allows the user to set whether the initial\nstate of this json element should be expanded. Defaults to True.\nThis argument can only be supplied by keyword.

\n", + "default": "True" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/json.py#L35" + }, + "DeltaGenerator.latex": { + "name": "latex", + "signature": "element.latex(self, body)", + "example": "
\n
\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", + "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", + "args": [ + { + "name": "body", + "type_name": "str or SymPy expression", + "is_optional": false, + "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/markdown.py#L143" + }, + "DeltaGenerator.line_chart": { + "name": "line_chart", + "signature": "element.line_chart(self, data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\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 \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict or None", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/dataframe_selector.py#L153" + }, + "DeltaGenerator.map": { + "name": "map", + "signature": "element.map(self, data=None, zoom=None, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a map with points on it.

\n

This is a wrapper around st.pydeck_chart to quickly create scatterplot\ncharts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more\ninfo on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict,", + "is_optional": false, + "description": "

or None\nThe data to be plotted. Must have columns called 'lat', 'lon',\n'latitude', or 'longitude'.

\n", + "default": null + }, + { + "name": "zoom", + "type_name": "int", + "is_optional": false, + "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/map.py#L76" + }, + "DeltaGenerator.markdown": { + "name": "markdown", + "signature": "element.markdown(self, body, unsafe_allow_html=False)", + "example": "
\n
\nst.markdown('Streamlit is **_really_ cool**.')\n
\n
\n", + "description": "Display string formatted as Markdown.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/markdown.py#L29" + }, + "DeltaGenerator.metric": { + "name": "metric", + "signature": "element.metric(self, label, value, delta=None, delta_color=\"normal\", help=None)", + "example": "
\n
\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n \n (view standalone Streamlit app)\n \n

st.metric looks especially nice in combination with st.columns:

\n
\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n \n (view standalone Streamlit app)\n \n

The delta indicator color can also be inverted or turned off:

\n
\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

The header or title for the metric. The label can optionally contain\nMarkdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Value of the metric. None is rendered as a long dash.

\n", + "default": null + }, + { + "name": "delta", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Indicator of how the metric changed, rendered with an arrow below\nthe metric. If delta is negative (int/float) or starts with a minus\nsign (str), the arrow points down and the text is red; else the\narrow points up and the text is green. If None (default), no delta\nindicator is shown.

\n", + "default": null + }, + { + "name": "delta_color", + "type_name": "str", + "is_optional": false, + "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the metric label.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/metric.py#L44" + }, + "DeltaGenerator.multiselect": { + "name": "multiselect", + "signature": "element.multiselect(self, label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", max_selections=None)", + "example": "
\n
\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence[V], numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null + }, + { + "name": "default", + "type_name": "[V], V, or None", + "is_optional": false, + "description": "

List of default values. Can also be a single value.

\n", + "default": "values" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of selectbox options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe multiselect.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the multiselect.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this multiselect's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the multiselect widget if set\nto True. The default is False. This argument can only be supplied\nby keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "max_selections", + "type_name": "int", + "is_optional": false, + "description": "

The max selections that can be selected at a time.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list", + "is_generator": false, + "description": "

A list with the selected options

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/multiselect.py#L145" + }, + "DeltaGenerator.number_input": { + "name": "number_input", + "signature": "element.number_input(self, label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a numeric input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. Output must be purely numeric. This does not impact\nthe return value. Valid formatters: %d %e %f %g %i %u

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this number_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the number input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int or float", + "is_generator": false, + "description": "

The current value of the numeric input widget. The return type\nwill match the data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/number_input.py#L66" + }, + "DeltaGenerator.parse_delta": { + "name": "parse_delta", + "signature": "element.parse_delta(delta)" + }, + "DeltaGenerator.parse_label": { + "name": "parse_label", + "signature": "element.parse_label(label)" + }, + "DeltaGenerator.parse_value": { + "name": "parse_value", + "signature": "element.parse_value(value)" + }, + "DeltaGenerator.plotly_chart": { + "name": "plotly_chart", + "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", theme=None, **kwargs)", + "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:\nimport numpy as np\nimport plotly.figure_factory as ff\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)

\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", + "args": [ + { + "name": "figure_or_data", + "type_name": "plotly.graph_objs.Figure, plotly.graph_objs.Data,", + "is_optional": false, + "description": "

dict/list of plotly.graph_objs.Figure/Data

\n

See https://plot.ly/python/ for examples of graph descriptions.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + }, + { + "name": "sharing", + "type_name": "{'streamlit', 'private', 'secret', 'public'}", + "is_optional": false, + "description": "

Use 'streamlit' to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": null, + "is_optional": null, + "description": "

Any argument accepted by Plotly's plot() function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/plotly_chart.py#L70" + }, + "DeltaGenerator.progress": { + "name": "progress", + "signature": "element.progress(self, value)", + "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport time\n\nmy_bar = st.progress(0)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1)\n
\n
\n", + "description": "Display a progress bar.", + "args": [ + { + "name": "value", + "type_name": "int or float", + "is_optional": false, + "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/progress.py#L32" + }, + "DeltaGenerator.pydeck_chart": { + "name": "pydeck_chart", + "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)", + "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\nimport pandas as pd\nimport numpy as np\nimport pydeck as pdk\n\nchart_data = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=chart_data,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=chart_data,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", + "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "pydeck_obj", + "type_name": "pydeck.Deck or None", + "is_optional": false, + "description": "

Object specifying the PyDeck chart to draw.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/deck_gl_json_chart.py#L36" + }, + "DeltaGenerator.pyplot": { + "name": "pyplot", + "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)", + "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", + "example": "
\n
\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a matplotlib.pyplot figure.", + "args": [ + { + "name": "fig", + "type_name": "Matplotlib Figure", + "is_optional": false, + "description": "

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

\n", + "default": null + }, + { + "name": "clear_figure", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", + "default": "based" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Arguments to pass to Matplotlib's savefig function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/pyplot.py#L38" + }, + "DeltaGenerator.radio": { + "name": "radio", + "signature": "element.radio(self, label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, label_visibility=\"visible\")", + "example": "
\n
\ngenre = st.radio(\n    "What's your favorite movie genre",\n    ('Comedy', 'Drama', 'Documentary'))\n\nif genre == 'Comedy':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn't select comedy.")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a radio button widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this radio group is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the radio options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of radio options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe radio.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the radio.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this radio's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the radio button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "horizontal", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", + "default": "false" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/radio.py#L75" + }, + "DeltaGenerator.select_slider": { + "name": "select_slider", + "signature": "element.select_slider(self, label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n \n (view standalone Streamlit app)\n \n ", + "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the slider options. All options will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", + "default": null + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to first option.

\n", + "default": "first" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels from the options.\nargument. It receives the option as an argument and its output\nwill be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the select slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this select_slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the select slider if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any value or tuple of any value", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/select_slider.py#L106" + }, + "DeltaGenerator.selectbox": { + "name": "selectbox", + "signature": "element.selectbox(self, label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a select widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels. It receives the option\nas an argument and its output will be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the selectbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this selectbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the selectbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/selectbox.py#L71" + }, + "DeltaGenerator.slider": { + "name": "slider", + "signature": "element.slider(self, label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nfrom datetime import time\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nfrom datetime import datetime\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The minimum permitted value.\nDefaults to 0 if the value is an int, 0.0 if a float,\nvalue - timedelta(days=14) if a date/datetime, time.min if a time

\n", + "default": "0" + }, + { + "name": "max_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The maximum permitted value.\nDefaults to 100 if the value is an int, 1.0 if a float,\nvalue + timedelta(days=14) if a date/datetime, time.max if a time

\n", + "default": "100" + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to min_value.

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int/float/timedelta or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. This does not impact the return value.\nFormatter for int/float supports: %d %e %f %g %i\nFormatter for date/time/datetime uses Moment.js notation:\nhttps://momentjs.com/docs/#/displaying/format/

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the slider if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int/float/date/time/datetime or tuple of int/float/date/time/datetime", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/slider.py#L171" + }, + "DeltaGenerator.snow": { + "name": "snow", + "signature": "element.snow(self)", + "example": "
\n
\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", + "description": "Draw celebratory snowfall.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/snow.py#L25" + }, + "DeltaGenerator.subheader": { + "name": "subheader", + "signature": "element.subheader(self, body, anchor=None)", + "example": "
\n
\nst.subheader('This is a subheader')\n
\n
\n", + "description": "Display text in subheader formatting.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display.

\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/heading.py#L54" + }, + "DeltaGenerator.success": { + "name": "success", + "signature": "element.success(self, body, *, icon=None)", + "example": "
\n
\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", + "description": "Display a success message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The success text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "None", + "is_optional": false, + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/alert.py#L127" + }, + "DeltaGenerator.table": { + "name": "table", + "signature": "element.table(self, data=None)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/dataframe_selector.py#L116" + }, + "DeltaGenerator.tabs": { + "name": "tabs", + "signature": "element.tabs(self, tabs)", + "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", + "args": [ + { + "name": "tabs", + "type_name": "list of strings", + "is_optional": false, + "description": "

Creates a tab for each string in the list. The first tab is selected by default.\nThe string is used as the name of the tab and can optionally contain Markdown,\nsupporting the following elements: Bold, Italics, Strikethroughs, Inline Code,\nEmojis, and Links.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/layouts.py#L199" + }, + "DeltaGenerator.text": { + "name": "text", + "signature": "element.text(self, body)", + "example": "
\n
\nst.text('This is some text.')\n
\n
\n", + "description": "Write fixed-width and preformatted text.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/text.py#L27" + }, + "DeltaGenerator.text_area": { + "name": "text_area", + "signature": "element.text_area(self, label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", + "description": "Display a multi-line text input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Maximum number of characters allowed in text area.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the textarea.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_area's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text area is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text area if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/text_widgets.py#L252" + }, + "DeltaGenerator.text_input": { + "name": "text_input", + "signature": "element.text_input(self, label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a single-line text input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Max number of characters allowed in text input.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str", + "is_optional": false, + "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "autocomplete", + "type_name": "str", + "is_optional": false, + "description": "

An optional value that will be passed to the <input> element's\nautocomplete property. If unspecified, this value will be set to\n"new-password" for "password" inputs, and the empty string for\n"default" inputs. For more details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text input is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/text_widgets.py#L69" + }, + "DeltaGenerator.time_input": { + "name": "time_input", + "signature": "element.time_input(self, label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a time input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this time input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.time/datetime.datetime", + "is_optional": false, + "description": "

The value of this widget when it first renders. This will be\ncast to str internally. Defaults to the current time.

\n", + "default": "the" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this time_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the time input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.time", + "is_generator": false, + "description": "

The current value of the time input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/time_widgets.py#L212" + }, + "DeltaGenerator.title": { + "name": "title", + "signature": "element.title(self, body, anchor=None)", + "example": "
\n
\nst.title('This is a title')\n
\n
\n", + "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display.

\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/heading.py#L82" + }, + "DeltaGenerator.vega_lite_chart": { + "name": "vega_lite_chart", + "signature": "element.vega_lite_chart(self, data=None, spec=None, use_container_width=False, theme=None, **kwargs)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(chart_data, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", + "description": "Display a chart using the Vega-Lite library.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "spec", + "type_name": "dict or None", + "is_optional": false, + "description": "

The Vega-Lite spec for the chart. If the spec was already passed in\nthe previous argument, this must be set to None. See\nhttps://vega.github.io/vega-lite/docs/ for more info.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Same as spec, but as keywords.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/dataframe_selector.py#L464" + }, + "DeltaGenerator.video": { + "name": "video", + "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)", + "example": "
\n
\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", + "description": "Display a video player.", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "default": null + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the video file. Defaults to 'video/mp4'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/media.py#L115" + }, + "DeltaGenerator.warning": { + "name": "warning", + "signature": "element.warning(self, body, *, icon=None)", + "example": "
\n
\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", + "description": "Display warning message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The warning text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "None", + "is_optional": false, + "description": "

An optional parameter, that adds an emoji to the alert.\nThe default is None.\nThis argument can only be supplied by keyword.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/alert.py#L68" + }, + "DeltaGenerator.write": { + "name": "write", + "signature": "element.write(self, *args, unsafe_allow_html=False, **kwargs)", + "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nwrite('Hello, *World!* :sunglasses:')\n
\n\n \n \n (view standalone Streamlit app)\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n \n (view standalone Streamlit app)\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n \n (view standalone Streamlit app)\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression and emoji shortcodes.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": "False" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.15.0/lib/streamlit/elements/write.py#L47" + } + }, + "1.16.0": { + "streamlit.altair_chart": { + "name": "altair_chart", + "signature": "st.altair_chart(altair_chart, use_container_width=False, theme=\"streamlit\")", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(chart_data).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a chart using the Altair library.", + "args": [ + { + "name": "altair_chart", + "type_name": "altair.vegalite.v2.api.Chart", + "is_optional": false, + "description": "

The Altair chart object to display.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/dataframe_selector.py#L413" + }, + "streamlit.area_chart": { + "name": "area_chart", + "signature": "st.area_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/dataframe_selector.py#L240" + }, + "streamlit.audio": { + "name": "audio", + "signature": "st.audio(data, format=\"audio/wav\", start_time=0, *, sample_rate=None)", + "example": "
\n
\nimport streamlit as st\nimport numpy as np\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n\nsample_rate = 44100  # 44100 samples per second\nseconds = 2  # Note duration of 2 seconds\nfrequency_la = 440  # Our played note will be 440 Hz\n# Generate array with seconds*sample_rate steps, ranging between 0 and seconds\nt = np.linspace(0, seconds, seconds * sample_rate, False)\n# Generate a 440 Hz sine wave\nnote_la = np.sin(frequency_la * t * 2 * np.pi)\n\nst.audio(note_la, sample_rate=sample_rate)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an audio player.", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw audio data, filename, or a URL pointing to the file to load.\nRaw data formats must include all necessary file headers to match the file\nformat specified via format.\nIf data is a numpy array, it must either be a 1D array of the waveform\nor a 2D array of shape (num_channels, num_samples) with waveforms\nfor all channels. See the default channel order at\nhttp://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx

\n", + "default": "channel" + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + }, + { + "name": "sample_rate", + "type_name": "int or None", + "is_optional": false, + "description": "

The sample rate of the audio data in samples per second. Only required if\ndata is a numpy array.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/media.py#L43" + }, + "streamlit.balloons": { + "name": "balloons", + "signature": "st.balloons()", + "example": "
\n
\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", + "description": "Draw celebratory balloons.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/balloons.py#L25" + }, + "streamlit.bar_chart": { + "name": "bar_chart", + "signature": "st.bar_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/dataframe_selector.py#L326" + }, + "streamlit.beta_columns": { + "name": "beta_columns", + "signature": "st.beta_columns(spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put columns inside another column.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/layouts.py#L73" + }, + "streamlit.beta_container": { + "name": "beta_container", + "signature": "st.beta_container()", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/layouts.py#L29" + }, + "streamlit.beta_expander": { + "name": "beta_expander", + "signature": "st.beta_expander(label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/layouts.py#L287" + }, + "streamlit.bokeh_chart": { + "name": "bokeh_chart", + "signature": "st.bokeh_chart(figure, use_container_width=False)", + "example": "
\n
\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", + "args": [ + { + "name": "figure", + "type_name": "bokeh.plotting.figure.Figure", + "is_optional": false, + "description": "

A Bokeh figure to plot.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Bokeh's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/bokeh_chart.py#L36" + }, + "streamlit.button": { + "name": "button", + "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False)", + "example": "
\n
\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a button widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, and Emojis.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/button.py#L61" + }, + "streamlit.cache": { + "name": "cache", + "signature": "st.cache(func=None, persist=False, allow_output_mutation=False, show_spinner=True, suppress_st_warning=False, hash_funcs=None, max_entries=None, ttl=None)", + "example": "
\n
\n@st.cache\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\n@st.cache(persist=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To disable hashing return values, set the allow_output_mutation parameter to True:

\n
\n@st.cache(allow_output_mutation=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. MongoClient) to a hash function (id) like this:

\n
\n@st.cache(hash_funcs={MongoClient: id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "pymongo.mongo_client.MongoClient") to the hash function instead:

\n
\n@st.cache(hash_funcs={"pymongo.mongo_client.MongoClient": id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n
\n", + "description": "Function decorator to memoize function executions.", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to cache. Streamlit hashes the function and dependent code.

\n", + "default": null + }, + { + "name": "persist", + "type_name": "boolean", + "is_optional": false, + "description": "

Whether to persist the cache on disk.

\n", + "default": null + }, + { + "name": "allow_output_mutation", + "type_name": "boolean", + "is_optional": false, + "description": "

Streamlit shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.

\n

If you know what you're doing and would like to override this warning, set this to True.

\n", + "default": null + }, + { + "name": "show_spinner", + "type_name": "boolean", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na cache miss.

\n", + "default": "True" + }, + { + "name": "suppress_st_warning", + "type_name": "boolean", + "is_optional": false, + "description": "

Suppress warnings about calling Streamlit commands from within\nthe cached function.

\n", + "default": null + }, + { + "name": "hash_funcs", + "type_name": "dict or None", + "is_optional": false, + "description": "

Mapping of types or fully qualified names to hash functions. This is used to override\nthe behavior of the hasher inside Streamlit's caching mechanism: when the hasher\nencounters an object, it will first check to see if its type matches a key in this\ndict and, if so, will use the provided function to generate a hash for it. See below\nfor an example of how this can be used.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None" + }, + { + "name": "ttl", + "type_name": "float or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/runtime/legacy_caching/caching.py#L401" + }, + "streamlit.camera_input": { + "name": "camera_input", + "signature": "st.camera_input(label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", + "description": "Display a widget that returns pictures from the user's webcam.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this widget is used for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the camera input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this camera_input's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile", + "is_generator": false, + "description": "

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/camera_input.py#L109" + }, + "streamlit.caption": { + "name": "caption", + "signature": "st.caption(body, unsafe_allow_html=False)", + "examples": "
\n
\nst.caption('This is a string that explains something above.')\nst.caption('A caption with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/markdown.py#L113" + }, + "streamlit.checkbox": { + "name": "checkbox", + "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a checkbox widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this checkbox is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n", + "default": null + }, + { + "name": "value", + "type_name": "bool", + "is_optional": false, + "description": "

Preselect the checkbox when it first renders. This will be\ncast to bool internally.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the checkbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this checkbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

Whether or not the checkbox is checked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/checkbox.py#L52" + }, + "streamlit.code": { + "name": "code", + "signature": "st.code(body, language=\"python\")", + "example": "
\n
\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", + "description": "

Display a code block with optional syntax highlighting.

\n

(This is a convenience wrapper around st.markdown())

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as code.

\n", + "default": null + }, + { + "name": "language", + "type_name": "str or None", + "is_optional": false, + "description": "

The language that the code is written in, for syntax highlighting.\nIf None, the code will be unstyled. Defaults to "python".

\n

For a list of available language values, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/markdown.py#L80" + }, + "streamlit.color_picker": { + "name": "color_picker", + "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a color picker widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "str", + "is_optional": false, + "description": "

The hex value of this widget when it first renders. If None,\ndefaults to black.

\n", + "default": "black" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the color picker.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this color_picker's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The selected color as a hex string.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/color_picker.py#L52" + }, + "streamlit.columns": { + "name": "columns", + "signature": "st.columns(spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put columns inside another column.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/layouts.py#L73" + }, + "streamlit.container": { + "name": "container", + "signature": "st.container()", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/layouts.py#L29" + }, + "streamlit.dataframe": { + "name": "dataframe", + "signature": "st.dataframe(data=None, width=None, height=None, *, use_container_width=False)", + "examples": "
\n
\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\nst.dataframe(df, 200, 100)\n
\n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a dataframe as an interactive table.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. (It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.)\nStyler support is experimental!\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the dataframe expressed in pixels. If None, the width\nwill be automatically calculated based on the column content.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the dataframe expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the dataframe width to the width of the parent container.\nThis takes precedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/dataframe_selector.py#L40" + }, + "streamlit.date_input": { + "name": "date_input", + "signature": "st.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nd = st.date_input(\n    "When\\'s your birthday",\n    datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a date input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this date input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", + "is_optional": false, + "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", + "default": "today" + }, + { + "name": "min_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", + "default": "value" + }, + { + "name": "max_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", + "default": "value" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this date_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.date or a tuple with 0-2 dates", + "is_generator": false, + "description": "

The current value of the date input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/time_widgets.py#L373" + }, + "streamlit.download_button": { + "name": "download_button", + "signature": "st.download_button(label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False)", + "examples": "
\n

Download a large DataFrame as a CSV:

\n
\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, and Emojis.

\n", + "default": null + }, + { + "name": "data", + "type_name": "str or bytes or file", + "is_optional": false, + "description": "

The contents of the file to be downloaded. See example below for\ncaching techniques to avoid recomputing this data unnecessarily.

\n", + "default": null + }, + { + "name": "file_name", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the name of the file to be downloaded,\nsuch as 'my_file.csv'. If not specified, the name will be\nautomatically generated.

\n", + "default": null + }, + { + "name": "mime", + "type_name": "str or None", + "is_optional": false, + "description": "

The MIME type of the data. If None, defaults to "text/plain"\n(if data is of type str or is a textual file) or\n"application/octet-stream" (if data is of type bytes or is a\nbinary file).

\n", + "default": "s" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/button.py#L145" + }, + "streamlit.echo": { + "name": "echo", + "signature": "st.echo(code_location=\"above\")", + "example": "
\n
\nwith st.echo():\n    st.write('This code will be printed')\n
\n
\n", + "description": "Use in a `with` block to draw some code on the app, then execute it.", + "args": [ + { + "name": "code_location", + "type_name": "\"above\" or \"below\"", + "is_optional": false, + "description": "

Whether to show the echoed code before or after the results of the\nexecuted code block.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/echo.py#L27" + }, + "streamlit.empty": { + "name": "empty", + "signature": "st.empty()", + "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", + "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/empty.py#L24" + }, + "streamlit.error": { + "name": "error", + "signature": "st.error(body, *, icon=None)", + "example": "
\n
\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", + "description": "Display error message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The error text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/alert.py#L39" + }, + "streamlit.exception": { + "name": "exception", + "signature": "st.exception(exception)", + "example": "
\n
\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", + "description": "Display an exception.", + "args": [ + { + "name": "exception", + "type_name": "Exception", + "is_optional": false, + "description": "

The exception to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/exception.py#L50" + }, + "streamlit.expander": { + "name": "expander", + "signature": "st.expander(label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/layouts.py#L287" + }, + "streamlit.experimental_get_query_params": { + "name": "experimental_get_query_params", + "signature": "st.experimental_get_query_params()", + "example": "
\n

Let's say the user's web browser is at\nhttp://localhost:8501/?show_map=True&selected=asia&selected=america.\nThen, you can get the query parameters using the following:

\n
\nst.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\n

Note that the values in the returned dict are always lists. This is\nbecause we internally use Python's urllib.parse.parse_qs(), which behaves\nthis way. And this behavior makes sense when you consider that every item\nin a query string is potentially a 1-element array.

\n
\n", + "description": "Return the query parameters that is currently showing in the browser's URL bar.", + "args": [], + "returns": [ + { + "type_name": "dict", + "is_generator": false, + "description": "

The current query parameters as a dict. "Query parameters" are the part of the URL that comes\nafter the first "?".

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/commands/query_params.py#L23" + }, + "streamlit.experimental_memo": { + "name": "experimental_memo", + "signature": "st.experimental_memo(func=None, *, persist=None, show_spinner=True, suppress_st_warning=False, max_entries=None, ttl=None, experimental_allow_widgets=False)", + "example": "
\n
\n@st.experimental_memo\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\n@st.experimental_memo(persist="disk")\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

By default, all parameters to a memoized function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\n@st.experimental_memo\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nconnection = make_database_connection()\nd1 = fetch_and_clean_data(connection, num_rows=10)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nanother_connection = make_database_connection()\nd2 = fetch_and_clean_data(another_connection, num_rows=10)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _database_connection parameter was different\n# in both calls.\n
\n

A memoized function's cache can be procedurally cleared:

\n
\n@st.experimental_memo\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nfetch_and_clean_data.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Function decorator to memoize function executions.

\n

Memoized data is stored in "pickled" form, which means that the return\nvalue of a memoized function must be pickleable.

\n

Each caller of a memoized function gets its own copy of the cached data.

\n

You can clear a memoized function's cache with f.clear().

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to memoize. Streamlit hashes the function's source code.

\n", + "default": null + }, + { + "name": "persist", + "type_name": "str or None", + "is_optional": false, + "description": "

Optional location to persist cached data to. Currently, the only\nvalid value is "disk", which will persist to the local disk.

\n", + "default": null + }, + { + "name": "show_spinner", + "type_name": "boolean", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na cache miss.

\n", + "default": "True" + }, + { + "name": "suppress_st_warning", + "type_name": "boolean", + "is_optional": false, + "description": "

Suppress warnings about calling Streamlit commands from within\nthe cached function.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None" + }, + { + "name": "ttl", + "type_name": "float or timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.\nNote that ttl is incompatible with persist="disk" - ttl will be\nignored if persist is specified.

\n", + "default": "None" + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the memoized function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/runtime/caching/memo_decorator.py#L232" + }, + "streamlit.experimental_rerun": { + "name": "experimental_rerun", + "signature": "st.experimental_rerun()", + "description": "

Rerun the script immediately.

\n

When st.experimental_rerun() is called, the script is halted - no\nmore statements will be run, and the script will be queued to re-run\nfrom the top.

\n

If this function is called outside of Streamlit, it will raise an\nException.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/commands/execution_control.py#L44" + }, + "streamlit.experimental_set_query_params": { + "name": "experimental_set_query_params", + "signature": "st.experimental_set_query_params(**query_params)", + "example": "
\n

To point the user's web browser to something like\n"http://localhost:8501/?show_map=True&selected=asia&selected=america",\nyou would do the following:

\n
\nst.experimental_set_query_params(\n    show_map=True,\n    selected=["asia", "america"],\n)\n
\n
\n", + "description": "Set the query parameters that are shown in the browser's URL bar.", + "args": [ + { + "name": "**query_params", + "type_name": "dict", + "is_optional": false, + "description": "

The query parameters to set, as key-value pairs.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/commands/query_params.py#L54" + }, + "streamlit.experimental_show": { + "name": "experimental_show", + "signature": "st.experimental_show(*args)", + "notes": "
\n

This is an experimental feature with usage limitations:

\n
    \n
  • The method must be called with the name show.
  • \n
  • Must be called in one line of code, and only once per line.
  • \n
  • \n
    When passing multiple arguments the inclusion of , or ) in a string
    \n
    argument may cause an error.
    \n
    \n
  • \n
\n
\n", + "example": "
\n
\ndataframe = pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n})\nst.experimental_show(dataframe)\n
\n
\n", + "description": "

Write arguments and argument names to your app for debugging purposes.

\n

Show() has similar properties to write():

\n
\n
    \n
  1. You can pass in multiple arguments, all of which will be debugged.
  2. \n
  3. It returns None, so it's "slot" in the app cannot be reused.
  4. \n
\n
\n

Note: This is an experimental feature. See\nhttps://docs.streamlit.io/library/advanced-features/prerelease#experimental for more information.

\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to debug in the App.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/show.py#L23" + }, + "streamlit.experimental_singleton": { + "name": "experimental_singleton", + "signature": "st.experimental_singleton(func=None, *, show_spinner=True, suppress_st_warning=False, max_entries=None, ttl=None, experimental_allow_widgets=False)", + "example": "
\n
\n@st.experimental_singleton\ndef get_database_session(url):\n    # Create a database session object that points to the URL.\n    return session\n\ns1 = get_database_session(SESSION_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(SESSION_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the connection object in s1 is the same as in s2.\n\ns3 = get_database_session(SESSION_URL_2)\n# This is a different URL, so the function executes.\n
\n

By default, all parameters to a singleton function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\n@st.experimental_singleton\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\ns1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _sessionmaker parameter was different\n# in both calls.\n
\n

A singleton function's cache can be procedurally cleared:

\n
\n@st.experimental_singleton\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\nget_database_session.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Function decorator to store singleton objects.

\n

Each singleton object is shared across all users connected to the app.\nSingleton objects must be thread-safe, because they can be accessed from\nmultiple threads concurrently.

\n

(If thread-safety is an issue, consider using st.session_state to\nstore per-session singleton objects instead.)

\n

You can clear a memoized function's cache with f.clear().

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function that creates the singleton. Streamlit hashes the\nfunction's source code.

\n", + "default": null + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the singleton is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "suppress_st_warning", + "type_name": "boolean", + "is_optional": false, + "description": "

Suppress warnings about calling Streamlit commands from within\nthe singleton function.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None" + }, + { + "name": "ttl", + "type_name": "float or timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.

\n", + "default": "None" + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the singleton function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/runtime/caching/singleton_decorator.py#L201" + }, + "streamlit.file_uploader": { + "name": "file_uploader", + "signature": "st.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this file uploader is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str or list of str or None", + "is_optional": false, + "description": "

Array of allowed extensions. ['png', 'jpg']\nThe default is None, which means all extensions are allowed.

\n", + "default": "None" + }, + { + "name": "accept_multiple_files", + "type_name": "bool", + "is_optional": false, + "description": "

If True, allows the user to upload multiple files at the same time,\nin which case the return value will be a list of files.\nDefault: False

\n", + "default": "False" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the file uploader.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this file_uploader's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the file uploader if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile or list of UploadedFile", + "is_generator": false, + "description": "
    \n
  • If accept_multiple_files is False, returns either None or\nan UploadedFile object.
  • \n
  • If accept_multiple_files is True, returns a list with the\nuploaded files as UploadedFile objects. If no files were\nuploaded, returns an empty list.
  • \n
\n

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/file_uploader.py#L205" + }, + "streamlit.form": { + "name": "form", + "signature": "st.form(key, clear_on_submit=False)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n

Inserting elements out of order:

\n
\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n
\n", + "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

A string that identifies the form. Each form must have its own\nkey. (This key is not displayed to the user in the interface.)

\n", + "default": null + }, + { + "name": "clear_on_submit", + "type_name": "bool", + "is_optional": false, + "description": "

If True, all widgets inside the form will be reset to their default\nvalues after the user presses the Submit button. Defaults to False.\n(Note that Custom Components are unaffected by this flag, and\nwill not be reset to their defaults on form submission.)

\n", + "default": "values" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/form.py#L116" + }, + "streamlit.form_submit_button": { + "name": "form_submit_button", + "signature": "st.form_submit_button(label=\"Submit\", help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False)", + "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nDefaults to "Submit".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

A tooltip that gets displayed when the button is hovered over.\nDefaults to None.

\n", + "default": "None" + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/form.py#L205" + }, + "streamlit.get_option": { + "name": "get_option", + "signature": "st.get_option(key)", + "description": "

Return the current value of a given Streamlit config option.

\n

Run streamlit config show in the terminal to see all available options.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

The config option key of the form "section.optionName". To see all\navailable options, run streamlit config show on a terminal.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/config.py#L128" + }, + "streamlit.graphviz_chart": { + "name": "graphviz_chart", + "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)", + "example": "
\n
\nimport graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a graph using the dagre-d3 library.", + "args": [ + { + "name": "figure_or_dot", + "type_name": "graphviz.dot.Graph, graphviz.dot.Digraph, str", + "is_optional": false, + "description": "

The Graphlib graph object or dot string to display

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/graphviz_chart.py#L39" + }, + "streamlit.header": { + "name": "header", + "signature": "st.header(body, anchor=None)", + "examples": "
\n
\nst.header('This is a header')\nst.header('A header with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "Display text in header formatting.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/heading.py#L27" + }, + "streamlit.help": { + "name": "help", + "signature": "st.help(obj)", + "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nst.help(pandas.DataFrame)\n
\n

Want to quickly check what datatype is output by a certain function?\nTry:

\n
\nx = my_poorly_documented_function()\nst.help(x)\n
\n
\n", + "description": "

Display object's doc string, nicely formatted.

\n

Displays the doc string for this object.

\n", + "args": [ + { + "name": "obj", + "type_name": "Object", + "is_optional": false, + "description": "

The object whose docstring should be displayed.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/doc_string.py#L44" + }, + "streamlit.image": { + "name": "image", + "signature": "st.image(image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", + "example": "
\n
\nfrom PIL import Image\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an image or list of images.", + "args": [ + { + "name": "image", + "type_name": "numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]", + "is_optional": false, + "description": "

Monochrome image of shape (w,h) or (w,h,1)\nOR a color image of shape (w,h,3)\nOR an RGBA image of shape (w,h,4)\nOR a URL to fetch the image from\nOR a path of a local image file\nOR an SVG XML string like <svg xmlns=...</svg>\nOR a list of one of the above, to display multiple images.

\n", + "default": null + }, + { + "name": "caption", + "type_name": "str or list of str", + "is_optional": false, + "description": "

Image caption. If displaying multiple images, caption should be a\nlist of captions (one for each image).

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Image width. None means use the image width,\nbut do not exceed the width of the column.\nShould be set for SVG images, as they have no default image width.

\n", + "default": "image" + }, + { + "name": "use_column_width", + "type_name": "'auto' or 'always' or 'never' or bool", + "is_optional": false, + "description": "

If 'auto', set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf 'always' or True, set the image's width to the column width.\nIf 'never' or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", + "default": null + }, + { + "name": "clamp", + "type_name": "bool", + "is_optional": false, + "description": "

Clamp image pixel values to a valid range ([0-255] per channel).\nThis is only meaningful for byte array images; the parameter is\nignored for image URLs. If this is not set, and an image has an\nout-of-range value, an error will be thrown.

\n", + "default": null + }, + { + "name": "channels", + "type_name": "'RGB' or 'BGR'", + "is_optional": false, + "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to 'RGB', meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to 'BGR', instead.

\n", + "default": "s" + }, + { + "name": "output_format", + "type_name": "'JPEG', 'PNG', or 'auto'", + "is_optional": false, + "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to 'auto' which identifies the compression type based\non the type and format of the image argument.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/image.py#L67" + }, + "streamlit.info": { + "name": "info", + "signature": "st.info(body, *, icon=None)", + "example": "
\n
\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", + "description": "Display an informational message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The info text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/alert.py#L99" + }, + "streamlit.json": { + "name": "json", + "signature": "st.json(body, *, expanded=True)", + "example": "
\n
\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display object or string as a pretty-printed JSON string.", + "args": [ + { + "name": "body", + "type_name": "object or str", + "is_optional": false, + "description": "

The object to print as JSON. All referenced objects should be\nserializable to JSON as well. If object is a string, we assume it\ncontains serialized JSON.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean that allows the user to set whether the initial\nstate of this json element should be expanded. Defaults to True.\nThis argument can only be supplied by keyword.

\n", + "default": "True" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/json.py#L35" + }, + "streamlit.latex": { + "name": "latex", + "signature": "st.latex(body)", + "example": "
\n
\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", + "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", + "args": [ + { + "name": "body", + "type_name": "str or SymPy expression", + "is_optional": false, + "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/markdown.py#L165" + }, + "streamlit.line_chart": { + "name": "line_chart", + "signature": "st.line_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\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 \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict or None", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/dataframe_selector.py#L154" + }, + "streamlit.map": { + "name": "map", + "signature": "st.map(data=None, zoom=None, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a map with points on it.

\n

This is a wrapper around st.pydeck_chart to quickly create scatterplot\ncharts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more\ninfo on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to be plotted. Must have two columns:

\n
    \n
  • latitude called 'lat', 'latitude', 'LAT', 'LATITUDE'
  • \n
  • longitude called 'lon', 'longitude', 'LON', 'LONGITUDE'.
  • \n
\n", + "default": null + }, + { + "name": "zoom", + "type_name": "int", + "is_optional": false, + "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/map.py#L76" + }, + "streamlit.markdown": { + "name": "markdown", + "signature": "st.markdown(body, unsafe_allow_html=False)", + "examples": "
\n
\nst.markdown('Streamlit is **_really_ cool**.')\nst.markdown(\u201dThis text is :red[colored red], and this is **:blue[colored]** and bold.\u201d)\nst.markdown(":green[$\\sqrt{x^2+y^2}=1$] is a Pythagorean identity. :pencil:")\n
\n
\n", + "description": "Display string formatted as Markdown.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/markdown.py#L29" + }, + "streamlit.metric": { + "name": "metric", + "signature": "st.metric(label, value, delta=None, delta_color=\"normal\", help=None, label_visibility=\"visible\")", + "example": "
\n
\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n \n (view standalone Streamlit app)\n \n

st.metric looks especially nice in combination with st.columns:

\n
\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n \n (view standalone Streamlit app)\n \n

The delta indicator color can also be inverted or turned off:

\n
\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

The header or title for the metric. The label can optionally contain\nMarkdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "value", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Value of the metric. None is rendered as a long dash.

\n", + "default": null + }, + { + "name": "delta", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Indicator of how the metric changed, rendered with an arrow below\nthe metric. If delta is negative (int/float) or starts with a minus\nsign (str), the arrow points down and the text is red; else the\narrow points up and the text is green. If None (default), no delta\nindicator is shown.

\n", + "default": null + }, + { + "name": "delta_color", + "type_name": "str", + "is_optional": false, + "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the metric label.

\n", + "default": null + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/metric.py#L46" + }, + "streamlit.multiselect": { + "name": "multiselect", + "signature": "st.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", max_selections=None)", + "example": "
\n
\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence[V], numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null + }, + { + "name": "default", + "type_name": "[V], V, or None", + "is_optional": false, + "description": "

List of default values. Can also be a single value.

\n", + "default": "values" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of selectbox options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe multiselect.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the multiselect.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this multiselect's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the multiselect widget if set\nto True. The default is False. This argument can only be supplied\nby keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "max_selections", + "type_name": "int", + "is_optional": false, + "description": "

The max selections that can be selected at a time.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list", + "is_generator": false, + "description": "

A list with the selected options

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/multiselect.py#L145" + }, + "streamlit.number_input": { + "name": "number_input", + "signature": "st.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a numeric input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. Output must be purely numeric. This does not impact\nthe return value. Valid formatters: %d %e %f %g %i %u

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this number_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the number input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int or float", + "is_generator": false, + "description": "

The current value of the numeric input widget. The return type\nwill match the data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/number_input.py#L66" + }, + "streamlit.plotly_chart": { + "name": "plotly_chart", + "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", theme=\"streamlit\", **kwargs)", + "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:\nimport numpy as np\nimport plotly.figure_factory as ff\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)

\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", + "args": [ + { + "name": "figure_or_data", + "type_name": "plotly.graph_objs.Figure, plotly.graph_objs.Data,", + "is_optional": false, + "description": "

dict/list of plotly.graph_objs.Figure/Data

\n

See https://plot.ly/python/ for examples of graph descriptions.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + }, + { + "name": "sharing", + "type_name": "{'streamlit', 'private', 'secret', 'public'}", + "is_optional": false, + "description": "

Use 'streamlit' to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": null, + "is_optional": null, + "description": "

Any argument accepted by Plotly's plot() function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/plotly_chart.py#L81" + }, + "streamlit.progress": { + "name": "progress", + "signature": "st.progress(value)", + "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport time\n\nmy_bar = st.progress(0)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1)\n
\n
\n", + "description": "Display a progress bar.", + "args": [ + { + "name": "value", + "type_name": "int or float", + "is_optional": false, + "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/progress.py#L32" + }, + "streamlit.pydeck_chart": { + "name": "pydeck_chart", + "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)", + "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\nimport pandas as pd\nimport numpy as np\nimport pydeck as pdk\n\nchart_data = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=chart_data,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=chart_data,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", + "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "pydeck_obj", + "type_name": "pydeck.Deck or None", + "is_optional": false, + "description": "

Object specifying the PyDeck chart to draw.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/deck_gl_json_chart.py#L36" + }, + "streamlit.pyplot": { + "name": "pyplot", + "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)", + "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", + "example": "
\n
\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a matplotlib.pyplot figure.", + "args": [ + { + "name": "fig", + "type_name": "Matplotlib Figure", + "is_optional": false, + "description": "

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

\n", + "default": null + }, + { + "name": "clear_figure", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", + "default": "based" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Arguments to pass to Matplotlib's savefig function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/pyplot.py#L38" + }, + "streamlit.radio": { + "name": "radio", + "signature": "st.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, label_visibility=\"visible\")", + "example": "
\n
\ngenre = st.radio(\n    "What\\'s your favorite movie genre",\n    ('Comedy', 'Drama', 'Documentary'))\n\nif genre == 'Comedy':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn\\'t select comedy.")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a radio button widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this radio group is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the radio options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of radio options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe radio.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the radio.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this radio's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the radio button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "horizontal", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", + "default": "false" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/radio.py#L75" + }, + "streamlit.select_slider": { + "name": "select_slider", + "signature": "st.select_slider(label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n \n (view standalone Streamlit app)\n \n ", + "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the slider options. All options will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", + "default": null + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to first option.

\n", + "default": "first" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels from the options.\nargument. It receives the option as an argument and its output\nwill be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the select slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this select_slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the select slider if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any value or tuple of any value", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/select_slider.py#L106" + }, + "streamlit.selectbox": { + "name": "selectbox", + "signature": "st.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a select widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels. It receives the option\nas an argument and its output will be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the selectbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this selectbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the selectbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/selectbox.py#L71" + }, + "streamlit.set_option": { + "name": "set_option", + "signature": "st.set_option(key, value)", + "description": "

Set config option.

\n
\n
Currently, only the following config options can be set within the script itself:
\n
    \n
  • client.caching
  • \n
  • client.displayEnabled
  • \n
  • deprecation.*
  • \n
\n
\n
\n

Calling with any other options will raise StreamlitAPIException.

\n

Run streamlit config show in the terminal to see all available options.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

The config option key of the form "section.optionName". To see all\navailable options, run streamlit config show on a terminal.

\n", + "default": null + }, + { + "name": "value", + "type_name": null, + "is_optional": null, + "description": "

The new value to assign to this config option.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/config.py#L89" + }, + "streamlit.set_page_config": { + "name": "set_page_config", + "signature": "st.set_page_config(page_title=None, page_icon=None, layout=\"centered\", initial_sidebar_state=\"auto\", menu_items=None)", + "example": "
\nst.set_page_config(\n    page_title="Ex-stream-ly Cool App",\n    page_icon="\ud83e\uddca",\n    layout="wide",\n    initial_sidebar_state="expanded",\n    menu_items={\n        'Get Help': 'https://www.extremelycoolapp.com/help',\n        'Report a bug': "https://www.extremelycoolapp.com/bug",\n        'About': "# This is a header. This is an *extremely* cool app!"\n    }\n)\n
\n", + "description": "

Configures the default settings of the page.

\n
\n

Note

\n

This must be the first Streamlit command used in your app, and must only\nbe set once.

\n
\n", + "args": [ + { + "name": "page_title", + "type_name": "str or None", + "is_optional": false, + "description": "

The page title, shown in the browser tab. If None, defaults to the\nfilename of the script ("app.py" would show "app \u2022 Streamlit").

\n", + "default": "the" + }, + { + "name": "page_icon", + "type_name": "Anything supported by st.image or str or None", + "is_optional": false, + "description": "

The page favicon.\nBesides the types supported by st.image (like URLs or numpy arrays),\nyou can pass in an emoji as a string ("\ud83e\udd88") or a shortcode (":shark:").\nIf you're feeling lucky, try "random" for a random emoji!\nEmoji icons are courtesy of Twemoji and loaded from MaxCDN.

\n", + "default": null + }, + { + "name": "layout", + "type_name": "\"centered\" or \"wide\"", + "is_optional": false, + "description": "

How the page content should be laid out. Defaults to "centered",\nwhich constrains the elements into a centered column of fixed width;\n"wide" uses the entire screen.

\n", + "default": "s" + }, + { + "name": "initial_sidebar_state", + "type_name": "\"auto\" or \"expanded\" or \"collapsed\"", + "is_optional": false, + "description": "

How the sidebar should start out. Defaults to "auto",\nwhich hides the sidebar on mobile-sized devices, and shows it otherwise.\n"expanded" shows the sidebar initially; "collapsed" hides it.

\n", + "default": "s" + }, + { + "name": "menu_items", + "type_name": "dict", + "is_optional": false, + "description": "

Configure the menu that appears on the top-right side of this app.\nThe keys in this dict denote the menu item you'd like to configure:

\n
    \n
  • \n
    "Get help": str or None
    \n
    The URL this menu item should point to.\nIf None, hides this menu item.
    \n
    \n
  • \n
  • \n
    "Report a Bug": str or None
    \n
    The URL this menu item should point to.\nIf None, hides this menu item.
    \n
    \n
  • \n
  • \n
    "About": str or None
    \n
    A markdown string to show in the About dialog.\nIf None, only shows Streamlit's default About text.
    \n
    \n
  • \n
\n

The URL may also refer to an email address e.g. mailto:john@example.com.

\n", + "default": "About" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/commands/page_config.py#L114" + }, + "streamlit.slider": { + "name": "slider", + "signature": "st.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nfrom datetime import time\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nfrom datetime import datetime\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The minimum permitted value.\nDefaults to 0 if the value is an int, 0.0 if a float,\nvalue - timedelta(days=14) if a date/datetime, time.min if a time

\n", + "default": "0" + }, + { + "name": "max_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The maximum permitted value.\nDefaults to 100 if the value is an int, 1.0 if a float,\nvalue + timedelta(days=14) if a date/datetime, time.max if a time

\n", + "default": "100" + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to min_value.

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int/float/timedelta or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. This does not impact the return value.\nFormatter for int/float supports: %d %e %f %g %i\nFormatter for date/time/datetime uses Moment.js notation:\nhttps://momentjs.com/docs/#/displaying/format/

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the slider if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int/float/date/time/datetime or tuple of int/float/date/time/datetime", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/slider.py#L171" + }, + "streamlit.snow": { + "name": "snow", + "signature": "st.snow()", + "example": "
\n
\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", + "description": "Draw celebratory snowfall.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/snow.py#L25" + }, + "streamlit.spinner": { + "name": "spinner", + "signature": "st.spinner(text=\"In progress...\")", + "example": "
\n
\nwith st.spinner('Wait for it...'):\n    time.sleep(5)\nst.success('Done!')\n
\n
\n", + "description": "Temporarily displays a message while executing a block of code.", + "args": [ + { + "name": "text", + "type_name": "str", + "is_optional": false, + "description": "

A message to display while executing that block

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/spinner.py#L23" + }, + "streamlit.stop": { + "name": "stop", + "signature": "st.stop()", + "example": "
\n
\nname = st.text_input('Name')\nif not name:\n  st.warning('Please input a name.')\n  st.stop()\nst.success('Thank you for inputting a name.')\n
\n
\n", + "description": "

Stops execution immediately.

\n

Streamlit will not run any statements after st.stop().\nWe recommend rendering a message to explain why the script has stopped.\nWhen run outside of Streamlit, this will raise an Exception.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/commands/execution_control.py#L25" + }, + "streamlit.subheader": { + "name": "subheader", + "signature": "st.subheader(body, anchor=None)", + "examples": "
\n
\nst.subheader('This is a subheader')\nst.subheader('A subheader with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "Display text in subheader formatting.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/heading.py#L70" + }, + "streamlit.success": { + "name": "success", + "signature": "st.success(body, *, icon=None)", + "example": "
\n
\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", + "description": "Display a success message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The success text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/alert.py#L130" + }, + "streamlit.table": { + "name": "table", + "signature": "st.table(data=None)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/dataframe_selector.py#L117" + }, + "streamlit.tabs": { + "name": "tabs", + "signature": "st.tabs(tabs)", + "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", + "args": [ + { + "name": "tabs", + "type_name": "list of strings", + "is_optional": false, + "description": "

Creates a tab for each string in the list. The first tab is selected by default.\nThe string is used as the name of the tab and can optionally contain Markdown,\nsupporting the following elements: Bold, Italics, Strikethroughs, Inline Code,\nEmojis, and Links.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/layouts.py#L197" + }, + "streamlit.text": { + "name": "text", + "signature": "st.text(body)", + "example": "
\n
\nst.text('This is some text.')\n
\n
\n", + "description": "Write fixed-width and preformatted text.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/text.py#L27" + }, + "streamlit.text_area": { + "name": "text_area", + "signature": "st.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", + "description": "Display a multi-line text input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Maximum number of characters allowed in text area.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the textarea.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_area's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text area is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text area if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/text_widgets.py#L266" + }, + "streamlit.text_input": { + "name": "text_input", + "signature": "st.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a single-line text input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Max number of characters allowed in text input.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str", + "is_optional": false, + "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "autocomplete", + "type_name": "str", + "is_optional": false, + "description": "

An optional value that will be passed to the <input> element's\nautocomplete property. If unspecified, this value will be set to\n"new-password" for "password" inputs, and the empty string for\n"default" inputs. For more details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text input is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/text_widgets.py#L69" + }, + "streamlit.time_input": { + "name": "time_input", + "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a time input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this time input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.time/datetime.datetime", + "is_optional": false, + "description": "

The value of this widget when it first renders. This will be\ncast to str internally. Defaults to the current time.

\n", + "default": "the" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this time_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the time input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.time", + "is_generator": false, + "description": "

The current value of the time input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/time_widgets.py#L212" + }, + "streamlit.title": { + "name": "title", + "signature": "st.title(body, anchor=None)", + "examples": "
\n
\nst.title('This is a title')\nst.title('A title with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/heading.py#L114" + }, + "streamlit.vega_lite_chart": { + "name": "vega_lite_chart", + "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, theme=\"streamlit\", **kwargs)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(chart_data, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", + "description": "Display a chart using the Vega-Lite library.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "spec", + "type_name": "dict or None", + "is_optional": false, + "description": "

The Vega-Lite spec for the chart. If the spec was already passed in\nthe previous argument, this must be set to None. See\nhttps://vega.github.io/vega-lite/docs/ for more info.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Same as spec, but as keywords.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/dataframe_selector.py#L465" + }, + "streamlit.video": { + "name": "video", + "signature": "st.video(data, format=\"video/mp4\", start_time=0)", + "example": "
\n
\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", + "description": "Display a video player.", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "default": null + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the video file. Defaults to 'video/mp4'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/media.py#L116" + }, + "streamlit.warning": { + "name": "warning", + "signature": "st.warning(body, *, icon=None)", + "example": "
\n
\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", + "description": "Display warning message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The warning text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/alert.py#L69" + }, + "streamlit.write": { + "name": "write", + "signature": "st.write(*args, unsafe_allow_html=False, **kwargs)", + "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nwrite('Hello, *World!* :sunglasses:')\n
\n\n \n \n (view standalone Streamlit app)\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n \n (view standalone Streamlit app)\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n \n (view standalone Streamlit app)\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression, emoji shortcodes, and colored text.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": "False" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/write.py#L47" + }, + "streamlit.experimental_memo.clear": { + "name": "experimental_memo.clear", + "signature": "st.experimental_memo.clear()", + "description": "Clear all in-memory and on-disk memo caches.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/runtime/caching/memo_decorator.py#L388" + }, + "streamlit.experimental_singleton.clear": { + "name": "experimental_singleton.clear", + "signature": "st.experimental_singleton.clear()", + "description": "Clear all singleton caches.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/runtime/caching/singleton_decorator.py#L326" + }, + "streamlit.components.v1.declare_component": { + "name": "declare_component", + "signature": "st.components.v1.declare_component(name, path=None, url=None)", + "description": "Create and register a custom component.", + "args": [ + { + "name": "name", + "type_name": "str", + "is_optional": false, + "description": "

A short, descriptive name for the component. Like, "slider".

\n", + "default": null + }, + { + "name": "path", + "type_name": "str or None", + "is_optional": false, + "description": "

The path to serve the component's frontend files from. Either\npath or url must be specified, but not both.

\n", + "default": null + }, + { + "name": "url", + "type_name": "str or None", + "is_optional": false, + "description": "

The URL that the component is served from. Either path or url\nmust be specified, but not both.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "CustomComponent", + "is_generator": false, + "description": "

A CustomComponent that can be called like a function.\nCalling the component will create a new instance of the component\nin the Streamlit app.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/components/v1/components.py#L246" + }, + "streamlit.components.v1.html": { + "name": "html", + "signature": "st.components.v1.html(html, width=None, height=None, scrolling=False)", + "description": "Display an HTML string in an iframe.", + "args": [ + { + "name": "html", + "type_name": "str", + "is_optional": false, + "description": "

The HTML string to embed in the iframe.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", + "default": "the" + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", + "default": "150" + }, + { + "name": "scrolling", + "type_name": "bool", + "is_optional": false, + "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", + "default": "False" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/iframe.py#L59" + }, + "streamlit.components.v1.iframe": { + "name": "iframe", + "signature": "st.components.v1.iframe(src, width=None, height=None, scrolling=False)", + "description": "Load a remote URL in an iframe.", + "args": [ + { + "name": "src", + "type_name": "str", + "is_optional": false, + "description": "

The URL of the page to embed.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", + "default": "the" + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", + "default": "150" + }, + { + "name": "scrolling", + "type_name": "bool", + "is_optional": false, + "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", + "default": "False" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/iframe.py#L25" + }, + "DeltaGenerator.add_rows": { + "name": "add_rows", + "signature": "element.add_rows(self, data=None, **kwargs)", + "example": "
\n
\ndf1 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table = st.table(df1)\n\ndf2 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table.add_rows(df2)\n# Now the table shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

You can do the same thing with plots. For example, if you want to add\nmore data to a line chart:

\n
\n# Assuming df1 and df2 from the example above still exist...\nmy_chart = st.line_chart(df1)\nmy_chart.add_rows(df2)\n# Now the chart shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

And for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:

\n
\nmy_chart = st.vega_lite_chart({\n    'mark': 'line',\n    'encoding': {'x': 'a', 'y': 'b'},\n    'datasets': {\n      'some_fancy_name': df1,  # <-- named dataset\n     },\n    'data': {'name': 'some_fancy_name'},\n}),\nmy_chart.add_rows(some_fancy_name=df2)  # <-- name used as keyword\n
\n
\n", + "description": "Concatenate a dataframe to the bottom of the current one.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, Iterable, dict, or None", + "is_optional": false, + "description": "

Table to concat. Optional.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "**kwargs", + "type_name": "pandas.DataFrame, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

The named dataset to concat. Optional. You can only pass in 1\ndataset (including the one in the data parameter).

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/dataframe_selector.py#L539" + }, + "DeltaGenerator.altair_chart": { + "name": "altair_chart", + "signature": "element.altair_chart(self, altair_chart, use_container_width=False, theme=\"streamlit\")", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(chart_data).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a chart using the Altair library.", + "args": [ + { + "name": "altair_chart", + "type_name": "altair.vegalite.v2.api.Chart", + "is_optional": false, + "description": "

The Altair chart object to display.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/dataframe_selector.py#L413" + }, + "DeltaGenerator.area_chart": { + "name": "area_chart", + "signature": "element.area_chart(self, data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/dataframe_selector.py#L240" + }, + "DeltaGenerator.audio": { + "name": "audio", + "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0, *, sample_rate=None)", + "example": "
\n
\nimport streamlit as st\nimport numpy as np\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n\nsample_rate = 44100  # 44100 samples per second\nseconds = 2  # Note duration of 2 seconds\nfrequency_la = 440  # Our played note will be 440 Hz\n# Generate array with seconds*sample_rate steps, ranging between 0 and seconds\nt = np.linspace(0, seconds, seconds * sample_rate, False)\n# Generate a 440 Hz sine wave\nnote_la = np.sin(frequency_la * t * 2 * np.pi)\n\nst.audio(note_la, sample_rate=sample_rate)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an audio player.", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw audio data, filename, or a URL pointing to the file to load.\nRaw data formats must include all necessary file headers to match the file\nformat specified via format.\nIf data is a numpy array, it must either be a 1D array of the waveform\nor a 2D array of shape (num_channels, num_samples) with waveforms\nfor all channels. See the default channel order at\nhttp://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx

\n", + "default": "channel" + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + }, + { + "name": "sample_rate", + "type_name": "int or None", + "is_optional": false, + "description": "

The sample rate of the audio data in samples per second. Only required if\ndata is a numpy array.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/media.py#L43" + }, + "DeltaGenerator.balloons": { + "name": "balloons", + "signature": "element.balloons(self)", + "example": "
\n
\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", + "description": "Draw celebratory balloons.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/balloons.py#L25" + }, + "DeltaGenerator.bar_chart": { + "name": "bar_chart", + "signature": "element.bar_chart(self, data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/dataframe_selector.py#L326" + }, + "DeltaGenerator.beta_columns": { + "name": "beta_columns", + "signature": "element.beta_columns(self, spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put columns inside another column.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/layouts.py#L73" + }, + "DeltaGenerator.beta_container": { + "name": "beta_container", + "signature": "element.beta_container(self)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/layouts.py#L29" + }, + "DeltaGenerator.beta_expander": { + "name": "beta_expander", + "signature": "element.beta_expander(self, label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/layouts.py#L287" + }, + "DeltaGenerator.bokeh_chart": { + "name": "bokeh_chart", + "signature": "element.bokeh_chart(self, figure, use_container_width=False)", + "example": "
\n
\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", + "args": [ + { + "name": "figure", + "type_name": "bokeh.plotting.figure.Figure", + "is_optional": false, + "description": "

A Bokeh figure to plot.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Bokeh's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/bokeh_chart.py#L36" + }, + "DeltaGenerator.button": { + "name": "button", + "signature": "element.button(self, label, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False)", + "example": "
\n
\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a button widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, and Emojis.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/button.py#L61" + }, + "DeltaGenerator.camera_input": { + "name": "camera_input", + "signature": "element.camera_input(self, label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", + "description": "Display a widget that returns pictures from the user's webcam.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this widget is used for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the camera input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this camera_input's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile", + "is_generator": false, + "description": "

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/camera_input.py#L109" + }, + "DeltaGenerator.caption": { + "name": "caption", + "signature": "element.caption(self, body, unsafe_allow_html=False)", + "examples": "
\n
\nst.caption('This is a string that explains something above.')\nst.caption('A caption with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/markdown.py#L113" + }, + "DeltaGenerator.checkbox": { + "name": "checkbox", + "signature": "element.checkbox(self, label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a checkbox widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this checkbox is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n", + "default": null + }, + { + "name": "value", + "type_name": "bool", + "is_optional": false, + "description": "

Preselect the checkbox when it first renders. This will be\ncast to bool internally.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the checkbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this checkbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

Whether or not the checkbox is checked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/checkbox.py#L52" + }, + "DeltaGenerator.code": { + "name": "code", + "signature": "element.code(self, body, language=\"python\")", + "example": "
\n
\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", + "description": "

Display a code block with optional syntax highlighting.

\n

(This is a convenience wrapper around st.markdown())

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as code.

\n", + "default": null + }, + { + "name": "language", + "type_name": "str or None", + "is_optional": false, + "description": "

The language that the code is written in, for syntax highlighting.\nIf None, the code will be unstyled. Defaults to "python".

\n

For a list of available language values, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/markdown.py#L80" + }, + "DeltaGenerator.color_picker": { + "name": "color_picker", + "signature": "element.color_picker(self, label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a color picker widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "str", + "is_optional": false, + "description": "

The hex value of this widget when it first renders. If None,\ndefaults to black.

\n", + "default": "black" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the color picker.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this color_picker's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The selected color as a hex string.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/color_picker.py#L52" + }, + "DeltaGenerator.columns": { + "name": "columns", + "signature": "element.columns(self, spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put columns inside another column.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/layouts.py#L73" + }, + "DeltaGenerator.container": { + "name": "container", + "signature": "element.container(self)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/layouts.py#L29" + }, + "DeltaGenerator.dataframe": { + "name": "dataframe", + "signature": "element.dataframe(self, data=None, width=None, height=None, *, use_container_width=False)", + "examples": "
\n
\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\nst.dataframe(df, 200, 100)\n
\n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a dataframe as an interactive table.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. (It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.)\nStyler support is experimental!\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the dataframe expressed in pixels. If None, the width\nwill be automatically calculated based on the column content.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the dataframe expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the dataframe width to the width of the parent container.\nThis takes precedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/dataframe_selector.py#L40" + }, + "DeltaGenerator.date_input": { + "name": "date_input", + "signature": "element.date_input(self, label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nd = st.date_input(\n    "When\\'s your birthday",\n    datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a date input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this date input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", + "is_optional": false, + "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", + "default": "today" + }, + { + "name": "min_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", + "default": "value" + }, + { + "name": "max_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", + "default": "value" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this date_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.date or a tuple with 0-2 dates", + "is_generator": false, + "description": "

The current value of the date input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/time_widgets.py#L373" + }, + "DeltaGenerator.download_button": { + "name": "download_button", + "signature": "element.download_button(self, label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False)", + "examples": "
\n

Download a large DataFrame as a CSV:

\n
\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, and Emojis.

\n", + "default": null + }, + { + "name": "data", + "type_name": "str or bytes or file", + "is_optional": false, + "description": "

The contents of the file to be downloaded. See example below for\ncaching techniques to avoid recomputing this data unnecessarily.

\n", + "default": null + }, + { + "name": "file_name", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the name of the file to be downloaded,\nsuch as 'my_file.csv'. If not specified, the name will be\nautomatically generated.

\n", + "default": null + }, + { + "name": "mime", + "type_name": "str or None", + "is_optional": false, + "description": "

The MIME type of the data. If None, defaults to "text/plain"\n(if data is of type str or is a textual file) or\n"application/octet-stream" (if data is of type bytes or is a\nbinary file).

\n", + "default": "s" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/button.py#L145" + }, + "DeltaGenerator.empty": { + "name": "empty", + "signature": "element.empty(self)", + "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", + "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/empty.py#L24" + }, + "DeltaGenerator.error": { + "name": "error", + "signature": "element.error(self, body, *, icon=None)", + "example": "
\n
\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", + "description": "Display error message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The error text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/alert.py#L39" + }, + "DeltaGenerator.exception": { + "name": "exception", + "signature": "element.exception(self, exception)", + "example": "
\n
\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", + "description": "Display an exception.", + "args": [ + { + "name": "exception", + "type_name": "Exception", + "is_optional": false, + "description": "

The exception to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/exception.py#L50" + }, + "DeltaGenerator.expander": { + "name": "expander", + "signature": "element.expander(self, label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/layouts.py#L287" + }, + "DeltaGenerator.file_uploader": { + "name": "file_uploader", + "signature": "element.file_uploader(self, label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this file uploader is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str or list of str or None", + "is_optional": false, + "description": "

Array of allowed extensions. ['png', 'jpg']\nThe default is None, which means all extensions are allowed.

\n", + "default": "None" + }, + { + "name": "accept_multiple_files", + "type_name": "bool", + "is_optional": false, + "description": "

If True, allows the user to upload multiple files at the same time,\nin which case the return value will be a list of files.\nDefault: False

\n", + "default": "False" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the file uploader.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this file_uploader's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the file uploader if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile or list of UploadedFile", + "is_generator": false, + "description": "
    \n
  • If accept_multiple_files is False, returns either None or\nan UploadedFile object.
  • \n
  • If accept_multiple_files is True, returns a list with the\nuploaded files as UploadedFile objects. If no files were\nuploaded, returns an empty list.
  • \n
\n

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/file_uploader.py#L205" + }, + "DeltaGenerator.form": { + "name": "form", + "signature": "element.form(self, key, clear_on_submit=False)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n

Inserting elements out of order:

\n
\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n
\n", + "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

A string that identifies the form. Each form must have its own\nkey. (This key is not displayed to the user in the interface.)

\n", + "default": null + }, + { + "name": "clear_on_submit", + "type_name": "bool", + "is_optional": false, + "description": "

If True, all widgets inside the form will be reset to their default\nvalues after the user presses the Submit button. Defaults to False.\n(Note that Custom Components are unaffected by this flag, and\nwill not be reset to their defaults on form submission.)

\n", + "default": "values" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/form.py#L116" + }, + "DeltaGenerator.form_submit_button": { + "name": "form_submit_button", + "signature": "element.form_submit_button(self, label=\"Submit\", help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False)", + "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nDefaults to "Submit".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

A tooltip that gets displayed when the button is hovered over.\nDefaults to None.

\n", + "default": "None" + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/form.py#L205" + }, + "DeltaGenerator.graphviz_chart": { + "name": "graphviz_chart", + "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)", + "example": "
\n
\nimport graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a graph using the dagre-d3 library.", + "args": [ + { + "name": "figure_or_dot", + "type_name": "graphviz.dot.Graph, graphviz.dot.Digraph, str", + "is_optional": false, + "description": "

The Graphlib graph object or dot string to display

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/graphviz_chart.py#L39" + }, + "DeltaGenerator.header": { + "name": "header", + "signature": "element.header(self, body, anchor=None)", + "examples": "
\n
\nst.header('This is a header')\nst.header('A header with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "Display text in header formatting.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/heading.py#L27" + }, + "DeltaGenerator.help": { + "name": "help", + "signature": "element.help(self, obj)", + "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nst.help(pandas.DataFrame)\n
\n

Want to quickly check what datatype is output by a certain function?\nTry:

\n
\nx = my_poorly_documented_function()\nst.help(x)\n
\n
\n", + "description": "

Display object's doc string, nicely formatted.

\n

Displays the doc string for this object.

\n", + "args": [ + { + "name": "obj", + "type_name": "Object", + "is_optional": false, + "description": "

The object whose docstring should be displayed.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/doc_string.py#L44" + }, + "DeltaGenerator.image": { + "name": "image", + "signature": "element.image(self, image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", + "example": "
\n
\nfrom PIL import Image\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an image or list of images.", + "args": [ + { + "name": "image", + "type_name": "numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]", + "is_optional": false, + "description": "

Monochrome image of shape (w,h) or (w,h,1)\nOR a color image of shape (w,h,3)\nOR an RGBA image of shape (w,h,4)\nOR a URL to fetch the image from\nOR a path of a local image file\nOR an SVG XML string like <svg xmlns=...</svg>\nOR a list of one of the above, to display multiple images.

\n", + "default": null + }, + { + "name": "caption", + "type_name": "str or list of str", + "is_optional": false, + "description": "

Image caption. If displaying multiple images, caption should be a\nlist of captions (one for each image).

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Image width. None means use the image width,\nbut do not exceed the width of the column.\nShould be set for SVG images, as they have no default image width.

\n", + "default": "image" + }, + { + "name": "use_column_width", + "type_name": "'auto' or 'always' or 'never' or bool", + "is_optional": false, + "description": "

If 'auto', set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf 'always' or True, set the image's width to the column width.\nIf 'never' or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", + "default": null + }, + { + "name": "clamp", + "type_name": "bool", + "is_optional": false, + "description": "

Clamp image pixel values to a valid range ([0-255] per channel).\nThis is only meaningful for byte array images; the parameter is\nignored for image URLs. If this is not set, and an image has an\nout-of-range value, an error will be thrown.

\n", + "default": null + }, + { + "name": "channels", + "type_name": "'RGB' or 'BGR'", + "is_optional": false, + "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to 'RGB', meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to 'BGR', instead.

\n", + "default": "s" + }, + { + "name": "output_format", + "type_name": "'JPEG', 'PNG', or 'auto'", + "is_optional": false, + "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to 'auto' which identifies the compression type based\non the type and format of the image argument.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/image.py#L67" + }, + "DeltaGenerator.info": { + "name": "info", + "signature": "element.info(self, body, *, icon=None)", + "example": "
\n
\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", + "description": "Display an informational message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The info text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/alert.py#L99" + }, + "DeltaGenerator.json": { + "name": "json", + "signature": "element.json(self, body, *, expanded=True)", + "example": "
\n
\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display object or string as a pretty-printed JSON string.", + "args": [ + { + "name": "body", + "type_name": "object or str", + "is_optional": false, + "description": "

The object to print as JSON. All referenced objects should be\nserializable to JSON as well. If object is a string, we assume it\ncontains serialized JSON.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean that allows the user to set whether the initial\nstate of this json element should be expanded. Defaults to True.\nThis argument can only be supplied by keyword.

\n", + "default": "True" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/json.py#L35" + }, + "DeltaGenerator.latex": { + "name": "latex", + "signature": "element.latex(self, body)", + "example": "
\n
\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", + "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", + "args": [ + { + "name": "body", + "type_name": "str or SymPy expression", + "is_optional": false, + "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/markdown.py#L165" + }, + "DeltaGenerator.line_chart": { + "name": "line_chart", + "signature": "element.line_chart(self, data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\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 \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict or None", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/dataframe_selector.py#L154" + }, + "DeltaGenerator.map": { + "name": "map", + "signature": "element.map(self, data=None, zoom=None, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a map with points on it.

\n

This is a wrapper around st.pydeck_chart to quickly create scatterplot\ncharts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more\ninfo on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to be plotted. Must have two columns:

\n
    \n
  • latitude called 'lat', 'latitude', 'LAT', 'LATITUDE'
  • \n
  • longitude called 'lon', 'longitude', 'LON', 'LONGITUDE'.
  • \n
\n", + "default": null + }, + { + "name": "zoom", + "type_name": "int", + "is_optional": false, + "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/map.py#L76" + }, + "DeltaGenerator.markdown": { + "name": "markdown", + "signature": "element.markdown(self, body, unsafe_allow_html=False)", + "examples": "
\n
\nst.markdown('Streamlit is **_really_ cool**.')\nst.markdown(\u201dThis text is :red[colored red], and this is **:blue[colored]** and bold.\u201d)\nst.markdown(":green[$\\sqrt{x^2+y^2}=1$] is a Pythagorean identity. :pencil:")\n
\n
\n", + "description": "Display string formatted as Markdown.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/markdown.py#L29" + }, + "DeltaGenerator.metric": { + "name": "metric", + "signature": "element.metric(self, label, value, delta=None, delta_color=\"normal\", help=None, label_visibility=\"visible\")", + "example": "
\n
\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n \n (view standalone Streamlit app)\n \n

st.metric looks especially nice in combination with st.columns:

\n
\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n \n (view standalone Streamlit app)\n \n

The delta indicator color can also be inverted or turned off:

\n
\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

The header or title for the metric. The label can optionally contain\nMarkdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "value", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Value of the metric. None is rendered as a long dash.

\n", + "default": null + }, + { + "name": "delta", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Indicator of how the metric changed, rendered with an arrow below\nthe metric. If delta is negative (int/float) or starts with a minus\nsign (str), the arrow points down and the text is red; else the\narrow points up and the text is green. If None (default), no delta\nindicator is shown.

\n", + "default": null + }, + { + "name": "delta_color", + "type_name": "str", + "is_optional": false, + "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the metric label.

\n", + "default": null + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/metric.py#L46" + }, + "DeltaGenerator.multiselect": { + "name": "multiselect", + "signature": "element.multiselect(self, label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", max_selections=None)", + "example": "
\n
\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence[V], numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null + }, + { + "name": "default", + "type_name": "[V], V, or None", + "is_optional": false, + "description": "

List of default values. Can also be a single value.

\n", + "default": "values" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of selectbox options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe multiselect.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the multiselect.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this multiselect's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the multiselect widget if set\nto True. The default is False. This argument can only be supplied\nby keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "max_selections", + "type_name": "int", + "is_optional": false, + "description": "

The max selections that can be selected at a time.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list", + "is_generator": false, + "description": "

A list with the selected options

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/multiselect.py#L145" + }, + "DeltaGenerator.number_input": { + "name": "number_input", + "signature": "element.number_input(self, label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a numeric input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. Output must be purely numeric. This does not impact\nthe return value. Valid formatters: %d %e %f %g %i %u

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this number_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the number input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int or float", + "is_generator": false, + "description": "

The current value of the numeric input widget. The return type\nwill match the data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/number_input.py#L66" + }, + "DeltaGenerator.plotly_chart": { + "name": "plotly_chart", + "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", theme=\"streamlit\", **kwargs)", + "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:\nimport numpy as np\nimport plotly.figure_factory as ff\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)

\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", + "args": [ + { + "name": "figure_or_data", + "type_name": "plotly.graph_objs.Figure, plotly.graph_objs.Data,", + "is_optional": false, + "description": "

dict/list of plotly.graph_objs.Figure/Data

\n

See https://plot.ly/python/ for examples of graph descriptions.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + }, + { + "name": "sharing", + "type_name": "{'streamlit', 'private', 'secret', 'public'}", + "is_optional": false, + "description": "

Use 'streamlit' to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": null, + "is_optional": null, + "description": "

Any argument accepted by Plotly's plot() function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/plotly_chart.py#L81" + }, + "DeltaGenerator.progress": { + "name": "progress", + "signature": "element.progress(self, value)", + "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport time\n\nmy_bar = st.progress(0)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1)\n
\n
\n", + "description": "Display a progress bar.", + "args": [ + { + "name": "value", + "type_name": "int or float", + "is_optional": false, + "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/progress.py#L32" + }, + "DeltaGenerator.pydeck_chart": { + "name": "pydeck_chart", + "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)", + "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\nimport pandas as pd\nimport numpy as np\nimport pydeck as pdk\n\nchart_data = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=chart_data,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=chart_data,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", + "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "pydeck_obj", + "type_name": "pydeck.Deck or None", + "is_optional": false, + "description": "

Object specifying the PyDeck chart to draw.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/deck_gl_json_chart.py#L36" + }, + "DeltaGenerator.pyplot": { + "name": "pyplot", + "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)", + "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", + "example": "
\n
\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a matplotlib.pyplot figure.", + "args": [ + { + "name": "fig", + "type_name": "Matplotlib Figure", + "is_optional": false, + "description": "

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

\n", + "default": null + }, + { + "name": "clear_figure", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", + "default": "based" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Arguments to pass to Matplotlib's savefig function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/pyplot.py#L38" + }, + "DeltaGenerator.radio": { + "name": "radio", + "signature": "element.radio(self, label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, label_visibility=\"visible\")", + "example": "
\n
\ngenre = st.radio(\n    "What\\'s your favorite movie genre",\n    ('Comedy', 'Drama', 'Documentary'))\n\nif genre == 'Comedy':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn\\'t select comedy.")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a radio button widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this radio group is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the radio options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of radio options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe radio.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the radio.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this radio's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the radio button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "horizontal", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", + "default": "false" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/radio.py#L75" + }, + "DeltaGenerator.select_slider": { + "name": "select_slider", + "signature": "element.select_slider(self, label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n \n (view standalone Streamlit app)\n \n ", + "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the slider options. All options will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", + "default": null + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to first option.

\n", + "default": "first" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels from the options.\nargument. It receives the option as an argument and its output\nwill be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the select slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this select_slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the select slider if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any value or tuple of any value", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/select_slider.py#L106" + }, + "DeltaGenerator.selectbox": { + "name": "selectbox", + "signature": "element.selectbox(self, label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a select widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels. It receives the option\nas an argument and its output will be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the selectbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this selectbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the selectbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/selectbox.py#L71" + }, + "DeltaGenerator.slider": { + "name": "slider", + "signature": "element.slider(self, label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nfrom datetime import time\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nfrom datetime import datetime\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The minimum permitted value.\nDefaults to 0 if the value is an int, 0.0 if a float,\nvalue - timedelta(days=14) if a date/datetime, time.min if a time

\n", + "default": "0" + }, + { + "name": "max_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The maximum permitted value.\nDefaults to 100 if the value is an int, 1.0 if a float,\nvalue + timedelta(days=14) if a date/datetime, time.max if a time

\n", + "default": "100" + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to min_value.

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int/float/timedelta or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. This does not impact the return value.\nFormatter for int/float supports: %d %e %f %g %i\nFormatter for date/time/datetime uses Moment.js notation:\nhttps://momentjs.com/docs/#/displaying/format/

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the slider if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int/float/date/time/datetime or tuple of int/float/date/time/datetime", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/slider.py#L171" + }, + "DeltaGenerator.snow": { + "name": "snow", + "signature": "element.snow(self)", + "example": "
\n
\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", + "description": "Draw celebratory snowfall.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/snow.py#L25" + }, + "DeltaGenerator.subheader": { + "name": "subheader", + "signature": "element.subheader(self, body, anchor=None)", + "examples": "
\n
\nst.subheader('This is a subheader')\nst.subheader('A subheader with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "Display text in subheader formatting.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/heading.py#L70" + }, + "DeltaGenerator.success": { + "name": "success", + "signature": "element.success(self, body, *, icon=None)", + "example": "
\n
\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", + "description": "Display a success message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The success text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/alert.py#L130" + }, + "DeltaGenerator.table": { + "name": "table", + "signature": "element.table(self, data=None)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/dataframe_selector.py#L117" + }, + "DeltaGenerator.tabs": { + "name": "tabs", + "signature": "element.tabs(self, tabs)", + "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", + "args": [ + { + "name": "tabs", + "type_name": "list of strings", + "is_optional": false, + "description": "

Creates a tab for each string in the list. The first tab is selected by default.\nThe string is used as the name of the tab and can optionally contain Markdown,\nsupporting the following elements: Bold, Italics, Strikethroughs, Inline Code,\nEmojis, and Links.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/layouts.py#L197" + }, + "DeltaGenerator.text": { + "name": "text", + "signature": "element.text(self, body)", + "example": "
\n
\nst.text('This is some text.')\n
\n
\n", + "description": "Write fixed-width and preformatted text.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/text.py#L27" + }, + "DeltaGenerator.text_area": { + "name": "text_area", + "signature": "element.text_area(self, label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", + "description": "Display a multi-line text input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Maximum number of characters allowed in text area.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the textarea.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_area's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text area is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text area if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/text_widgets.py#L266" + }, + "DeltaGenerator.text_input": { + "name": "text_input", + "signature": "element.text_input(self, label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a single-line text input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Max number of characters allowed in text input.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str", + "is_optional": false, + "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "autocomplete", + "type_name": "str", + "is_optional": false, + "description": "

An optional value that will be passed to the <input> element's\nautocomplete property. If unspecified, this value will be set to\n"new-password" for "password" inputs, and the empty string for\n"default" inputs. For more details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text input is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/text_widgets.py#L69" + }, + "DeltaGenerator.time_input": { + "name": "time_input", + "signature": "element.time_input(self, label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a time input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this time input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.time/datetime.datetime", + "is_optional": false, + "description": "

The value of this widget when it first renders. This will be\ncast to str internally. Defaults to the current time.

\n", + "default": "the" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this time_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the time input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.time", + "is_generator": false, + "description": "

The current value of the time input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/time_widgets.py#L212" + }, + "DeltaGenerator.title": { + "name": "title", + "signature": "element.title(self, body, anchor=None)", + "examples": "
\n
\nst.title('This is a title')\nst.title('A title with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/heading.py#L114" + }, + "DeltaGenerator.vega_lite_chart": { + "name": "vega_lite_chart", + "signature": "element.vega_lite_chart(self, data=None, spec=None, use_container_width=False, theme=\"streamlit\", **kwargs)", + "example": "
\n
\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(chart_data, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", + "description": "Display a chart using the Vega-Lite library.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "spec", + "type_name": "dict or None", + "is_optional": false, + "description": "

The Vega-Lite spec for the chart. If the spec was already passed in\nthe previous argument, this must be set to None. See\nhttps://vega.github.io/vega-lite/docs/ for more info.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Same as spec, but as keywords.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/dataframe_selector.py#L465" + }, + "DeltaGenerator.video": { + "name": "video", + "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)", + "example": "
\n
\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", + "description": "Display a video player.", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "default": null + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the video file. Defaults to 'video/mp4'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/media.py#L116" + }, + "DeltaGenerator.warning": { + "name": "warning", + "signature": "element.warning(self, body, *, icon=None)", + "example": "
\n
\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", + "description": "Display warning message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The warning text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/alert.py#L69" + }, + "DeltaGenerator.write": { + "name": "write", + "signature": "element.write(self, *args, unsafe_allow_html=False, **kwargs)", + "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nwrite('Hello, *World!* :sunglasses:')\n
\n\n \n \n (view standalone Streamlit app)\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n \n (view standalone Streamlit app)\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n \n (view standalone Streamlit app)\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression, emoji shortcodes, and colored text.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": "False" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.16.0/lib/streamlit/elements/write.py#L47" + } + }, + "1.17.0": { + "streamlit.altair_chart": { + "name": "altair_chart", + "signature": "st.altair_chart(altair_chart, use_container_width=False, theme=\"streamlit\")", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(chart_data).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a chart using the Altair library.", + "args": [ + { + "name": "altair_chart", + "type_name": "altair.vegalite.v2.api.Chart", + "is_optional": false, + "description": "

The Altair chart object to display.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/dataframe_selector.py#L422" + }, + "streamlit.area_chart": { + "name": "area_chart", + "signature": "st.area_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/dataframe_selector.py#L247" + }, + "streamlit.audio": { + "name": "audio", + "signature": "st.audio(data, format=\"audio/wav\", start_time=0, *, sample_rate=None)", + "example": "
\n
\nimport streamlit as st\nimport numpy as np\n\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n\nsample_rate = 44100  # 44100 samples per second\nseconds = 2  # Note duration of 2 seconds\nfrequency_la = 440  # Our played note will be 440 Hz\n# Generate array with seconds*sample_rate steps, ranging between 0 and seconds\nt = np.linspace(0, seconds, seconds * sample_rate, False)\n# Generate a 440 Hz sine wave\nnote_la = np.sin(frequency_la * t * 2 * np.pi)\n\nst.audio(note_la, sample_rate=sample_rate)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an audio player.", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw audio data, filename, or a URL pointing to the file to load.\nRaw data formats must include all necessary file headers to match the file\nformat specified via format.\nIf data is a numpy array, it must either be a 1D array of the waveform\nor a 2D array of shape (num_channels, num_samples) with waveforms\nfor all channels. See the default channel order at\nhttp://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx

\n", + "default": "channel" + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + }, + { + "name": "sample_rate", + "type_name": "int or None", + "is_optional": false, + "description": "

The sample rate of the audio data in samples per second. Only required if\ndata is a numpy array.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/media.py#L43" + }, + "streamlit.balloons": { + "name": "balloons", + "signature": "st.balloons()", + "example": "
\n
\nimport streamlit as st\n\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", + "description": "Draw celebratory balloons.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/balloons.py#L25" + }, + "streamlit.bar_chart": { + "name": "bar_chart", + "signature": "st.bar_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/dataframe_selector.py#L334" + }, + "streamlit.beta_columns": { + "name": "beta_columns", + "signature": "st.beta_columns(spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put columns inside another column.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/layouts.py#L77" + }, + "streamlit.beta_container": { + "name": "beta_container", + "signature": "st.beta_container()", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/layouts.py#L29" + }, + "streamlit.beta_expander": { + "name": "beta_expander", + "signature": "st.beta_expander(label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/layouts.py#L301" + }, + "streamlit.bokeh_chart": { + "name": "bokeh_chart", + "signature": "st.bokeh_chart(figure, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", + "args": [ + { + "name": "figure", + "type_name": "bokeh.plotting.figure.Figure", + "is_optional": false, + "description": "

A Bokeh figure to plot.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Bokeh's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/bokeh_chart.py#L36" + }, + "streamlit.button": { + "name": "button", + "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False)", + "example": "
\n
\nimport streamlit as st\n\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a button widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, and Emojis.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/button.py#L61" + }, + "streamlit.cache": { + "name": "cache", + "signature": "st.cache(func=None, persist=False, allow_output_mutation=False, show_spinner=True, suppress_st_warning=False, hash_funcs=None, max_entries=None, ttl=None)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\n@st.cache(persist=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To disable hashing return values, set the allow_output_mutation parameter to True:

\n
\n@st.cache(allow_output_mutation=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. MongoClient) to a hash function (id) like this:

\n
\n@st.cache(hash_funcs={MongoClient: id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "pymongo.mongo_client.MongoClient") to the hash function instead:

\n
\n@st.cache(hash_funcs={"pymongo.mongo_client.MongoClient": id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n
\n", + "description": "Function decorator to memoize function executions.", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to cache. Streamlit hashes the function and dependent code.

\n", + "default": null + }, + { + "name": "persist", + "type_name": "boolean", + "is_optional": false, + "description": "

Whether to persist the cache on disk.

\n", + "default": null + }, + { + "name": "allow_output_mutation", + "type_name": "boolean", + "is_optional": false, + "description": "

Streamlit shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.

\n

If you know what you're doing and would like to override this warning, set this to True.

\n", + "default": null + }, + { + "name": "show_spinner", + "type_name": "boolean", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na cache miss.

\n", + "default": "True" + }, + { + "name": "suppress_st_warning", + "type_name": "boolean", + "is_optional": false, + "description": "

Suppress warnings about calling Streamlit commands from within\nthe cached function.

\n", + "default": null + }, + { + "name": "hash_funcs", + "type_name": "dict or None", + "is_optional": false, + "description": "

Mapping of types or fully qualified names to hash functions. This is used to override\nthe behavior of the hasher inside Streamlit's caching mechanism: when the hasher\nencounters an object, it will first check to see if its type matches a key in this\ndict and, if so, will use the provided function to generate a hash for it. See below\nfor an example of how this can be used.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None" + }, + { + "name": "ttl", + "type_name": "float or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/runtime/legacy_caching/caching.py#L401" + }, + "streamlit.camera_input": { + "name": "camera_input", + "signature": "st.camera_input(label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", + "description": "Display a widget that returns pictures from the user's webcam.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this widget is used for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the camera input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this camera_input's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile", + "is_generator": false, + "description": "

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/camera_input.py#L109" + }, + "streamlit.caption": { + "name": "caption", + "signature": "st.caption(body, unsafe_allow_html=False)", + "examples": "
\n
\nimport streamlit as st\n\nst.caption('This is a string that explains something above.')\nst.caption('A caption with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/markdown.py#L117" + }, + "streamlit.checkbox": { + "name": "checkbox", + "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a checkbox widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this checkbox is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n", + "default": null + }, + { + "name": "value", + "type_name": "bool", + "is_optional": false, + "description": "

Preselect the checkbox when it first renders. This will be\ncast to bool internally.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the checkbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this checkbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

Whether or not the checkbox is checked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/checkbox.py#L52" + }, + "streamlit.code": { + "name": "code", + "signature": "st.code(body, language=\"python\")", + "example": "
\n
\nimport streamlit as st\n\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", + "description": "

Display a code block with optional syntax highlighting.

\n

(This is a convenience wrapper around st.markdown())

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as code.

\n", + "default": null + }, + { + "name": "language", + "type_name": "str or None", + "is_optional": false, + "description": "

The language that the code is written in, for syntax highlighting.\nIf None, the code will be unstyled. Defaults to "python".

\n

For a list of available language values, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/markdown.py#L82" + }, + "streamlit.color_picker": { + "name": "color_picker", + "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a color picker widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "str", + "is_optional": false, + "description": "

The hex value of this widget when it first renders. If None,\ndefaults to black.

\n", + "default": "black" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the color picker.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this color_picker's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The selected color as a hex string.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/color_picker.py#L52" + }, + "streamlit.columns": { + "name": "columns", + "signature": "st.columns(spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put columns inside another column.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/layouts.py#L77" + }, + "streamlit.container": { + "name": "container", + "signature": "st.container()", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/layouts.py#L29" + }, + "streamlit.dataframe": { + "name": "dataframe", + "signature": "st.dataframe(data=None, width=None, height=None, *, use_container_width=False)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\nst.dataframe(df, 200, 100)\n
\n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a dataframe as an interactive table.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. (It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.)\nStyler support is experimental!\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the dataframe expressed in pixels. If None, the width\nwill be automatically calculated based on the column content.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the dataframe expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the dataframe width to the width of the parent container.\nThis takes precedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/dataframe_selector.py#L40" + }, + "streamlit.date_input": { + "name": "date_input", + "signature": "st.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nd = st.date_input(\n    "When\\'s your birthday",\n    datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a date input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this date input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", + "is_optional": false, + "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", + "default": "today" + }, + { + "name": "min_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", + "default": "value" + }, + { + "name": "max_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", + "default": "value" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this date_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.date or a tuple with 0-2 dates", + "is_generator": false, + "description": "

The current value of the date input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/time_widgets.py#L376" + }, + "streamlit.download_button": { + "name": "download_button", + "signature": "st.download_button(label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False)", + "examples": "
\n

Download a large DataFrame as a CSV:

\n
\nimport streamlit as st\n\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\nimport streamlit as st\n\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nimport streamlit as st\n\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nimport streamlit as st\n\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, and Emojis.

\n", + "default": null + }, + { + "name": "data", + "type_name": "str or bytes or file", + "is_optional": false, + "description": "

The contents of the file to be downloaded. See example below for\ncaching techniques to avoid recomputing this data unnecessarily.

\n", + "default": null + }, + { + "name": "file_name", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the name of the file to be downloaded,\nsuch as 'my_file.csv'. If not specified, the name will be\nautomatically generated.

\n", + "default": null + }, + { + "name": "mime", + "type_name": "str or None", + "is_optional": false, + "description": "

The MIME type of the data. If None, defaults to "text/plain"\n(if data is of type str or is a textual file) or\n"application/octet-stream" (if data is of type bytes or is a\nbinary file).

\n", + "default": "s" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/button.py#L147" + }, + "streamlit.echo": { + "name": "echo", + "signature": "st.echo(code_location=\"above\")", + "example": "
\n
\nimport streamlit as st\n\nwith st.echo():\n    st.write('This code will be printed')\n
\n
\n", + "description": "Use in a `with` block to draw some code on the app, then execute it.", + "args": [ + { + "name": "code_location", + "type_name": "\"above\" or \"below\"", + "is_optional": false, + "description": "

Whether to show the echoed code before or after the results of the\nexecuted code block.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/echo.py#L27" + }, + "streamlit.empty": { + "name": "empty", + "signature": "st.empty()", + "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport streamlit as st\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nimport streamlit as st\n\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", + "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/empty.py#L24" + }, + "streamlit.error": { + "name": "error", + "signature": "st.error(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", + "description": "Display error message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The error text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/alert.py#L39" + }, + "streamlit.exception": { + "name": "exception", + "signature": "st.exception(exception)", + "example": "
\n
\nimport streamlit as st\n\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", + "description": "Display an exception.", + "args": [ + { + "name": "exception", + "type_name": "Exception", + "is_optional": false, + "description": "

The exception to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/exception.py#L50" + }, + "streamlit.expander": { + "name": "expander", + "signature": "st.expander(label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/layouts.py#L301" + }, + "streamlit.experimental_get_query_params": { + "name": "experimental_get_query_params", + "signature": "st.experimental_get_query_params()", + "example": "
\n

Let's say the user's web browser is at\nhttp://localhost:8501/?show_map=True&selected=asia&selected=america.\nThen, you can get the query parameters using the following:

\n
\nimport streamlit as st\n\nst.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\n

Note that the values in the returned dict are always lists. This is\nbecause we internally use Python's urllib.parse.parse_qs(), which behaves\nthis way. And this behavior makes sense when you consider that every item\nin a query string is potentially a 1-element array.

\n
\n", + "description": "Return the query parameters that is currently showing in the browser's URL bar.", + "args": [], + "returns": [ + { + "type_name": "dict", + "is_generator": false, + "description": "

The current query parameters as a dict. "Query parameters" are the part of the URL that comes\nafter the first "?".

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/commands/query_params.py#L23" + }, + "streamlit.experimental_memo": { + "name": "experimental_memo", + "signature": "st.experimental_memo(func=None, *, persist=None, show_spinner=True, suppress_st_warning=False, max_entries=None, ttl=None, experimental_allow_widgets=False)", + "example": "
\n
\nimport streamlit as st\n\n@st.experimental_memo\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\nimport streamlit as st\n\n@st.experimental_memo(persist="disk")\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

By default, all parameters to a memoized function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.experimental_memo\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nconnection = make_database_connection()\nd1 = fetch_and_clean_data(connection, num_rows=10)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nanother_connection = make_database_connection()\nd2 = fetch_and_clean_data(another_connection, num_rows=10)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _database_connection parameter was different\n# in both calls.\n
\n

A memoized function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.experimental_memo\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nfetch_and_clean_data.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Function decorator to memoize function executions.

\n

Memoized data is stored in "pickled" form, which means that the return\nvalue of a memoized function must be pickleable.

\n

Each caller of a memoized function gets its own copy of the cached data.

\n

You can clear a memoized function's cache with f.clear().

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to memoize. Streamlit hashes the function's source code.

\n", + "default": null + }, + { + "name": "persist", + "type_name": "str or boolean or None", + "is_optional": false, + "description": "

Optional location to persist cached data to. Passing "disk" (or True)\nwill persist the cached data to the local disk. None (or False) will disable\npersistence. The default is None.

\n", + "default": "None" + }, + { + "name": "show_spinner", + "type_name": "boolean", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na cache miss.

\n", + "default": "True" + }, + { + "name": "suppress_st_warning", + "type_name": "boolean", + "is_optional": false, + "description": "

Suppress warnings about calling Streamlit commands from within\nthe cached function.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None" + }, + { + "name": "ttl", + "type_name": "float or timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.\nNote that ttl is incompatible with persist="disk" - ttl will be\nignored if persist is specified.

\n", + "default": "None" + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the memoized function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/runtime/caching/memo_decorator.py#L236" + }, + "streamlit.experimental_rerun": { + "name": "experimental_rerun", + "signature": "st.experimental_rerun()", + "description": "

Rerun the script immediately.

\n

When st.experimental_rerun() is called, the script is halted - no\nmore statements will be run, and the script will be queued to re-run\nfrom the top.

\n

If this function is called outside of Streamlit, it will raise an\nException.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/commands/execution_control.py#L46" + }, + "streamlit.experimental_set_query_params": { + "name": "experimental_set_query_params", + "signature": "st.experimental_set_query_params(**query_params)", + "example": "
\n

To point the user's web browser to something like\n"http://localhost:8501/?show_map=True&selected=asia&selected=america",\nyou would do the following:

\n
\nimport streamlit as st\n\nst.experimental_set_query_params(\n    show_map=True,\n    selected=["asia", "america"],\n)\n
\n
\n", + "description": "Set the query parameters that are shown in the browser's URL bar.", + "args": [ + { + "name": "**query_params", + "type_name": "dict", + "is_optional": false, + "description": "

The query parameters to set, as key-value pairs.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/commands/query_params.py#L56" + }, + "streamlit.experimental_show": { + "name": "experimental_show", + "signature": "st.experimental_show(*args)", + "notes": "
\n

This is an experimental feature with usage limitations:

\n
    \n
  • The method must be called with the name show.
  • \n
  • Must be called in one line of code, and only once per line.
  • \n
  • \n
    When passing multiple arguments the inclusion of , or ) in a string
    \n
    argument may cause an error.
    \n
    \n
  • \n
\n
\n", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndataframe = pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n})\nst.experimental_show(dataframe)\n
\n
\n", + "description": "

Write arguments and argument names to your app for debugging purposes.

\n

Show() has similar properties to write():

\n
\n
    \n
  1. You can pass in multiple arguments, all of which will be debugged.
  2. \n
  3. It returns None, so it's "slot" in the app cannot be reused.
  4. \n
\n
\n

Note: This is an experimental feature. See\nhttps://docs.streamlit.io/library/advanced-features/prerelease#experimental for more information.

\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to debug in the App.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/show.py#L23" + }, + "streamlit.experimental_singleton": { + "name": "experimental_singleton", + "signature": "st.experimental_singleton(func=None, *, show_spinner=True, suppress_st_warning=False, max_entries=None, ttl=None, validate=None, experimental_allow_widgets=False)", + "example": "
\n
\nimport streamlit as st\n\n@st.experimental_singleton\ndef get_database_session(url):\n    # Create a database session object that points to the URL.\n    return session\n\ns1 = get_database_session(SESSION_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(SESSION_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the connection object in s1 is the same as in s2.\n\ns3 = get_database_session(SESSION_URL_2)\n# This is a different URL, so the function executes.\n
\n

By default, all parameters to a singleton function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.experimental_singleton\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\ns1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _sessionmaker parameter was different\n# in both calls.\n
\n

A singleton function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.experimental_singleton\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\nget_database_session.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Function decorator to store singleton objects.

\n

Each singleton object is shared across all users connected to the app.\nSingleton objects must be thread-safe, because they can be accessed from\nmultiple threads concurrently.

\n

(If thread-safety is an issue, consider using st.session_state to\nstore per-session singleton objects instead.)

\n

You can clear a memoized function's cache with f.clear().

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function that creates the singleton. Streamlit hashes the\nfunction's source code.

\n", + "default": null + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the singleton is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "suppress_st_warning", + "type_name": "boolean", + "is_optional": false, + "description": "

Suppress warnings about calling Streamlit commands from within\nthe singleton function.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None" + }, + { + "name": "ttl", + "type_name": "float or timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.

\n", + "default": "None" + }, + { + "name": "validate", + "type_name": "callable or None", + "is_optional": false, + "description": "

An optional validation function for cached data. validate is\ncalled each time the cached value is accessed. It receives\nthe cached value as its only param; and it returns a bool result.\nIf validate returns False, the current cached value is discarded,\nand the decorated function is called to compute a new value.

\n", + "default": null + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the singleton function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/runtime/caching/singleton_decorator.py#L220" + }, + "streamlit.file_uploader": { + "name": "file_uploader", + "signature": "st.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nimport streamlit as st\nimport pandas as pd\nfrom io import StringIO\n\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nimport streamlit as st\n\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this file uploader is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str or list of str or None", + "is_optional": false, + "description": "

Array of allowed extensions. ['png', 'jpg']\nThe default is None, which means all extensions are allowed.

\n", + "default": "None" + }, + { + "name": "accept_multiple_files", + "type_name": "bool", + "is_optional": false, + "description": "

If True, allows the user to upload multiple files at the same time,\nin which case the return value will be a list of files.\nDefault: False

\n", + "default": "False" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the file uploader.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this file_uploader's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the file uploader if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile or list of UploadedFile", + "is_generator": false, + "description": "
    \n
  • If accept_multiple_files is False, returns either None or\nan UploadedFile object.
  • \n
  • If accept_multiple_files is True, returns a list with the\nuploaded files as UploadedFile objects. If no files were\nuploaded, returns an empty list.
  • \n
\n

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/file_uploader.py#L205" + }, + "streamlit.form": { + "name": "form", + "signature": "st.form(key, clear_on_submit=False)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n

Inserting elements out of order:

\n
\nimport streamlit as st\n\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n
\n", + "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

A string that identifies the form. Each form must have its own\nkey. (This key is not displayed to the user in the interface.)

\n", + "default": null + }, + { + "name": "clear_on_submit", + "type_name": "bool", + "is_optional": false, + "description": "

If True, all widgets inside the form will be reset to their default\nvalues after the user presses the Submit button. Defaults to False.\n(Note that Custom Components are unaffected by this flag, and\nwill not be reset to their defaults on form submission.)

\n", + "default": "values" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/form.py#L116" + }, + "streamlit.form_submit_button": { + "name": "form_submit_button", + "signature": "st.form_submit_button(label=\"Submit\", help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False)", + "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nDefaults to "Submit".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

A tooltip that gets displayed when the button is hovered over.\nDefaults to None.

\n", + "default": "None" + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/form.py#L209" + }, + "streamlit.get_option": { + "name": "get_option", + "signature": "st.get_option(key)", + "description": "

Return the current value of a given Streamlit config option.

\n

Run streamlit config show in the terminal to see all available options.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

The config option key of the form "section.optionName". To see all\navailable options, run streamlit config show on a terminal.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/config.py#L128" + }, + "streamlit.graphviz_chart": { + "name": "graphviz_chart", + "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nimport graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a graph using the dagre-d3 library.", + "args": [ + { + "name": "figure_or_dot", + "type_name": "graphviz.dot.Graph, graphviz.dot.Digraph, str", + "is_optional": false, + "description": "

The Graphlib graph object or dot string to display

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/graphviz_chart.py#L39" + }, + "streamlit.header": { + "name": "header", + "signature": "st.header(body, anchor=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.header('This is a header')\nst.header('A header with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "Display text in header formatting.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/heading.py#L27" + }, + "streamlit.help": { + "name": "help", + "signature": "st.help(obj)", + "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nimport streamlit as st\nimport pandas\n\nst.help(pandas.DataFrame)\n
\n

Want to quickly check what datatype is output by a certain function?\nTry:

\n
\nimport streamlit as st\n\nx = my_poorly_documented_function()\nst.help(x)\n
\n
\n", + "description": "

Display object's doc string, nicely formatted.

\n

Displays the doc string for this object.

\n", + "args": [ + { + "name": "obj", + "type_name": "Object", + "is_optional": false, + "description": "

The object whose docstring should be displayed.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/doc_string.py#L44" + }, + "streamlit.image": { + "name": "image", + "signature": "st.image(image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", + "example": "
\n
\nimport streamlit as st\nfrom PIL import Image\n\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an image or list of images.", + "args": [ + { + "name": "image", + "type_name": "numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]", + "is_optional": false, + "description": "

Monochrome image of shape (w,h) or (w,h,1)\nOR a color image of shape (w,h,3)\nOR an RGBA image of shape (w,h,4)\nOR a URL to fetch the image from\nOR a path of a local image file\nOR an SVG XML string like <svg xmlns=...</svg>\nOR a list of one of the above, to display multiple images.

\n", + "default": null + }, + { + "name": "caption", + "type_name": "str or list of str", + "is_optional": false, + "description": "

Image caption. If displaying multiple images, caption should be a\nlist of captions (one for each image).

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Image width. None means use the image width,\nbut do not exceed the width of the column.\nShould be set for SVG images, as they have no default image width.

\n", + "default": "image" + }, + { + "name": "use_column_width", + "type_name": "'auto' or 'always' or 'never' or bool", + "is_optional": false, + "description": "

If 'auto', set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf 'always' or True, set the image's width to the column width.\nIf 'never' or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", + "default": null + }, + { + "name": "clamp", + "type_name": "bool", + "is_optional": false, + "description": "

Clamp image pixel values to a valid range ([0-255] per channel).\nThis is only meaningful for byte array images; the parameter is\nignored for image URLs. If this is not set, and an image has an\nout-of-range value, an error will be thrown.

\n", + "default": null + }, + { + "name": "channels", + "type_name": "'RGB' or 'BGR'", + "is_optional": false, + "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to 'RGB', meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to 'BGR', instead.

\n", + "default": "s" + }, + { + "name": "output_format", + "type_name": "'JPEG', 'PNG', or 'auto'", + "is_optional": false, + "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to 'auto' which identifies the compression type based\non the type and format of the image argument.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/image.py#L67" + }, + "streamlit.info": { + "name": "info", + "signature": "st.info(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", + "description": "Display an informational message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The info text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/alert.py#L103" + }, + "streamlit.json": { + "name": "json", + "signature": "st.json(body, *, expanded=True)", + "example": "
\n
\nimport streamlit as st\n\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display object or string as a pretty-printed JSON string.", + "args": [ + { + "name": "body", + "type_name": "object or str", + "is_optional": false, + "description": "

The object to print as JSON. All referenced objects should be\nserializable to JSON as well. If object is a string, we assume it\ncontains serialized JSON.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean that allows the user to set whether the initial\nstate of this json element should be expanded. Defaults to True.\nThis argument can only be supplied by keyword.

\n", + "default": "True" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/json.py#L35" + }, + "streamlit.latex": { + "name": "latex", + "signature": "st.latex(body)", + "example": "
\n
\nimport streamlit as st\n\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", + "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", + "args": [ + { + "name": "body", + "type_name": "str or SymPy expression", + "is_optional": false, + "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/markdown.py#L171" + }, + "streamlit.line_chart": { + "name": "line_chart", + "signature": "st.line_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\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 \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict or None", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/dataframe_selector.py#L160" + }, + "streamlit.map": { + "name": "map", + "signature": "st.map(data=None, zoom=None, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a map with points on it.

\n

This is a wrapper around st.pydeck_chart to quickly create scatterplot\ncharts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more\ninfo on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to be plotted. Must have two columns:

\n
    \n
  • latitude called 'lat', 'latitude', 'LAT', 'LATITUDE'
  • \n
  • longitude called 'lon', 'longitude', 'LON', 'LONGITUDE'.
  • \n
\n", + "default": null + }, + { + "name": "zoom", + "type_name": "int", + "is_optional": false, + "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/map.py#L76" + }, + "streamlit.markdown": { + "name": "markdown", + "signature": "st.markdown(body, unsafe_allow_html=False)", + "examples": "
\n
\nimport streamlit as st\n\nst.markdown('Streamlit is **_really_ cool**.')\nst.markdown(\u201dThis text is :red[colored red], and this is **:blue[colored]** and bold.\u201d)\nst.markdown(":green[$\\sqrt{x^2+y^2}=1$] is a Pythagorean identity. :pencil:")\n
\n
\n", + "description": "Display string formatted as Markdown.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/markdown.py#L29" + }, + "streamlit.metric": { + "name": "metric", + "signature": "st.metric(label, value, delta=None, delta_color=\"normal\", help=None, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n \n (view standalone Streamlit app)\n \n

st.metric looks especially nice in combination with st.columns:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n \n (view standalone Streamlit app)\n \n

The delta indicator color can also be inverted or turned off:

\n
\nimport streamlit as st\n\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

The header or title for the metric. The label can optionally contain\nMarkdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "value", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Value of the metric. None is rendered as a long dash.

\n", + "default": null + }, + { + "name": "delta", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Indicator of how the metric changed, rendered with an arrow below\nthe metric. If delta is negative (int/float) or starts with a minus\nsign (str), the arrow points down and the text is red; else the\narrow points up and the text is green. If None (default), no delta\nindicator is shown.

\n", + "default": null + }, + { + "name": "delta_color", + "type_name": "str", + "is_optional": false, + "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the metric label.

\n", + "default": null + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/metric.py#L46" + }, + "streamlit.multiselect": { + "name": "multiselect", + "signature": "st.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", max_selections=None)", + "example": "
\n
\nimport streamlit as st\n\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence[V], numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null + }, + { + "name": "default", + "type_name": "[V], V, or None", + "is_optional": false, + "description": "

List of default values. Can also be a single value.

\n", + "default": "values" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of selectbox options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe multiselect.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the multiselect.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this multiselect's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the multiselect widget if set\nto True. The default is False. This argument can only be supplied\nby keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "max_selections", + "type_name": "int", + "is_optional": false, + "description": "

The max selections that can be selected at a time.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list", + "is_generator": false, + "description": "

A list with the selected options

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/multiselect.py#L145" + }, + "streamlit.number_input": { + "name": "number_input", + "signature": "st.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a numeric input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. Output must be purely numeric. This does not impact\nthe return value. Valid formatters: %d %e %f %g %i %u

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this number_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the number input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int or float", + "is_generator": false, + "description": "

The current value of the numeric input widget. The return type\nwill match the data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/number_input.py#L66" + }, + "streamlit.plotly_chart": { + "name": "plotly_chart", + "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", theme=\"streamlit\", **kwargs)", + "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport numpy as np\nimport plotly.figure_factory as ff\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n        hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", + "args": [ + { + "name": "figure_or_data", + "type_name": "plotly.graph_objs.Figure, plotly.graph_objs.Data,", + "is_optional": false, + "description": "

dict/list of plotly.graph_objs.Figure/Data

\n

See https://plot.ly/python/ for examples of graph descriptions.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + }, + { + "name": "sharing", + "type_name": "{'streamlit', 'private', 'secret', 'public'}", + "is_optional": false, + "description": "

Use 'streamlit' to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": null, + "is_optional": null, + "description": "

Any argument accepted by Plotly's plot() function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/plotly_chart.py#L81" + }, + "streamlit.progress": { + "name": "progress", + "signature": "st.progress(value)", + "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport streamlit as st\nimport time\n\nmy_bar = st.progress(0)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1)\n
\n
\n", + "description": "Display a progress bar.", + "args": [ + { + "name": "value", + "type_name": "int or float", + "is_optional": false, + "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/progress.py#L32" + }, + "streamlit.pydeck_chart": { + "name": "pydeck_chart", + "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)", + "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport pydeck as pdk\n\nchart_data = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=chart_data,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=chart_data,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", + "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "pydeck_obj", + "type_name": "pydeck.Deck or None", + "is_optional": false, + "description": "

Object specifying the PyDeck chart to draw.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/deck_gl_json_chart.py#L36" + }, + "streamlit.pyplot": { + "name": "pyplot", + "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)", + "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", + "example": "
\n
\nimport streamlit as st\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a matplotlib.pyplot figure.", + "args": [ + { + "name": "fig", + "type_name": "Matplotlib Figure", + "is_optional": false, + "description": "

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

\n", + "default": null + }, + { + "name": "clear_figure", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", + "default": "based" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Arguments to pass to Matplotlib's savefig function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/pyplot.py#L38" + }, + "streamlit.radio": { + "name": "radio", + "signature": "st.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ngenre = st.radio(\n    "What\\'s your favorite movie genre",\n    ('Comedy', 'Drama', 'Documentary'))\n\nif genre == 'Comedy':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn\\'t select comedy.")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a radio button widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this radio group is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the radio options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of radio options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe radio.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the radio.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this radio's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the radio button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "horizontal", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", + "default": "false" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/radio.py#L75" + }, + "streamlit.select_slider": { + "name": "select_slider", + "signature": "st.select_slider(label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\nimport streamlit as st\n\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nimport streamlit as st\n\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n \n (view standalone Streamlit app)\n \n ", + "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the slider options. All options will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", + "default": null + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to first option.

\n", + "default": "first" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels from the options.\nargument. It receives the option as an argument and its output\nwill be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the select slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this select_slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the select slider if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any value or tuple of any value", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/select_slider.py#L106" + }, + "streamlit.selectbox": { + "name": "selectbox", + "signature": "st.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a select widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels. It receives the option\nas an argument and its output will be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the selectbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this selectbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the selectbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/selectbox.py#L71" + }, + "streamlit.set_option": { + "name": "set_option", + "signature": "st.set_option(key, value)", + "description": "

Set config option.

\n
\n
Currently, only the following config options can be set within the script itself:
\n
    \n
  • client.caching
  • \n
  • client.displayEnabled
  • \n
  • deprecation.*
  • \n
\n
\n
\n

Calling with any other options will raise StreamlitAPIException.

\n

Run streamlit config show in the terminal to see all available options.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

The config option key of the form "section.optionName". To see all\navailable options, run streamlit config show on a terminal.

\n", + "default": null + }, + { + "name": "value", + "type_name": null, + "is_optional": null, + "description": "

The new value to assign to this config option.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/config.py#L89" + }, + "streamlit.set_page_config": { + "name": "set_page_config", + "signature": "st.set_page_config(page_title=None, page_icon=None, layout=\"centered\", initial_sidebar_state=\"auto\", menu_items=None)", + "example": "
\nimport streamlit as st\n\nst.set_page_config(\n    page_title="Ex-stream-ly Cool App",\n    page_icon="\ud83e\uddca",\n    layout="wide",\n    initial_sidebar_state="expanded",\n    menu_items={\n        'Get Help': 'https://www.extremelycoolapp.com/help',\n        'Report a bug': "https://www.extremelycoolapp.com/bug",\n        'About': "# This is a header. This is an *extremely* cool app!"\n    }\n)\n
\n", + "description": "

Configures the default settings of the page.

\n
\n

Note

\n

This must be the first Streamlit command used in your app, and must only\nbe set once.

\n
\n", + "args": [ + { + "name": "page_title", + "type_name": "str or None", + "is_optional": false, + "description": "

The page title, shown in the browser tab. If None, defaults to the\nfilename of the script ("app.py" would show "app \u2022 Streamlit").

\n", + "default": "the" + }, + { + "name": "page_icon", + "type_name": "Anything supported by st.image or str or None", + "is_optional": false, + "description": "

The page favicon.\nBesides the types supported by st.image (like URLs or numpy arrays),\nyou can pass in an emoji as a string ("\ud83e\udd88") or a shortcode (":shark:").\nIf you're feeling lucky, try "random" for a random emoji!\nEmoji icons are courtesy of Twemoji and loaded from MaxCDN.

\n", + "default": null + }, + { + "name": "layout", + "type_name": "\"centered\" or \"wide\"", + "is_optional": false, + "description": "

How the page content should be laid out. Defaults to "centered",\nwhich constrains the elements into a centered column of fixed width;\n"wide" uses the entire screen.

\n", + "default": "s" + }, + { + "name": "initial_sidebar_state", + "type_name": "\"auto\" or \"expanded\" or \"collapsed\"", + "is_optional": false, + "description": "

How the sidebar should start out. Defaults to "auto",\nwhich hides the sidebar on mobile-sized devices, and shows it otherwise.\n"expanded" shows the sidebar initially; "collapsed" hides it.

\n", + "default": "s" + }, + { + "name": "menu_items", + "type_name": "dict", + "is_optional": false, + "description": "

Configure the menu that appears on the top-right side of this app.\nThe keys in this dict denote the menu item you'd like to configure:

\n
    \n
  • \n
    "Get help": str or None
    \n
    The URL this menu item should point to.\nIf None, hides this menu item.
    \n
    \n
  • \n
  • \n
    "Report a Bug": str or None
    \n
    The URL this menu item should point to.\nIf None, hides this menu item.
    \n
    \n
  • \n
  • \n
    "About": str or None
    \n
    A markdown string to show in the About dialog.\nIf None, only shows Streamlit's default About text.
    \n
    \n
  • \n
\n

The URL may also refer to an email address e.g. mailto:john@example.com.

\n", + "default": "About" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/commands/page_config.py#L114" + }, + "streamlit.slider": { + "name": "slider", + "signature": "st.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nimport streamlit as st\n\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nimport streamlit as st\nfrom datetime import time\n\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nimport streamlit as st\nfrom datetime import datetime\n\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The minimum permitted value.\nDefaults to 0 if the value is an int, 0.0 if a float,\nvalue - timedelta(days=14) if a date/datetime, time.min if a time

\n", + "default": "0" + }, + { + "name": "max_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The maximum permitted value.\nDefaults to 100 if the value is an int, 1.0 if a float,\nvalue + timedelta(days=14) if a date/datetime, time.max if a time

\n", + "default": "100" + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to min_value.

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int/float/timedelta or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. This does not impact the return value.\nFormatter for int/float supports: %d %e %f %g %i\nFormatter for date/time/datetime uses Moment.js notation:\nhttps://momentjs.com/docs/#/displaying/format/

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the slider if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int/float/date/time/datetime or tuple of int/float/date/time/datetime", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/slider.py#L171" + }, + "streamlit.snow": { + "name": "snow", + "signature": "st.snow()", + "example": "
\n
\nimport streamlit as st\n\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", + "description": "Draw celebratory snowfall.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/snow.py#L25" + }, + "streamlit.spinner": { + "name": "spinner", + "signature": "st.spinner(text=\"In progress...\")", + "example": "
\n
\nimport time\nimport streamlit as st\n\nwith st.spinner('Wait for it...'):\n    time.sleep(5)\nst.success('Done!')\n
\n
\n", + "description": "Temporarily displays a message while executing a block of code.", + "args": [ + { + "name": "text", + "type_name": "str", + "is_optional": false, + "description": "

A message to display while executing that block

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/spinner.py#L23" + }, + "streamlit.stop": { + "name": "stop", + "signature": "st.stop()", + "example": "
\n
\nimport streamlit as st\n\nname = st.text_input('Name')\nif not name:\n  st.warning('Please input a name.')\n  st.stop()\nst.success('Thank you for inputting a name.')\n
\n
\n", + "description": "

Stops execution immediately.

\n

Streamlit will not run any statements after st.stop().\nWe recommend rendering a message to explain why the script has stopped.\nWhen run outside of Streamlit, this will raise an Exception.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/commands/execution_control.py#L25" + }, + "streamlit.subheader": { + "name": "subheader", + "signature": "st.subheader(body, anchor=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.subheader('This is a subheader')\nst.subheader('A subheader with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "Display text in subheader formatting.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/heading.py#L72" + }, + "streamlit.success": { + "name": "success", + "signature": "st.success(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", + "description": "Display a success message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The success text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/alert.py#L136" + }, + "streamlit.table": { + "name": "table", + "signature": "st.table(data=None)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/dataframe_selector.py#L122" + }, + "streamlit.tabs": { + "name": "tabs", + "signature": "st.tabs(tabs)", + "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\nimport streamlit as st\n\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", + "args": [ + { + "name": "tabs", + "type_name": "list of strings", + "is_optional": false, + "description": "

Creates a tab for each string in the list. The first tab is selected by default.\nThe string is used as the name of the tab and can optionally contain Markdown,\nsupporting the following elements: Bold, Italics, Strikethroughs, Inline Code,\nEmojis, and Links.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/layouts.py#L206" + }, + "streamlit.text": { + "name": "text", + "signature": "st.text(body)", + "example": "
\n
\nimport streamlit as st\n\nst.text('This is some text.')\n
\n
\n", + "description": "Write fixed-width and preformatted text.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/text.py#L27" + }, + "streamlit.text_area": { + "name": "text_area", + "signature": "st.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", + "description": "Display a multi-line text input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Maximum number of characters allowed in text area.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the textarea.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_area's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text area is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text area if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/text_widgets.py#L268" + }, + "streamlit.text_input": { + "name": "text_input", + "signature": "st.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a single-line text input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Max number of characters allowed in text input.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str", + "is_optional": false, + "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "autocomplete", + "type_name": "str", + "is_optional": false, + "description": "

An optional value that will be passed to the <input> element's\nautocomplete property. If unspecified, this value will be set to\n"new-password" for "password" inputs, and the empty string for\n"default" inputs. For more details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text input is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/text_widgets.py#L69" + }, + "streamlit.time_input": { + "name": "time_input", + "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a time input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this time input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.time/datetime.datetime", + "is_optional": false, + "description": "

The value of this widget when it first renders. This will be\ncast to str internally. Defaults to the current time.

\n", + "default": "the" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this time_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the time input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.time", + "is_generator": false, + "description": "

The current value of the time input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/time_widgets.py#L212" + }, + "streamlit.title": { + "name": "title", + "signature": "st.title(body, anchor=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.title('This is a title')\nst.title('A title with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/heading.py#L118" + }, + "streamlit.vega_lite_chart": { + "name": "vega_lite_chart", + "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, theme=\"streamlit\", **kwargs)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(chart_data, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", + "description": "Display a chart using the Vega-Lite library.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "spec", + "type_name": "dict or None", + "is_optional": false, + "description": "

The Vega-Lite spec for the chart. If the spec was already passed in\nthe previous argument, this must be set to None. See\nhttps://vega.github.io/vega-lite/docs/ for more info.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Same as spec, but as keywords.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/dataframe_selector.py#L475" + }, + "streamlit.video": { + "name": "video", + "signature": "st.video(data, format=\"video/mp4\", start_time=0)", + "example": "
\n
\nimport streamlit as st\n\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", + "description": "Display a video player.", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "default": null + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the video file. Defaults to 'video/mp4'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/media.py#L117" + }, + "streamlit.warning": { + "name": "warning", + "signature": "st.warning(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", + "description": "Display warning message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The warning text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/alert.py#L71" + }, + "streamlit.write": { + "name": "write", + "signature": "st.write(*args, unsafe_allow_html=False, **kwargs)", + "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nimport streamlit as st\n\nst.write('Hello, *World!* :sunglasses:')\n
\n\n \n \n (view standalone Streamlit app)\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nimport streamlit as st\nimport pandas as pd\n\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n \n (view standalone Streamlit app)\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nimport streamlit as st\n\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n \n (view standalone Streamlit app)\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression, emoji shortcodes, and colored text.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": "False" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/write.py#L47" + }, + "streamlit.experimental_memo.clear": { + "name": "experimental_memo.clear", + "signature": "st.experimental_memo.clear()", + "description": "Clear all in-memory and on-disk memo caches.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/runtime/caching/memo_decorator.py#L410" + }, + "streamlit.experimental_singleton.clear": { + "name": "experimental_singleton.clear", + "signature": "st.experimental_singleton.clear()", + "description": "Clear all singleton caches.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/runtime/caching/singleton_decorator.py#L361" + }, + "streamlit.components.v1.declare_component": { + "name": "declare_component", + "signature": "st.components.v1.declare_component(name, path=None, url=None)", + "description": "Create and register a custom component.", + "args": [ + { + "name": "name", + "type_name": "str", + "is_optional": false, + "description": "

A short, descriptive name for the component. Like, "slider".

\n", + "default": null + }, + { + "name": "path", + "type_name": "str or None", + "is_optional": false, + "description": "

The path to serve the component's frontend files from. Either\npath or url must be specified, but not both.

\n", + "default": null + }, + { + "name": "url", + "type_name": "str or None", + "is_optional": false, + "description": "

The URL that the component is served from. Either path or url\nmust be specified, but not both.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "CustomComponent", + "is_generator": false, + "description": "

A CustomComponent that can be called like a function.\nCalling the component will create a new instance of the component\nin the Streamlit app.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/components/v1/components.py#L246" + }, + "streamlit.components.v1.html": { + "name": "html", + "signature": "st.components.v1.html(html, width=None, height=None, scrolling=False)", + "description": "Display an HTML string in an iframe.", + "args": [ + { + "name": "html", + "type_name": "str", + "is_optional": false, + "description": "

The HTML string to embed in the iframe.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", + "default": "the" + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", + "default": "150" + }, + { + "name": "scrolling", + "type_name": "bool", + "is_optional": false, + "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", + "default": "False" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/iframe.py#L59" + }, + "streamlit.components.v1.iframe": { + "name": "iframe", + "signature": "st.components.v1.iframe(src, width=None, height=None, scrolling=False)", + "description": "Load a remote URL in an iframe.", + "args": [ + { + "name": "src", + "type_name": "str", + "is_optional": false, + "description": "

The URL of the page to embed.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", + "default": "the" + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", + "default": "150" + }, + { + "name": "scrolling", + "type_name": "bool", + "is_optional": false, + "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", + "default": "False" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/iframe.py#L25" + }, + "DeltaGenerator.add_rows": { + "name": "add_rows", + "signature": "element.add_rows(self, data=None, **kwargs)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf1 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table = st.table(df1)\n\ndf2 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table.add_rows(df2)\n# Now the table shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

You can do the same thing with plots. For example, if you want to add\nmore data to a line chart:

\n
\n# Assuming df1 and df2 from the example above still exist...\nmy_chart = st.line_chart(df1)\nmy_chart.add_rows(df2)\n# Now the chart shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

And for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:

\n
\nmy_chart = st.vega_lite_chart({\n    'mark': 'line',\n    'encoding': {'x': 'a', 'y': 'b'},\n    'datasets': {\n      'some_fancy_name': df1,  # <-- named dataset\n     },\n    'data': {'name': 'some_fancy_name'},\n}),\nmy_chart.add_rows(some_fancy_name=df2)  # <-- name used as keyword\n
\n
\n", + "description": "Concatenate a dataframe to the bottom of the current one.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, Iterable, dict, or None", + "is_optional": false, + "description": "

Table to concat. Optional.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "**kwargs", + "type_name": "pandas.DataFrame, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

The named dataset to concat. Optional. You can only pass in 1\ndataset (including the one in the data parameter).

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/dataframe_selector.py#L550" + }, + "DeltaGenerator.altair_chart": { + "name": "altair_chart", + "signature": "element.altair_chart(self, altair_chart, use_container_width=False, theme=\"streamlit\")", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(chart_data).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a chart using the Altair library.", + "args": [ + { + "name": "altair_chart", + "type_name": "altair.vegalite.v2.api.Chart", + "is_optional": false, + "description": "

The Altair chart object to display.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/dataframe_selector.py#L422" + }, + "DeltaGenerator.area_chart": { + "name": "area_chart", + "signature": "element.area_chart(self, data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/dataframe_selector.py#L247" + }, + "DeltaGenerator.audio": { + "name": "audio", + "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0, *, sample_rate=None)", + "example": "
\n
\nimport streamlit as st\nimport numpy as np\n\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n\nsample_rate = 44100  # 44100 samples per second\nseconds = 2  # Note duration of 2 seconds\nfrequency_la = 440  # Our played note will be 440 Hz\n# Generate array with seconds*sample_rate steps, ranging between 0 and seconds\nt = np.linspace(0, seconds, seconds * sample_rate, False)\n# Generate a 440 Hz sine wave\nnote_la = np.sin(frequency_la * t * 2 * np.pi)\n\nst.audio(note_la, sample_rate=sample_rate)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an audio player.", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw audio data, filename, or a URL pointing to the file to load.\nRaw data formats must include all necessary file headers to match the file\nformat specified via format.\nIf data is a numpy array, it must either be a 1D array of the waveform\nor a 2D array of shape (num_channels, num_samples) with waveforms\nfor all channels. See the default channel order at\nhttp://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx

\n", + "default": "channel" + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + }, + { + "name": "sample_rate", + "type_name": "int or None", + "is_optional": false, + "description": "

The sample rate of the audio data in samples per second. Only required if\ndata is a numpy array.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/media.py#L43" + }, + "DeltaGenerator.balloons": { + "name": "balloons", + "signature": "element.balloons(self)", + "example": "
\n
\nimport streamlit as st\n\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", + "description": "Draw celebratory balloons.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/balloons.py#L25" + }, + "DeltaGenerator.bar_chart": { + "name": "bar_chart", + "signature": "element.bar_chart(self, data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/dataframe_selector.py#L334" + }, + "DeltaGenerator.beta_columns": { + "name": "beta_columns", + "signature": "element.beta_columns(self, spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put columns inside another column.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/layouts.py#L77" + }, + "DeltaGenerator.beta_container": { + "name": "beta_container", + "signature": "element.beta_container(self)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/layouts.py#L29" + }, + "DeltaGenerator.beta_expander": { + "name": "beta_expander", + "signature": "element.beta_expander(self, label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/layouts.py#L301" + }, + "DeltaGenerator.bokeh_chart": { + "name": "bokeh_chart", + "signature": "element.bokeh_chart(self, figure, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", + "args": [ + { + "name": "figure", + "type_name": "bokeh.plotting.figure.Figure", + "is_optional": false, + "description": "

A Bokeh figure to plot.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Bokeh's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/bokeh_chart.py#L36" + }, + "DeltaGenerator.button": { + "name": "button", + "signature": "element.button(self, label, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False)", + "example": "
\n
\nimport streamlit as st\n\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a button widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, and Emojis.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/button.py#L61" + }, + "DeltaGenerator.camera_input": { + "name": "camera_input", + "signature": "element.camera_input(self, label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", + "description": "Display a widget that returns pictures from the user's webcam.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this widget is used for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the camera input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this camera_input's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile", + "is_generator": false, + "description": "

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/camera_input.py#L109" + }, + "DeltaGenerator.caption": { + "name": "caption", + "signature": "element.caption(self, body, unsafe_allow_html=False)", + "examples": "
\n
\nimport streamlit as st\n\nst.caption('This is a string that explains something above.')\nst.caption('A caption with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/markdown.py#L117" + }, + "DeltaGenerator.checkbox": { + "name": "checkbox", + "signature": "element.checkbox(self, label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a checkbox widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this checkbox is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n", + "default": null + }, + { + "name": "value", + "type_name": "bool", + "is_optional": false, + "description": "

Preselect the checkbox when it first renders. This will be\ncast to bool internally.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the checkbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this checkbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

Whether or not the checkbox is checked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/checkbox.py#L52" + }, + "DeltaGenerator.code": { + "name": "code", + "signature": "element.code(self, body, language=\"python\")", + "example": "
\n
\nimport streamlit as st\n\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", + "description": "

Display a code block with optional syntax highlighting.

\n

(This is a convenience wrapper around st.markdown())

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as code.

\n", + "default": null + }, + { + "name": "language", + "type_name": "str or None", + "is_optional": false, + "description": "

The language that the code is written in, for syntax highlighting.\nIf None, the code will be unstyled. Defaults to "python".

\n

For a list of available language values, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/markdown.py#L82" + }, + "DeltaGenerator.color_picker": { + "name": "color_picker", + "signature": "element.color_picker(self, label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a color picker widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "str", + "is_optional": false, + "description": "

The hex value of this widget when it first renders. If None,\ndefaults to black.

\n", + "default": "black" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the color picker.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this color_picker's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The selected color as a hex string.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/color_picker.py#L52" + }, + "DeltaGenerator.columns": { + "name": "columns", + "signature": "element.columns(self, spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put columns inside another column.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/layouts.py#L77" + }, + "DeltaGenerator.container": { + "name": "container", + "signature": "element.container(self)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/layouts.py#L29" + }, + "DeltaGenerator.dataframe": { + "name": "dataframe", + "signature": "element.dataframe(self, data=None, width=None, height=None, *, use_container_width=False)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\nst.dataframe(df, 200, 100)\n
\n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a dataframe as an interactive table.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. (It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.)\nStyler support is experimental!\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the dataframe expressed in pixels. If None, the width\nwill be automatically calculated based on the column content.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the dataframe expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the dataframe width to the width of the parent container.\nThis takes precedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/dataframe_selector.py#L40" + }, + "DeltaGenerator.date_input": { + "name": "date_input", + "signature": "element.date_input(self, label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nd = st.date_input(\n    "When\\'s your birthday",\n    datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a date input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this date input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", + "is_optional": false, + "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", + "default": "today" + }, + { + "name": "min_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", + "default": "value" + }, + { + "name": "max_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", + "default": "value" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this date_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.date or a tuple with 0-2 dates", + "is_generator": false, + "description": "

The current value of the date input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/time_widgets.py#L376" + }, + "DeltaGenerator.download_button": { + "name": "download_button", + "signature": "element.download_button(self, label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False)", + "examples": "
\n

Download a large DataFrame as a CSV:

\n
\nimport streamlit as st\n\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\nimport streamlit as st\n\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nimport streamlit as st\n\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nimport streamlit as st\n\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, and Emojis.

\n", + "default": null + }, + { + "name": "data", + "type_name": "str or bytes or file", + "is_optional": false, + "description": "

The contents of the file to be downloaded. See example below for\ncaching techniques to avoid recomputing this data unnecessarily.

\n", + "default": null + }, + { + "name": "file_name", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the name of the file to be downloaded,\nsuch as 'my_file.csv'. If not specified, the name will be\nautomatically generated.

\n", + "default": null + }, + { + "name": "mime", + "type_name": "str or None", + "is_optional": false, + "description": "

The MIME type of the data. If None, defaults to "text/plain"\n(if data is of type str or is a textual file) or\n"application/octet-stream" (if data is of type bytes or is a\nbinary file).

\n", + "default": "s" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/button.py#L147" + }, + "DeltaGenerator.empty": { + "name": "empty", + "signature": "element.empty(self)", + "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport streamlit as st\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nimport streamlit as st\n\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", + "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/empty.py#L24" + }, + "DeltaGenerator.error": { + "name": "error", + "signature": "element.error(self, body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", + "description": "Display error message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The error text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/alert.py#L39" + }, + "DeltaGenerator.exception": { + "name": "exception", + "signature": "element.exception(self, exception)", + "example": "
\n
\nimport streamlit as st\n\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", + "description": "Display an exception.", + "args": [ + { + "name": "exception", + "type_name": "Exception", + "is_optional": false, + "description": "

The exception to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/exception.py#L50" + }, + "DeltaGenerator.expander": { + "name": "expander", + "signature": "element.expander(self, label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/layouts.py#L301" + }, + "DeltaGenerator.file_uploader": { + "name": "file_uploader", + "signature": "element.file_uploader(self, label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nimport streamlit as st\nimport pandas as pd\nfrom io import StringIO\n\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nimport streamlit as st\n\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this file uploader is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str or list of str or None", + "is_optional": false, + "description": "

Array of allowed extensions. ['png', 'jpg']\nThe default is None, which means all extensions are allowed.

\n", + "default": "None" + }, + { + "name": "accept_multiple_files", + "type_name": "bool", + "is_optional": false, + "description": "

If True, allows the user to upload multiple files at the same time,\nin which case the return value will be a list of files.\nDefault: False

\n", + "default": "False" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the file uploader.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this file_uploader's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the file uploader if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile or list of UploadedFile", + "is_generator": false, + "description": "
    \n
  • If accept_multiple_files is False, returns either None or\nan UploadedFile object.
  • \n
  • If accept_multiple_files is True, returns a list with the\nuploaded files as UploadedFile objects. If no files were\nuploaded, returns an empty list.
  • \n
\n

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/file_uploader.py#L205" + }, + "DeltaGenerator.form": { + "name": "form", + "signature": "element.form(self, key, clear_on_submit=False)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n

Inserting elements out of order:

\n
\nimport streamlit as st\n\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n
\n", + "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

A string that identifies the form. Each form must have its own\nkey. (This key is not displayed to the user in the interface.)

\n", + "default": null + }, + { + "name": "clear_on_submit", + "type_name": "bool", + "is_optional": false, + "description": "

If True, all widgets inside the form will be reset to their default\nvalues after the user presses the Submit button. Defaults to False.\n(Note that Custom Components are unaffected by this flag, and\nwill not be reset to their defaults on form submission.)

\n", + "default": "values" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/form.py#L116" + }, + "DeltaGenerator.form_submit_button": { + "name": "form_submit_button", + "signature": "element.form_submit_button(self, label=\"Submit\", help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False)", + "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nDefaults to "Submit".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

A tooltip that gets displayed when the button is hovered over.\nDefaults to None.

\n", + "default": "None" + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/form.py#L209" + }, + "DeltaGenerator.graphviz_chart": { + "name": "graphviz_chart", + "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nimport graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a graph using the dagre-d3 library.", + "args": [ + { + "name": "figure_or_dot", + "type_name": "graphviz.dot.Graph, graphviz.dot.Digraph, str", + "is_optional": false, + "description": "

The Graphlib graph object or dot string to display

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/graphviz_chart.py#L39" + }, + "DeltaGenerator.header": { + "name": "header", + "signature": "element.header(self, body, anchor=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.header('This is a header')\nst.header('A header with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "Display text in header formatting.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/heading.py#L27" + }, + "DeltaGenerator.help": { + "name": "help", + "signature": "element.help(self, obj)", + "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nimport streamlit as st\nimport pandas\n\nst.help(pandas.DataFrame)\n
\n

Want to quickly check what datatype is output by a certain function?\nTry:

\n
\nimport streamlit as st\n\nx = my_poorly_documented_function()\nst.help(x)\n
\n
\n", + "description": "

Display object's doc string, nicely formatted.

\n

Displays the doc string for this object.

\n", + "args": [ + { + "name": "obj", + "type_name": "Object", + "is_optional": false, + "description": "

The object whose docstring should be displayed.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/doc_string.py#L44" + }, + "DeltaGenerator.image": { + "name": "image", + "signature": "element.image(self, image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", + "example": "
\n
\nimport streamlit as st\nfrom PIL import Image\n\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an image or list of images.", + "args": [ + { + "name": "image", + "type_name": "numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]", + "is_optional": false, + "description": "

Monochrome image of shape (w,h) or (w,h,1)\nOR a color image of shape (w,h,3)\nOR an RGBA image of shape (w,h,4)\nOR a URL to fetch the image from\nOR a path of a local image file\nOR an SVG XML string like <svg xmlns=...</svg>\nOR a list of one of the above, to display multiple images.

\n", + "default": null + }, + { + "name": "caption", + "type_name": "str or list of str", + "is_optional": false, + "description": "

Image caption. If displaying multiple images, caption should be a\nlist of captions (one for each image).

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Image width. None means use the image width,\nbut do not exceed the width of the column.\nShould be set for SVG images, as they have no default image width.

\n", + "default": "image" + }, + { + "name": "use_column_width", + "type_name": "'auto' or 'always' or 'never' or bool", + "is_optional": false, + "description": "

If 'auto', set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf 'always' or True, set the image's width to the column width.\nIf 'never' or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", + "default": null + }, + { + "name": "clamp", + "type_name": "bool", + "is_optional": false, + "description": "

Clamp image pixel values to a valid range ([0-255] per channel).\nThis is only meaningful for byte array images; the parameter is\nignored for image URLs. If this is not set, and an image has an\nout-of-range value, an error will be thrown.

\n", + "default": null + }, + { + "name": "channels", + "type_name": "'RGB' or 'BGR'", + "is_optional": false, + "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to 'RGB', meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to 'BGR', instead.

\n", + "default": "s" + }, + { + "name": "output_format", + "type_name": "'JPEG', 'PNG', or 'auto'", + "is_optional": false, + "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to 'auto' which identifies the compression type based\non the type and format of the image argument.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/image.py#L67" + }, + "DeltaGenerator.info": { + "name": "info", + "signature": "element.info(self, body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", + "description": "Display an informational message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The info text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/alert.py#L103" + }, + "DeltaGenerator.json": { + "name": "json", + "signature": "element.json(self, body, *, expanded=True)", + "example": "
\n
\nimport streamlit as st\n\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display object or string as a pretty-printed JSON string.", + "args": [ + { + "name": "body", + "type_name": "object or str", + "is_optional": false, + "description": "

The object to print as JSON. All referenced objects should be\nserializable to JSON as well. If object is a string, we assume it\ncontains serialized JSON.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean that allows the user to set whether the initial\nstate of this json element should be expanded. Defaults to True.\nThis argument can only be supplied by keyword.

\n", + "default": "True" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/json.py#L35" + }, + "DeltaGenerator.latex": { + "name": "latex", + "signature": "element.latex(self, body)", + "example": "
\n
\nimport streamlit as st\n\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", + "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", + "args": [ + { + "name": "body", + "type_name": "str or SymPy expression", + "is_optional": false, + "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/markdown.py#L171" + }, + "DeltaGenerator.line_chart": { + "name": "line_chart", + "signature": "element.line_chart(self, data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\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 \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict or None", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/dataframe_selector.py#L160" + }, + "DeltaGenerator.map": { + "name": "map", + "signature": "element.map(self, data=None, zoom=None, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a map with points on it.

\n

This is a wrapper around st.pydeck_chart to quickly create scatterplot\ncharts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more\ninfo on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to be plotted. Must have two columns:

\n
    \n
  • latitude called 'lat', 'latitude', 'LAT', 'LATITUDE'
  • \n
  • longitude called 'lon', 'longitude', 'LON', 'LONGITUDE'.
  • \n
\n", + "default": null + }, + { + "name": "zoom", + "type_name": "int", + "is_optional": false, + "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/map.py#L76" + }, + "DeltaGenerator.markdown": { + "name": "markdown", + "signature": "element.markdown(self, body, unsafe_allow_html=False)", + "examples": "
\n
\nimport streamlit as st\n\nst.markdown('Streamlit is **_really_ cool**.')\nst.markdown(\u201dThis text is :red[colored red], and this is **:blue[colored]** and bold.\u201d)\nst.markdown(":green[$\\sqrt{x^2+y^2}=1$] is a Pythagorean identity. :pencil:")\n
\n
\n", + "description": "Display string formatted as Markdown.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/markdown.py#L29" + }, + "DeltaGenerator.metric": { + "name": "metric", + "signature": "element.metric(self, label, value, delta=None, delta_color=\"normal\", help=None, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n \n (view standalone Streamlit app)\n \n

st.metric looks especially nice in combination with st.columns:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n \n (view standalone Streamlit app)\n \n

The delta indicator color can also be inverted or turned off:

\n
\nimport streamlit as st\n\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

The header or title for the metric. The label can optionally contain\nMarkdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "value", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Value of the metric. None is rendered as a long dash.

\n", + "default": null + }, + { + "name": "delta", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Indicator of how the metric changed, rendered with an arrow below\nthe metric. If delta is negative (int/float) or starts with a minus\nsign (str), the arrow points down and the text is red; else the\narrow points up and the text is green. If None (default), no delta\nindicator is shown.

\n", + "default": null + }, + { + "name": "delta_color", + "type_name": "str", + "is_optional": false, + "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the metric label.

\n", + "default": null + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/metric.py#L46" + }, + "DeltaGenerator.multiselect": { + "name": "multiselect", + "signature": "element.multiselect(self, label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", max_selections=None)", + "example": "
\n
\nimport streamlit as st\n\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence[V], numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null + }, + { + "name": "default", + "type_name": "[V], V, or None", + "is_optional": false, + "description": "

List of default values. Can also be a single value.

\n", + "default": "values" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of selectbox options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe multiselect.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the multiselect.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this multiselect's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the multiselect widget if set\nto True. The default is False. This argument can only be supplied\nby keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "max_selections", + "type_name": "int", + "is_optional": false, + "description": "

The max selections that can be selected at a time.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list", + "is_generator": false, + "description": "

A list with the selected options

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/multiselect.py#L145" + }, + "DeltaGenerator.number_input": { + "name": "number_input", + "signature": "element.number_input(self, label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a numeric input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. Output must be purely numeric. This does not impact\nthe return value. Valid formatters: %d %e %f %g %i %u

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this number_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the number input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int or float", + "is_generator": false, + "description": "

The current value of the numeric input widget. The return type\nwill match the data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/number_input.py#L66" + }, + "DeltaGenerator.plotly_chart": { + "name": "plotly_chart", + "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", theme=\"streamlit\", **kwargs)", + "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport numpy as np\nimport plotly.figure_factory as ff\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n        hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", + "args": [ + { + "name": "figure_or_data", + "type_name": "plotly.graph_objs.Figure, plotly.graph_objs.Data,", + "is_optional": false, + "description": "

dict/list of plotly.graph_objs.Figure/Data

\n

See https://plot.ly/python/ for examples of graph descriptions.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + }, + { + "name": "sharing", + "type_name": "{'streamlit', 'private', 'secret', 'public'}", + "is_optional": false, + "description": "

Use 'streamlit' to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": null, + "is_optional": null, + "description": "

Any argument accepted by Plotly's plot() function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/plotly_chart.py#L81" + }, + "DeltaGenerator.progress": { + "name": "progress", + "signature": "element.progress(self, value)", + "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport streamlit as st\nimport time\n\nmy_bar = st.progress(0)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1)\n
\n
\n", + "description": "Display a progress bar.", + "args": [ + { + "name": "value", + "type_name": "int or float", + "is_optional": false, + "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/progress.py#L32" + }, + "DeltaGenerator.pydeck_chart": { + "name": "pydeck_chart", + "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)", + "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport pydeck as pdk\n\nchart_data = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=chart_data,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=chart_data,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", + "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "pydeck_obj", + "type_name": "pydeck.Deck or None", + "is_optional": false, + "description": "

Object specifying the PyDeck chart to draw.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/deck_gl_json_chart.py#L36" + }, + "DeltaGenerator.pyplot": { + "name": "pyplot", + "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)", + "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", + "example": "
\n
\nimport streamlit as st\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a matplotlib.pyplot figure.", + "args": [ + { + "name": "fig", + "type_name": "Matplotlib Figure", + "is_optional": false, + "description": "

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

\n", + "default": null + }, + { + "name": "clear_figure", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", + "default": "based" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Arguments to pass to Matplotlib's savefig function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/pyplot.py#L38" + }, + "DeltaGenerator.radio": { + "name": "radio", + "signature": "element.radio(self, label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ngenre = st.radio(\n    "What\\'s your favorite movie genre",\n    ('Comedy', 'Drama', 'Documentary'))\n\nif genre == 'Comedy':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn\\'t select comedy.")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a radio button widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this radio group is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the radio options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of radio options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe radio.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the radio.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this radio's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the radio button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "horizontal", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", + "default": "false" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/radio.py#L75" + }, + "DeltaGenerator.select_slider": { + "name": "select_slider", + "signature": "element.select_slider(self, label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\nimport streamlit as st\n\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nimport streamlit as st\n\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n \n (view standalone Streamlit app)\n \n ", + "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the slider options. All options will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", + "default": null + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to first option.

\n", + "default": "first" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels from the options.\nargument. It receives the option as an argument and its output\nwill be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the select slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this select_slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the select slider if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any value or tuple of any value", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/select_slider.py#L106" + }, + "DeltaGenerator.selectbox": { + "name": "selectbox", + "signature": "element.selectbox(self, label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a select widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels. It receives the option\nas an argument and its output will be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the selectbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this selectbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the selectbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/selectbox.py#L71" + }, + "DeltaGenerator.slider": { + "name": "slider", + "signature": "element.slider(self, label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nimport streamlit as st\n\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nimport streamlit as st\nfrom datetime import time\n\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nimport streamlit as st\nfrom datetime import datetime\n\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The minimum permitted value.\nDefaults to 0 if the value is an int, 0.0 if a float,\nvalue - timedelta(days=14) if a date/datetime, time.min if a time

\n", + "default": "0" + }, + { + "name": "max_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The maximum permitted value.\nDefaults to 100 if the value is an int, 1.0 if a float,\nvalue + timedelta(days=14) if a date/datetime, time.max if a time

\n", + "default": "100" + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to min_value.

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int/float/timedelta or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. This does not impact the return value.\nFormatter for int/float supports: %d %e %f %g %i\nFormatter for date/time/datetime uses Moment.js notation:\nhttps://momentjs.com/docs/#/displaying/format/

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the slider if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int/float/date/time/datetime or tuple of int/float/date/time/datetime", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/slider.py#L171" + }, + "DeltaGenerator.snow": { + "name": "snow", + "signature": "element.snow(self)", + "example": "
\n
\nimport streamlit as st\n\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", + "description": "Draw celebratory snowfall.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/snow.py#L25" + }, + "DeltaGenerator.subheader": { + "name": "subheader", + "signature": "element.subheader(self, body, anchor=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.subheader('This is a subheader')\nst.subheader('A subheader with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "Display text in subheader formatting.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/heading.py#L72" + }, + "DeltaGenerator.success": { + "name": "success", + "signature": "element.success(self, body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", + "description": "Display a success message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The success text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/alert.py#L136" + }, + "DeltaGenerator.table": { + "name": "table", + "signature": "element.table(self, data=None)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/dataframe_selector.py#L122" + }, + "DeltaGenerator.tabs": { + "name": "tabs", + "signature": "element.tabs(self, tabs)", + "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\nimport streamlit as st\n\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", + "args": [ + { + "name": "tabs", + "type_name": "list of strings", + "is_optional": false, + "description": "

Creates a tab for each string in the list. The first tab is selected by default.\nThe string is used as the name of the tab and can optionally contain Markdown,\nsupporting the following elements: Bold, Italics, Strikethroughs, Inline Code,\nEmojis, and Links.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/layouts.py#L206" + }, + "DeltaGenerator.text": { + "name": "text", + "signature": "element.text(self, body)", + "example": "
\n
\nimport streamlit as st\n\nst.text('This is some text.')\n
\n
\n", + "description": "Write fixed-width and preformatted text.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/text.py#L27" + }, + "DeltaGenerator.text_area": { + "name": "text_area", + "signature": "element.text_area(self, label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", + "description": "Display a multi-line text input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Maximum number of characters allowed in text area.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the textarea.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_area's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text area is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text area if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/text_widgets.py#L268" + }, + "DeltaGenerator.text_input": { + "name": "text_input", + "signature": "element.text_input(self, label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a single-line text input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Max number of characters allowed in text input.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str", + "is_optional": false, + "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "autocomplete", + "type_name": "str", + "is_optional": false, + "description": "

An optional value that will be passed to the <input> element's\nautocomplete property. If unspecified, this value will be set to\n"new-password" for "password" inputs, and the empty string for\n"default" inputs. For more details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text input is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/text_widgets.py#L69" + }, + "DeltaGenerator.time_input": { + "name": "time_input", + "signature": "element.time_input(self, label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a time input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this time input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.time/datetime.datetime", + "is_optional": false, + "description": "

The value of this widget when it first renders. This will be\ncast to str internally. Defaults to the current time.

\n", + "default": "the" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this time_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the time input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.time", + "is_generator": false, + "description": "

The current value of the time input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/time_widgets.py#L212" + }, + "DeltaGenerator.title": { + "name": "title", + "signature": "element.title(self, body, anchor=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.title('This is a title')\nst.title('A title with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/heading.py#L118" + }, + "DeltaGenerator.vega_lite_chart": { + "name": "vega_lite_chart", + "signature": "element.vega_lite_chart(self, data=None, spec=None, use_container_width=False, theme=\"streamlit\", **kwargs)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(chart_data, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", + "description": "Display a chart using the Vega-Lite library.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "spec", + "type_name": "dict or None", + "is_optional": false, + "description": "

The Vega-Lite spec for the chart. If the spec was already passed in\nthe previous argument, this must be set to None. See\nhttps://vega.github.io/vega-lite/docs/ for more info.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Same as spec, but as keywords.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/dataframe_selector.py#L475" + }, + "DeltaGenerator.video": { + "name": "video", + "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)", + "example": "
\n
\nimport streamlit as st\n\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", + "description": "Display a video player.", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "default": null + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the video file. Defaults to 'video/mp4'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/media.py#L117" + }, + "DeltaGenerator.warning": { + "name": "warning", + "signature": "element.warning(self, body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", + "description": "Display warning message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The warning text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/alert.py#L71" + }, + "DeltaGenerator.write": { + "name": "write", + "signature": "element.write(self, *args, unsafe_allow_html=False, **kwargs)", + "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nimport streamlit as st\n\nst.write('Hello, *World!* :sunglasses:')\n
\n\n \n \n (view standalone Streamlit app)\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nimport streamlit as st\nimport pandas as pd\n\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n \n (view standalone Streamlit app)\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nimport streamlit as st\n\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n \n (view standalone Streamlit app)\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression, emoji shortcodes, and colored text.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": "False" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.17.0/lib/streamlit/elements/write.py#L47" + } + }, + "1.18.0": { + "streamlit.altair_chart": { + "name": "altair_chart", + "signature": "st.altair_chart(altair_chart, use_container_width=False, theme=\"streamlit\")", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(chart_data).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a chart using the Altair library.", + "args": [ + { + "name": "altair_chart", + "type_name": "altair.vegalite.v2.api.Chart", + "is_optional": false, + "description": "

The Altair chart object to display.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/dataframe_selector.py#L422" + }, + "streamlit.area_chart": { + "name": "area_chart", + "signature": "st.area_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/dataframe_selector.py#L247" + }, + "streamlit.audio": { + "name": "audio", + "signature": "st.audio(data, format=\"audio/wav\", start_time=0, *, sample_rate=None)", + "example": "
\n
\nimport streamlit as st\nimport numpy as np\n\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n\nsample_rate = 44100  # 44100 samples per second\nseconds = 2  # Note duration of 2 seconds\nfrequency_la = 440  # Our played note will be 440 Hz\n# Generate array with seconds*sample_rate steps, ranging between 0 and seconds\nt = np.linspace(0, seconds, seconds * sample_rate, False)\n# Generate a 440 Hz sine wave\nnote_la = np.sin(frequency_la * t * 2 * np.pi)\n\nst.audio(note_la, sample_rate=sample_rate)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an audio player.", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw audio data, filename, or a URL pointing to the file to load.\nRaw data formats must include all necessary file headers to match the file\nformat specified via format.\nIf data is a numpy array, it must either be a 1D array of the waveform\nor a 2D array of shape (num_channels, num_samples) with waveforms\nfor all channels. See the default channel order at\nhttp://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx

\n", + "default": "channel" + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + }, + { + "name": "sample_rate", + "type_name": "int or None", + "is_optional": false, + "description": "

The sample rate of the audio data in samples per second. Only required if\ndata is a numpy array.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/media.py#L43" + }, + "streamlit.balloons": { + "name": "balloons", + "signature": "st.balloons()", + "example": "
\n
\nimport streamlit as st\n\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", + "description": "Draw celebratory balloons.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/balloons.py#L25" + }, + "streamlit.bar_chart": { + "name": "bar_chart", + "signature": "st.bar_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/dataframe_selector.py#L334" + }, + "streamlit.beta_columns": { + "name": "beta_columns", + "signature": "st.beta_columns(spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/layouts.py#L77" + }, + "streamlit.beta_container": { + "name": "beta_container", + "signature": "st.beta_container()", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/layouts.py#L29" + }, + "streamlit.beta_expander": { + "name": "beta_expander", + "signature": "st.beta_expander(label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/layouts.py#L306" + }, + "streamlit.bokeh_chart": { + "name": "bokeh_chart", + "signature": "st.bokeh_chart(figure, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", + "args": [ + { + "name": "figure", + "type_name": "bokeh.plotting.figure.Figure", + "is_optional": false, + "description": "

A Bokeh figure to plot.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Bokeh's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/bokeh_chart.py#L36" + }, + "streamlit.button": { + "name": "button", + "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\n\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a button widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, and Emojis.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/button.py#L61" + }, + "streamlit.cache": { + "name": "cache", + "signature": "st.cache(func=None, persist=False, allow_output_mutation=False, show_spinner=True, suppress_st_warning=False, hash_funcs=None, max_entries=None, ttl=None)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\n@st.cache(persist=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To disable hashing return values, set the allow_output_mutation parameter to True:

\n
\n@st.cache(allow_output_mutation=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. MongoClient) to a hash function (id) like this:

\n
\n@st.cache(hash_funcs={MongoClient: id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "pymongo.mongo_client.MongoClient") to the hash function instead:

\n
\n@st.cache(hash_funcs={"pymongo.mongo_client.MongoClient": id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n
\n", + "description": "Function decorator to memoize function executions.", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to cache. Streamlit hashes the function and dependent code.

\n", + "default": null + }, + { + "name": "persist", + "type_name": "boolean", + "is_optional": false, + "description": "

Whether to persist the cache on disk.

\n", + "default": null + }, + { + "name": "allow_output_mutation", + "type_name": "boolean", + "is_optional": false, + "description": "

Streamlit shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.

\n

If you know what you're doing and would like to override this warning, set this to True.

\n", + "default": null + }, + { + "name": "show_spinner", + "type_name": "boolean", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na cache miss.

\n", + "default": "True" + }, + { + "name": "suppress_st_warning", + "type_name": "boolean", + "is_optional": false, + "description": "

Suppress warnings about calling Streamlit commands from within\nthe cached function.

\n", + "default": null + }, + { + "name": "hash_funcs", + "type_name": "dict or None", + "is_optional": false, + "description": "

Mapping of types or fully qualified names to hash functions. This is used to override\nthe behavior of the hasher inside Streamlit's caching mechanism: when the hasher\nencounters an object, it will first check to see if its type matches a key in this\ndict and, if so, will use the provided function to generate a hash for it. See below\nfor an example of how this can be used.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." + }, + { + "name": "ttl", + "type_name": "float or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.

\n", + "default": "None." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/runtime/legacy_caching/caching.py#L486" + }, + "streamlit.cache_data": { + "name": "cache_data", + "signature": "st.cache_data(func=None, *, ttl, max_entries, show_spinner, persist, experimental_allow_widgets)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\nimport streamlit as st\n\n@st.cache_data(persist="disk")\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

By default, all parameters to a cached function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nconnection = make_database_connection()\nd1 = fetch_and_clean_data(connection, num_rows=10)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nanother_connection = make_database_connection()\nd2 = fetch_and_clean_data(another_connection, num_rows=10)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _database_connection parameter was different\n# in both calls.\n
\n

A cached function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nfetch_and_clean_data.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Decorator to cache functions that return data (e.g. dataframe transforms, database queries, ML inference).

\n

Cached objects are stored in "pickled" form, which means that the return\nvalue of a cached function must be pickleable. Each caller of the cached\nfunction gets its own copy of the cached data.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_data.clear().

\n

To cache global resources, use st.cache_resource instead. Learn more\nabout caching at https://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to cache. Streamlit hashes the function's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float or timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.\nNote that ttl is incompatible with persist="disk" - ttl will be\nignored if persist is specified.

\n", + "default": "None." + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." + }, + { + "name": "show_spinner", + "type_name": "boolean", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na cache miss.

\n", + "default": "True" + }, + { + "name": "persist", + "type_name": "str or boolean or None", + "is_optional": false, + "description": "

Optional location to persist cached data to. Passing "disk" (or True)\nwill persist the cached data to the local disk. None (or False) will disable\npersistence. The default is None.

\n", + "default": "None." + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/runtime/caching/cache_data_api.py#L274" + }, + "streamlit.cache_resource": { + "name": "cache_resource", + "signature": "st.cache_resource(func, *, ttl, max_entries, show_spinner, validate, experimental_allow_widgets)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(url):\n    # Create a database session object that points to the URL.\n    return session\n\ns1 = get_database_session(SESSION_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(SESSION_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the connection object in s1 is the same as in s2.\n\ns3 = get_database_session(SESSION_URL_2)\n# This is a different URL, so the function executes.\n
\n

By default, all parameters to a cache_resource function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\ns1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _sessionmaker parameter was different\n# in both calls.\n
\n

A cache_resource function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\nget_database_session.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Decorator to cache functions that return global resources (e.g. database connections, ML models).

\n

Cached objects are shared across all users, sessions, and reruns. They\nmust be thread-safe because they can be accessed from multiple threads\nconcurrently. If thread safety is an issue, consider using st.session_state\nto store resources per session instead.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_resource.clear().

\n

To cache data, use st.cache_data instead. Learn more about caching at\nhttps://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function that creates the cached resource. Streamlit hashes the\nfunction's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float or timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.

\n", + "default": "None." + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached resource is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "validate", + "type_name": "callable or None", + "is_optional": false, + "description": "

An optional validation function for cached data. validate is called\neach time the cached value is accessed. It receives the cached value as\nits only parameter and it must return a boolean. If validate returns\nFalse, the current cached value is discarded, and the decorated function\nis called to compute a new value. This is useful e.g. to check the\nhealth of database connections.

\n", + "default": null + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/runtime/caching/cache_resource_api.py#L258" + }, + "streamlit.camera_input": { + "name": "camera_input", + "signature": "st.camera_input(label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", + "description": "Display a widget that returns pictures from the user's webcam.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this widget is used for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the camera input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this camera_input's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile", + "is_generator": false, + "description": "

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/camera_input.py#L109" + }, + "streamlit.caption": { + "name": "caption", + "signature": "st.caption(body, unsafe_allow_html=False)", + "examples": "
\n
\nimport streamlit as st\n\nst.caption('This is a string that explains something above.')\nst.caption('A caption with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/markdown.py#L119" + }, + "streamlit.checkbox": { + "name": "checkbox", + "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a checkbox widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this checkbox is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "value", + "type_name": "bool", + "is_optional": false, + "description": "

Preselect the checkbox when it first renders. This will be\ncast to bool internally.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the checkbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this checkbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

Whether or not the checkbox is checked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/checkbox.py#L52" + }, + "streamlit.code": { + "name": "code", + "signature": "st.code(body, language=\"python\")", + "example": "
\n
\nimport streamlit as st\n\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", + "description": "

Display a code block with optional syntax highlighting.

\n

(This is a convenience wrapper around st.markdown())

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as code.

\n", + "default": null + }, + { + "name": "language", + "type_name": "str or None", + "is_optional": false, + "description": "

The language that the code is written in, for syntax highlighting.\nIf None, the code will be unstyled. Defaults to "python".

\n

For a list of available language values, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/markdown.py#L83" + }, + "streamlit.color_picker": { + "name": "color_picker", + "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a color picker widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "str", + "is_optional": false, + "description": "

The hex value of this widget when it first renders. If None,\ndefaults to black.

\n", + "default": "black." + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the color picker.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this color_picker's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The selected color as a hex string.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/color_picker.py#L52" + }, + "streamlit.columns": { + "name": "columns", + "signature": "st.columns(spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/layouts.py#L77" + }, + "streamlit.container": { + "name": "container", + "signature": "st.container()", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/layouts.py#L29" + }, + "streamlit.dataframe": { + "name": "dataframe", + "signature": "st.dataframe(data=None, width=None, height=None, *, use_container_width=False)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\nst.dataframe(df, 200, 100)\n
\n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a dataframe as an interactive table.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. (It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.)\nStyler support is experimental!\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the dataframe expressed in pixels. If None, the width\nwill be automatically calculated based on the column content.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the dataframe expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the dataframe width to the width of the parent container.\nThis takes precedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/dataframe_selector.py#L40" + }, + "streamlit.date_input": { + "name": "date_input", + "signature": "st.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nd = st.date_input(\n    "When\\'s your birthday",\n    datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a date input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this date input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", + "is_optional": false, + "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", + "default": "today" + }, + { + "name": "min_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", + "default": "value" + }, + { + "name": "max_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", + "default": "value" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this date_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.date or a tuple with 0-2 dates", + "is_generator": false, + "description": "

The current value of the date input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/time_widgets.py#L380" + }, + "streamlit.download_button": { + "name": "download_button", + "signature": "st.download_button(label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False, use_container_width=False)", + "examples": "
\n

Download a large DataFrame as a CSV:

\n
\nimport streamlit as st\n\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\nimport streamlit as st\n\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nimport streamlit as st\n\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nimport streamlit as st\n\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, and Emojis.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "data", + "type_name": "str or bytes or file", + "is_optional": false, + "description": "

The contents of the file to be downloaded. See example below for\ncaching techniques to avoid recomputing this data unnecessarily.

\n", + "default": null + }, + { + "name": "file_name", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the name of the file to be downloaded,\nsuch as 'my_file.csv'. If not specified, the name will be\nautomatically generated.

\n", + "default": null + }, + { + "name": "mime", + "type_name": "str or None", + "is_optional": false, + "description": "

The MIME type of the data. If None, defaults to "text/plain"\n(if data is of type str or is a textual file) or\n"application/octet-stream" (if data is of type bytes or is a\nbinary file).

\n", + "default": "s" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/button.py#L155" + }, + "streamlit.echo": { + "name": "echo", + "signature": "st.echo(code_location=\"above\")", + "example": "
\n
\nimport streamlit as st\n\nwith st.echo():\n    st.write('This code will be printed')\n
\n
\n", + "description": "Use in a `with` block to draw some code on the app, then execute it.", + "args": [ + { + "name": "code_location", + "type_name": "\"above\" or \"below\"", + "is_optional": false, + "description": "

Whether to show the echoed code before or after the results of the\nexecuted code block.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/echo.py#L27" + }, + "streamlit.empty": { + "name": "empty", + "signature": "st.empty()", + "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport streamlit as st\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nimport streamlit as st\n\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", + "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/empty.py#L24" + }, + "streamlit.error": { + "name": "error", + "signature": "st.error(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", + "description": "Display error message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The error text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/alert.py#L39" + }, + "streamlit.exception": { + "name": "exception", + "signature": "st.exception(exception)", + "example": "
\n
\nimport streamlit as st\n\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", + "description": "Display an exception.", + "args": [ + { + "name": "exception", + "type_name": "Exception", + "is_optional": false, + "description": "

The exception to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/exception.py#L50" + }, + "streamlit.expander": { + "name": "expander", + "signature": "st.expander(label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/layouts.py#L306" + }, + "streamlit.experimental_data_editor": { + "name": "experimental_data_editor", + "signature": "st.experimental_data_editor(data, *, width=None, height=None, use_container_width=False, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.experimental_data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.experimental_data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n
\n", + "description": "

Display a data editor widget.

\n

Display a data editor widget that allows you to edit DataFrames and\nmany other data structures in a table-like UI.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None", + "is_optional": false, + "description": "

The data to edit in the data editor.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the data editor expressed in pixels. If None, the width\nwill be automatically calculated based on the container width.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the data editor expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the data editor width to the width of the parent container.\nThis takes precedence over the width argument. Defaults to False.

\n", + "default": "False." + }, + { + "name": "num_rows", + "type_name": "\"fixed\" or \"dynamic\"", + "is_optional": false, + "description": "

Specifies if the user can add and delete rows in the data editor.\nIf "fixed", the user cannot add or delete rows. If "dynamic", the user can\nadd and delete rows in the data editor, but column sorting is disabled.\nDefaults to "fixed".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean which, if True, disables the data editor and prevents\nany edits. Defaults to False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the unique key for this widget. If this\nis omitted, a key will be generated for the widget based on its\ncontent. Multiple widgets of the same type may not share the same\nkey.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this data_editor's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "pd.DataFrame, pd.Styler, pyarrow.Table, np.ndarray, list, set, tuple, or dict.", + "is_generator": false, + "description": "

The edited data. The edited data is returned in its original data type if\nit corresponds to any of the supported return types. All other data types\nare returned as a pd.DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/data_editor.py#L448" + }, + "streamlit.experimental_get_query_params": { + "name": "experimental_get_query_params", + "signature": "st.experimental_get_query_params()", + "example": "
\n

Let's say the user's web browser is at\nhttp://localhost:8501/?show_map=True&selected=asia&selected=america.\nThen, you can get the query parameters using the following:

\n
\nimport streamlit as st\n\nst.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\n

Note that the values in the returned dict are always lists. This is\nbecause we internally use Python's urllib.parse.parse_qs(), which behaves\nthis way. And this behavior makes sense when you consider that every item\nin a query string is potentially a 1-element array.

\n
\n", + "description": "Return the query parameters that is currently showing in the browser's URL bar.", + "args": [], + "returns": [ + { + "type_name": "dict", + "is_generator": false, + "description": "

The current query parameters as a dict. "Query parameters" are the part of the URL that comes\nafter the first "?".

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/commands/query_params.py#L23" + }, + "streamlit.experimental_memo": { + "name": "experimental_memo", + "signature": "st.experimental_memo(func=None, *, ttl, max_entries, show_spinner, persist, experimental_allow_widgets)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\nimport streamlit as st\n\n@st.cache_data(persist="disk")\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

By default, all parameters to a cached function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nconnection = make_database_connection()\nd1 = fetch_and_clean_data(connection, num_rows=10)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nanother_connection = make_database_connection()\nd2 = fetch_and_clean_data(another_connection, num_rows=10)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _database_connection parameter was different\n# in both calls.\n
\n

A cached function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nfetch_and_clean_data.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Decorator to cache functions that return data (e.g. dataframe transforms, database queries, ML inference).

\n

Cached objects are stored in "pickled" form, which means that the return\nvalue of a cached function must be pickleable. Each caller of the cached\nfunction gets its own copy of the cached data.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_data.clear().

\n

To cache global resources, use st.cache_resource instead. Learn more\nabout caching at https://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to cache. Streamlit hashes the function's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float or timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.\nNote that ttl is incompatible with persist="disk" - ttl will be\nignored if persist is specified.

\n", + "default": "None." + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." + }, + { + "name": "show_spinner", + "type_name": "boolean", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na cache miss.

\n", + "default": "True" + }, + { + "name": "persist", + "type_name": "str or boolean or None", + "is_optional": false, + "description": "

Optional location to persist cached data to. Passing "disk" (or True)\nwill persist the cached data to the local disk. None (or False) will disable\npersistence. The default is None.

\n", + "default": "None." + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/runtime/caching/cache_data_api.py#L274" + }, + "streamlit.experimental_rerun": { + "name": "experimental_rerun", + "signature": "st.experimental_rerun()", + "description": "

Rerun the script immediately.

\n

When st.experimental_rerun() is called, the script is halted - no\nmore statements will be run, and the script will be queued to re-run\nfrom the top.

\n

If this function is called outside of Streamlit, it will raise an\nException.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/commands/execution_control.py#L46" + }, + "streamlit.experimental_set_query_params": { + "name": "experimental_set_query_params", + "signature": "st.experimental_set_query_params(**query_params)", + "example": "
\n

To point the user's web browser to something like\n"http://localhost:8501/?show_map=True&selected=asia&selected=america",\nyou would do the following:

\n
\nimport streamlit as st\n\nst.experimental_set_query_params(\n    show_map=True,\n    selected=["asia", "america"],\n)\n
\n
\n", + "description": "Set the query parameters that are shown in the browser's URL bar.", + "args": [ + { + "name": "**query_params", + "type_name": "dict", + "is_optional": false, + "description": "

The query parameters to set, as key-value pairs.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/commands/query_params.py#L56" + }, + "streamlit.experimental_show": { + "name": "experimental_show", + "signature": "st.experimental_show(*args)", + "notes": "
\n

This is an experimental feature with usage limitations:

\n
    \n
  • The method must be called with the name show.
  • \n
  • Must be called in one line of code, and only once per line.
  • \n
  • \n
    When passing multiple arguments the inclusion of , or ) in a string
    \n
    argument may cause an error.
    \n
    \n
  • \n
\n
\n", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndataframe = pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n})\nst.experimental_show(dataframe)\n
\n
\n", + "description": "

Write arguments and argument names to your app for debugging purposes.

\n

Show() has similar properties to write():

\n
\n
    \n
  1. You can pass in multiple arguments, all of which will be debugged.
  2. \n
  3. It returns None, so it's "slot" in the app cannot be reused.
  4. \n
\n
\n

Note: This is an experimental feature. See\nhttps://docs.streamlit.io/library/advanced-features/prerelease#experimental for more information.

\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to debug in the App.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/show.py#L23" + }, + "streamlit.experimental_singleton": { + "name": "experimental_singleton", + "signature": "st.experimental_singleton(func, *, ttl, max_entries, show_spinner, validate, experimental_allow_widgets)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(url):\n    # Create a database session object that points to the URL.\n    return session\n\ns1 = get_database_session(SESSION_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(SESSION_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the connection object in s1 is the same as in s2.\n\ns3 = get_database_session(SESSION_URL_2)\n# This is a different URL, so the function executes.\n
\n

By default, all parameters to a cache_resource function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\ns1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _sessionmaker parameter was different\n# in both calls.\n
\n

A cache_resource function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\nget_database_session.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Decorator to cache functions that return global resources (e.g. database connections, ML models).

\n

Cached objects are shared across all users, sessions, and reruns. They\nmust be thread-safe because they can be accessed from multiple threads\nconcurrently. If thread safety is an issue, consider using st.session_state\nto store resources per session instead.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_resource.clear().

\n

To cache data, use st.cache_data instead. Learn more about caching at\nhttps://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function that creates the cached resource. Streamlit hashes the\nfunction's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float or timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.

\n", + "default": "None." + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached resource is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "validate", + "type_name": "callable or None", + "is_optional": false, + "description": "

An optional validation function for cached data. validate is called\neach time the cached value is accessed. It receives the cached value as\nits only parameter and it must return a boolean. If validate returns\nFalse, the current cached value is discarded, and the decorated function\nis called to compute a new value. This is useful e.g. to check the\nhealth of database connections.

\n", + "default": null + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/runtime/caching/cache_resource_api.py#L258" + }, + "streamlit.file_uploader": { + "name": "file_uploader", + "signature": "st.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nimport streamlit as st\nimport pandas as pd\nfrom io import StringIO\n\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nimport streamlit as st\n\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this file uploader is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str or list of str or None", + "is_optional": false, + "description": "

Array of allowed extensions. ['png', 'jpg']\nThe default is None, which means all extensions are allowed.

\n", + "default": "None" + }, + { + "name": "accept_multiple_files", + "type_name": "bool", + "is_optional": false, + "description": "

If True, allows the user to upload multiple files at the same time,\nin which case the return value will be a list of files.\nDefault: False

\n", + "default": "False" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the file uploader.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this file_uploader's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the file uploader if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile or list of UploadedFile", + "is_generator": false, + "description": "
    \n
  • If accept_multiple_files is False, returns either None or\nan UploadedFile object.
  • \n
  • If accept_multiple_files is True, returns a list with the\nuploaded files as UploadedFile objects. If no files were\nuploaded, returns an empty list.
  • \n
\n

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/file_uploader.py#L205" + }, + "streamlit.form": { + "name": "form", + "signature": "st.form(key, clear_on_submit=False)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n

Inserting elements out of order:

\n
\nimport streamlit as st\n\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n
\n", + "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

A string that identifies the form. Each form must have its own\nkey. (This key is not displayed to the user in the interface.)

\n", + "default": null + }, + { + "name": "clear_on_submit", + "type_name": "bool", + "is_optional": false, + "description": "

If True, all widgets inside the form will be reset to their default\nvalues after the user presses the Submit button. Defaults to False.\n(Note that Custom Components are unaffected by this flag, and\nwill not be reset to their defaults on form submission.)

\n", + "default": "values" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/form.py#L118" + }, + "streamlit.form_submit_button": { + "name": "form_submit_button", + "signature": "st.form_submit_button(label=\"Submit\", help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nDefaults to "Submit".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

A tooltip that gets displayed when the button is hovered over.\nDefaults to None.

\n", + "default": "None." + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/form.py#L211" + }, + "streamlit.get_option": { + "name": "get_option", + "signature": "st.get_option(key)", + "description": "

Return the current value of a given Streamlit config option.

\n

Run streamlit config show in the terminal to see all available options.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

The config option key of the form "section.optionName". To see all\navailable options, run streamlit config show on a terminal.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/config.py#L128" + }, + "streamlit.graphviz_chart": { + "name": "graphviz_chart", + "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nimport graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a graph using the dagre-d3 library.", + "args": [ + { + "name": "figure_or_dot", + "type_name": "graphviz.dot.Graph, graphviz.dot.Digraph, str", + "is_optional": false, + "description": "

The Graphlib graph object or dot string to display

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/graphviz_chart.py#L39" + }, + "streamlit.header": { + "name": "header", + "signature": "st.header(body, anchor=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.header('This is a header')\nst.header('A header with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "Display text in header formatting.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/heading.py#L31" + }, + "streamlit.help": { + "name": "help", + "signature": "st.help(obj)", + "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nimport streamlit as st\nimport pandas\n\nst.help(pandas.DataFrame)\n
\n

Want to quickly check what datatype is output by a certain function?\nTry:

\n
\nimport streamlit as st\n\nx = my_poorly_documented_function()\nst.help(x)\n
\n
\n", + "description": "

Display object's doc string, nicely formatted.

\n

Displays the doc string for this object.

\n", + "args": [ + { + "name": "obj", + "type_name": "Object", + "is_optional": false, + "description": "

The object whose docstring should be displayed.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/doc_string.py#L44" + }, + "streamlit.image": { + "name": "image", + "signature": "st.image(image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", + "example": "
\n
\nimport streamlit as st\nfrom PIL import Image\n\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an image or list of images.", + "args": [ + { + "name": "image", + "type_name": "numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]", + "is_optional": false, + "description": "

Monochrome image of shape (w,h) or (w,h,1)\nOR a color image of shape (w,h,3)\nOR an RGBA image of shape (w,h,4)\nOR a URL to fetch the image from\nOR a path of a local image file\nOR an SVG XML string like <svg xmlns=...</svg>\nOR a list of one of the above, to display multiple images.

\n", + "default": null + }, + { + "name": "caption", + "type_name": "str or list of str", + "is_optional": false, + "description": "

Image caption. If displaying multiple images, caption should be a\nlist of captions (one for each image).

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Image width. None means use the image width,\nbut do not exceed the width of the column.\nShould be set for SVG images, as they have no default image width.

\n", + "default": "image" + }, + { + "name": "use_column_width", + "type_name": "'auto' or 'always' or 'never' or bool", + "is_optional": false, + "description": "

If 'auto', set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf 'always' or True, set the image's width to the column width.\nIf 'never' or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", + "default": null + }, + { + "name": "clamp", + "type_name": "bool", + "is_optional": false, + "description": "

Clamp image pixel values to a valid range ([0-255] per channel).\nThis is only meaningful for byte array images; the parameter is\nignored for image URLs. If this is not set, and an image has an\nout-of-range value, an error will be thrown.

\n", + "default": null + }, + { + "name": "channels", + "type_name": "'RGB' or 'BGR'", + "is_optional": false, + "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to 'RGB', meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to 'BGR', instead.

\n", + "default": "s" + }, + { + "name": "output_format", + "type_name": "'JPEG', 'PNG', or 'auto'", + "is_optional": false, + "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to 'auto' which identifies the compression type based\non the type and format of the image argument.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/image.py#L67" + }, + "streamlit.info": { + "name": "info", + "signature": "st.info(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", + "description": "Display an informational message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The info text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/alert.py#L103" + }, + "streamlit.json": { + "name": "json", + "signature": "st.json(body, *, expanded=True)", + "example": "
\n
\nimport streamlit as st\n\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display object or string as a pretty-printed JSON string.", + "args": [ + { + "name": "body", + "type_name": "object or str", + "is_optional": false, + "description": "

The object to print as JSON. All referenced objects should be\nserializable to JSON as well. If object is a string, we assume it\ncontains serialized JSON.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean that allows the user to set whether the initial\nstate of this json element should be expanded. Defaults to True.\nThis argument can only be supplied by keyword.

\n", + "default": "True." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/json.py#L35" + }, + "streamlit.latex": { + "name": "latex", + "signature": "st.latex(body)", + "example": "
\n
\nimport streamlit as st\n\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", + "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", + "args": [ + { + "name": "body", + "type_name": "str or SymPy expression", + "is_optional": false, + "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/markdown.py#L174" + }, + "streamlit.line_chart": { + "name": "line_chart", + "signature": "st.line_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\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 \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict or None", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/dataframe_selector.py#L160" + }, + "streamlit.map": { + "name": "map", + "signature": "st.map(data=None, zoom=None, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a map with points on it.

\n

This is a wrapper around st.pydeck_chart to quickly create scatterplot\ncharts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more\ninfo on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to be plotted. Must have two columns:

\n
    \n
  • latitude called 'lat', 'latitude', 'LAT', 'LATITUDE'
  • \n
  • longitude called 'lon', 'longitude', 'LON', 'LONGITUDE'.
  • \n
\n", + "default": null + }, + { + "name": "zoom", + "type_name": "int", + "is_optional": false, + "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/map.py#L76" + }, + "streamlit.markdown": { + "name": "markdown", + "signature": "st.markdown(body, unsafe_allow_html=False)", + "examples": "
\n
\nimport streamlit as st\n\nst.markdown('Streamlit is **_really_ cool**.')\nst.markdown(\u201dThis text is :red[colored red], and this is **:blue[colored]** and bold.\u201d)\nst.markdown(":green[$\\sqrt{x^2+y^2}=1$] is a Pythagorean identity. :pencil:")\n
\n
\n", + "description": "Display string formatted as Markdown.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/markdown.py#L29" + }, + "streamlit.metric": { + "name": "metric", + "signature": "st.metric(label, value, delta=None, delta_color=\"normal\", help=None, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n \n (view standalone Streamlit app)\n \n

st.metric looks especially nice in combination with st.columns:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n \n (view standalone Streamlit app)\n \n

The delta indicator color can also be inverted or turned off:

\n
\nimport streamlit as st\n\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

The header or title for the metric. The label can optionally contain\nMarkdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Value of the metric. None is rendered as a long dash.

\n", + "default": null + }, + { + "name": "delta", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Indicator of how the metric changed, rendered with an arrow below\nthe metric. If delta is negative (int/float) or starts with a minus\nsign (str), the arrow points down and the text is red; else the\narrow points up and the text is green. If None (default), no delta\nindicator is shown.

\n", + "default": null + }, + { + "name": "delta_color", + "type_name": "str", + "is_optional": false, + "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the metric label.

\n", + "default": null + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/metric.py#L46" + }, + "streamlit.multiselect": { + "name": "multiselect", + "signature": "st.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", max_selections=None)", + "example": "
\n
\nimport streamlit as st\n\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence[V], numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "default", + "type_name": "[V], V, or None", + "is_optional": false, + "description": "

List of default values. Can also be a single value.

\n", + "default": "values." + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of selectbox options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe multiselect.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the multiselect.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this multiselect's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the multiselect widget if set\nto True. The default is False. This argument can only be supplied\nby keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "max_selections", + "type_name": "int", + "is_optional": false, + "description": "

The max selections that can be selected at a time.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list", + "is_generator": false, + "description": "

A list with the selected options

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/multiselect.py#L145" + }, + "streamlit.number_input": { + "name": "number_input", + "signature": "st.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a numeric input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. Output must be purely numeric. This does not impact\nthe return value. Valid formatters: %d %e %f %g %i %u

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this number_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the number input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int or float", + "is_generator": false, + "description": "

The current value of the numeric input widget. The return type\nwill match the data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/number_input.py#L66" + }, + "streamlit.plotly_chart": { + "name": "plotly_chart", + "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", theme=\"streamlit\", **kwargs)", + "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport numpy as np\nimport plotly.figure_factory as ff\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n        hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", + "args": [ + { + "name": "figure_or_data", + "type_name": "plotly.graph_objs.Figure, plotly.graph_objs.Data,", + "is_optional": false, + "description": "

dict/list of plotly.graph_objs.Figure/Data

\n

See https://plot.ly/python/ for examples of graph descriptions.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + }, + { + "name": "sharing", + "type_name": "{'streamlit', 'private', 'secret', 'public'}", + "is_optional": false, + "description": "

Use 'streamlit' to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": null, + "is_optional": null, + "description": "

Any argument accepted by Plotly's plot() function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/plotly_chart.py#L81" + }, + "streamlit.progress": { + "name": "progress", + "signature": "st.progress(value, text=None)", + "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport streamlit as st\nimport time\n\nprogress_text = "Operation in progress. Please wait."\nmy_bar = st.progress(0, text=progress_text)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1, text=progress_text)\n
\n
\n", + "description": "Display a progress bar.", + "args": [ + { + "name": "value", + "type_name": "int or float", + "is_optional": false, + "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", + "default": null + }, + { + "name": "text", + "type_name": "str or None", + "is_optional": false, + "description": "

A message to display above the progress bar. The text can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/progress.py#L66" + }, + "streamlit.pydeck_chart": { + "name": "pydeck_chart", + "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)", + "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport pydeck as pdk\n\nchart_data = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=chart_data,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=chart_data,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", + "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "pydeck_obj", + "type_name": "pydeck.Deck or None", + "is_optional": false, + "description": "

Object specifying the PyDeck chart to draw.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/deck_gl_json_chart.py#L36" + }, + "streamlit.pyplot": { + "name": "pyplot", + "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)", + "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", + "example": "
\n
\nimport streamlit as st\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a matplotlib.pyplot figure.", + "args": [ + { + "name": "fig", + "type_name": "Matplotlib Figure", + "is_optional": false, + "description": "

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

\n", + "default": null + }, + { + "name": "clear_figure", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", + "default": "based" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Arguments to pass to Matplotlib's savefig function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/pyplot.py#L38" + }, + "streamlit.radio": { + "name": "radio", + "signature": "st.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ngenre = st.radio(\n    "What\\'s your favorite movie genre",\n    ('Comedy', 'Drama', 'Documentary'))\n\nif genre == 'Comedy':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn\\'t select comedy.")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a radio button widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this radio group is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the radio options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of radio options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe radio.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the radio.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this radio's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the radio button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "horizontal", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", + "default": "false" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/radio.py#L75" + }, + "streamlit.select_slider": { + "name": "select_slider", + "signature": "st.select_slider(label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\nimport streamlit as st\n\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nimport streamlit as st\n\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n \n (view standalone Streamlit app)\n \n ", + "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the slider options. All options will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", + "default": "." + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to first option.

\n", + "default": "first" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels from the options.\nargument. It receives the option as an argument and its output\nwill be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the select slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this select_slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the select slider if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any value or tuple of any value", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/select_slider.py#L106" + }, + "streamlit.selectbox": { + "name": "selectbox", + "signature": "st.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a select widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels. It receives the option\nas an argument and its output will be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the selectbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this selectbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the selectbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/selectbox.py#L71" + }, + "streamlit.set_option": { + "name": "set_option", + "signature": "st.set_option(key, value)", + "description": "

Set config option.

\n
\n
Currently, only the following config options can be set within the script itself:
\n
    \n
  • client.caching
  • \n
  • client.displayEnabled
  • \n
  • deprecation.*
  • \n
\n
\n
\n

Calling with any other options will raise StreamlitAPIException.

\n

Run streamlit config show in the terminal to see all available options.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

The config option key of the form "section.optionName". To see all\navailable options, run streamlit config show on a terminal.

\n", + "default": null + }, + { + "name": "value", + "type_name": null, + "is_optional": null, + "description": "

The new value to assign to this config option.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/config.py#L89" + }, + "streamlit.set_page_config": { + "name": "set_page_config", + "signature": "st.set_page_config(page_title=None, page_icon=None, layout=\"centered\", initial_sidebar_state=\"auto\", menu_items=None)", + "example": "
\nimport streamlit as st\n\nst.set_page_config(\n    page_title="Ex-stream-ly Cool App",\n    page_icon="\ud83e\uddca",\n    layout="wide",\n    initial_sidebar_state="expanded",\n    menu_items={\n        'Get Help': 'https://www.extremelycoolapp.com/help',\n        'Report a bug': "https://www.extremelycoolapp.com/bug",\n        'About': "# This is a header. This is an *extremely* cool app!"\n    }\n)\n
\n", + "description": "

Configures the default settings of the page.

\n
\n

Note

\n

This must be the first Streamlit command used in your app, and must only\nbe set once.

\n
\n", + "args": [ + { + "name": "page_title", + "type_name": "str or None", + "is_optional": false, + "description": "

The page title, shown in the browser tab. If None, defaults to the\nfilename of the script ("app.py" would show "app \u2022 Streamlit").

\n", + "default": "the" + }, + { + "name": "page_icon", + "type_name": "Anything supported by st.image or str or None", + "is_optional": false, + "description": "

The page favicon.\nBesides the types supported by st.image (like URLs or numpy arrays),\nyou can pass in an emoji as a string ("\ud83e\udd88") or a shortcode (":shark:").\nIf you're feeling lucky, try "random" for a random emoji!\nEmoji icons are courtesy of Twemoji and loaded from MaxCDN.

\n", + "default": null + }, + { + "name": "layout", + "type_name": "\"centered\" or \"wide\"", + "is_optional": false, + "description": "

How the page content should be laid out. Defaults to "centered",\nwhich constrains the elements into a centered column of fixed width;\n"wide" uses the entire screen.

\n", + "default": "s" + }, + { + "name": "initial_sidebar_state", + "type_name": "\"auto\" or \"expanded\" or \"collapsed\"", + "is_optional": false, + "description": "

How the sidebar should start out. Defaults to "auto",\nwhich hides the sidebar on mobile-sized devices, and shows it otherwise.\n"expanded" shows the sidebar initially; "collapsed" hides it.

\n", + "default": "s" + }, + { + "name": "menu_items", + "type_name": "dict", + "is_optional": false, + "description": "

Configure the menu that appears on the top-right side of this app.\nThe keys in this dict denote the menu item you'd like to configure:

\n
    \n
  • \n
    "Get help": str or None
    \n
    The URL this menu item should point to.\nIf None, hides this menu item.
    \n
    \n
  • \n
  • \n
    "Report a Bug": str or None
    \n
    The URL this menu item should point to.\nIf None, hides this menu item.
    \n
    \n
  • \n
  • \n
    "About": str or None
    \n
    A markdown string to show in the About dialog.\nIf None, only shows Streamlit's default About text.
    \n
    \n
  • \n
\n

The URL may also refer to an email address e.g. mailto:john@example.com.

\n", + "default": "About" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/commands/page_config.py#L114" + }, + "streamlit.slider": { + "name": "slider", + "signature": "st.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nimport streamlit as st\n\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nimport streamlit as st\nfrom datetime import time\n\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nimport streamlit as st\nfrom datetime import datetime\n\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The minimum permitted value.\nDefaults to 0 if the value is an int, 0.0 if a float,\nvalue - timedelta(days=14) if a date/datetime, time.min if a time

\n", + "default": "0" + }, + { + "name": "max_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The maximum permitted value.\nDefaults to 100 if the value is an int, 1.0 if a float,\nvalue + timedelta(days=14) if a date/datetime, time.max if a time

\n", + "default": "100" + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to min_value.

\n", + "default": "min_value." + }, + { + "name": "step", + "type_name": "int/float/timedelta or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. This does not impact the return value.\nFormatter for int/float supports: %d %e %f %g %i\nFormatter for date/time/datetime uses Moment.js notation:\nhttps://momentjs.com/docs/#/displaying/format/

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the slider if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int/float/date/time/datetime or tuple of int/float/date/time/datetime", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/slider.py#L171" + }, + "streamlit.snow": { + "name": "snow", + "signature": "st.snow()", + "example": "
\n
\nimport streamlit as st\n\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", + "description": "Draw celebratory snowfall.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/snow.py#L25" + }, + "streamlit.spinner": { + "name": "spinner", + "signature": "st.spinner(text=\"In progress...\")", + "example": "
\n
\nimport time\nimport streamlit as st\n\nwith st.spinner('Wait for it...'):\n    time.sleep(5)\nst.success('Done!')\n
\n
\n", + "description": "Temporarily displays a message while executing a block of code.", + "args": [ + { + "name": "text", + "type_name": "str", + "is_optional": false, + "description": "

A message to display while executing that block

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/spinner.py#L23" + }, + "streamlit.stop": { + "name": "stop", + "signature": "st.stop()", + "example": "
\n
\nimport streamlit as st\n\nname = st.text_input('Name')\nif not name:\n  st.warning('Please input a name.')\n  st.stop()\nst.success('Thank you for inputting a name.')\n
\n
\n", + "description": "

Stops execution immediately.

\n

Streamlit will not run any statements after st.stop().\nWe recommend rendering a message to explain why the script has stopped.\nWhen run outside of Streamlit, this will raise an Exception.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/commands/execution_control.py#L25" + }, + "streamlit.subheader": { + "name": "subheader", + "signature": "st.subheader(body, anchor=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.subheader('This is a subheader')\nst.subheader('A subheader with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "Display text in subheader formatting.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/heading.py#L76" + }, + "streamlit.success": { + "name": "success", + "signature": "st.success(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", + "description": "Display a success message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The success text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/alert.py#L136" + }, + "streamlit.table": { + "name": "table", + "signature": "st.table(data=None)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/dataframe_selector.py#L122" + }, + "streamlit.tabs": { + "name": "tabs", + "signature": "st.tabs(tabs)", + "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\nimport streamlit as st\n\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", + "args": [ + { + "name": "tabs", + "type_name": "list of strings", + "is_optional": false, + "description": "

Creates a tab for each string in the list. The first tab is selected by default.\nThe string is used as the name of the tab and can optionally contain Markdown,\nsupporting the following elements: Bold, Italics, Strikethroughs, Inline Code,\nEmojis, and Links.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": "." + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/layouts.py#L208" + }, + "streamlit.text": { + "name": "text", + "signature": "st.text(body)", + "example": "
\n
\nimport streamlit as st\n\nst.text('This is some text.')\n
\n
\n", + "description": "Write fixed-width and preformatted text.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/text.py#L27" + }, + "streamlit.text_area": { + "name": "text_area", + "signature": "st.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", + "description": "Display a multi-line text input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Maximum number of characters allowed in text area.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the textarea.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_area's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text area is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text area if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/text_widgets.py#L272" + }, + "streamlit.text_input": { + "name": "text_input", + "signature": "st.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a single-line text input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Max number of characters allowed in text input.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str", + "is_optional": false, + "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "autocomplete", + "type_name": "str", + "is_optional": false, + "description": "

An optional value that will be passed to the <input> element's\nautocomplete property. If unspecified, this value will be set to\n"new-password" for "password" inputs, and the empty string for\n"default" inputs. For more details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text input is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/text_widgets.py#L69" + }, + "streamlit.time_input": { + "name": "time_input", + "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a time input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this time input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.time/datetime.datetime", + "is_optional": false, + "description": "

The value of this widget when it first renders. This will be\ncast to str internally. Defaults to the current time.

\n", + "default": "the" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this time_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the time input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.time", + "is_generator": false, + "description": "

The current value of the time input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/time_widgets.py#L212" + }, + "streamlit.title": { + "name": "title", + "signature": "st.title(body, anchor=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.title('This is a title')\nst.title('A title with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/heading.py#L122" + }, + "streamlit.vega_lite_chart": { + "name": "vega_lite_chart", + "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, theme=\"streamlit\", **kwargs)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(chart_data, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", + "description": "Display a chart using the Vega-Lite library.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "spec", + "type_name": "dict or None", + "is_optional": false, + "description": "

The Vega-Lite spec for the chart. If the spec was already passed in\nthe previous argument, this must be set to None. See\nhttps://vega.github.io/vega-lite/docs/ for more info.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Same as spec, but as keywords.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/dataframe_selector.py#L475" + }, + "streamlit.video": { + "name": "video", + "signature": "st.video(data, format=\"video/mp4\", start_time=0)", + "example": "
\n
\nimport streamlit as st\n\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", + "description": "Display a video player.", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "default": null + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the video file. Defaults to 'video/mp4'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/media.py#L117" + }, + "streamlit.warning": { + "name": "warning", + "signature": "st.warning(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", + "description": "Display warning message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The warning text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/alert.py#L71" + }, + "streamlit.write": { + "name": "write", + "signature": "st.write(*args, unsafe_allow_html=False, **kwargs)", + "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nimport streamlit as st\n\nst.write('Hello, *World!* :sunglasses:')\n
\n\n \n \n (view standalone Streamlit app)\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nimport streamlit as st\nimport pandas as pd\n\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n \n (view standalone Streamlit app)\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nimport streamlit as st\n\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n \n (view standalone Streamlit app)\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression, emoji shortcodes, and colored text.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/write.py#L47" + }, + "streamlit.experimental_memo.clear": { + "name": "experimental_memo.clear", + "signature": "st.experimental_memo.clear()", + "description": "Clear all in-memory and on-disk data caches.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/runtime/caching/cache_data_api.py#L445" + }, + "streamlit.cache_data.clear": { + "name": "cache_data.clear", + "signature": "st.cache_data.clear(self)", + "description": "Clear all in-memory and on-disk data caches.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/runtime/caching/cache_data_api.py#L445" + }, + "streamlit.experimental_singleton.clear": { + "name": "experimental_singleton.clear", + "signature": "st.experimental_singleton.clear()", + "description": "Clear all cache_resource caches.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/runtime/caching/cache_resource_api.py#L396" + }, + "streamlit.cache_resource.clear": { + "name": "cache_resource.clear", + "signature": "st.cache_resource.clear(self)", + "description": "Clear all cache_resource caches.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/runtime/caching/cache_resource_api.py#L396" + }, + "streamlit.components.v1.declare_component": { + "name": "declare_component", + "signature": "st.components.v1.declare_component(name, path=None, url=None)", + "description": "Create and register a custom component.", + "args": [ + { + "name": "name", + "type_name": "str", + "is_optional": false, + "description": "

A short, descriptive name for the component. Like, "slider".

\n", + "default": null + }, + { + "name": "path", + "type_name": "str or None", + "is_optional": false, + "description": "

The path to serve the component's frontend files from. Either\npath or url must be specified, but not both.

\n", + "default": null + }, + { + "name": "url", + "type_name": "str or None", + "is_optional": false, + "description": "

The URL that the component is served from. Either path or url\nmust be specified, but not both.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "CustomComponent", + "is_generator": false, + "description": "

A CustomComponent that can be called like a function.\nCalling the component will create a new instance of the component\nin the Streamlit app.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/components/v1/components.py#L246" + }, + "streamlit.components.v1.html": { + "name": "html", + "signature": "st.components.v1.html(html, width=None, height=None, scrolling=False)", + "description": "Display an HTML string in an iframe.", + "args": [ + { + "name": "html", + "type_name": "str", + "is_optional": false, + "description": "

The HTML string to embed in the iframe.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", + "default": "the" + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", + "default": "150." + }, + { + "name": "scrolling", + "type_name": "bool", + "is_optional": false, + "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/iframe.py#L59" + }, + "streamlit.components.v1.iframe": { + "name": "iframe", + "signature": "st.components.v1.iframe(src, width=None, height=None, scrolling=False)", + "description": "Load a remote URL in an iframe.", + "args": [ + { + "name": "src", + "type_name": "str", + "is_optional": false, + "description": "

The URL of the page to embed.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", + "default": "the" + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", + "default": "150." + }, + { + "name": "scrolling", + "type_name": "bool", + "is_optional": false, + "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/iframe.py#L25" + }, + "DeltaGenerator.add_rows": { + "name": "add_rows", + "signature": "element.add_rows(self, data=None, **kwargs)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf1 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table = st.table(df1)\n\ndf2 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table.add_rows(df2)\n# Now the table shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

You can do the same thing with plots. For example, if you want to add\nmore data to a line chart:

\n
\n# Assuming df1 and df2 from the example above still exist...\nmy_chart = st.line_chart(df1)\nmy_chart.add_rows(df2)\n# Now the chart shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

And for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:

\n
\nmy_chart = st.vega_lite_chart({\n    'mark': 'line',\n    'encoding': {'x': 'a', 'y': 'b'},\n    'datasets': {\n      'some_fancy_name': df1,  # <-- named dataset\n     },\n    'data': {'name': 'some_fancy_name'},\n}),\nmy_chart.add_rows(some_fancy_name=df2)  # <-- name used as keyword\n
\n
\n", + "description": "Concatenate a dataframe to the bottom of the current one.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, Iterable, dict, or None", + "is_optional": false, + "description": "

Table to concat. Optional.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "**kwargs", + "type_name": "pandas.DataFrame, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

The named dataset to concat. Optional. You can only pass in 1\ndataset (including the one in the data parameter).

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/dataframe_selector.py#L550" + }, + "DeltaGenerator.altair_chart": { + "name": "altair_chart", + "signature": "element.altair_chart(self, altair_chart, use_container_width=False, theme=\"streamlit\")", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(chart_data).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a chart using the Altair library.", + "args": [ + { + "name": "altair_chart", + "type_name": "altair.vegalite.v2.api.Chart", + "is_optional": false, + "description": "

The Altair chart object to display.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/dataframe_selector.py#L422" + }, + "DeltaGenerator.area_chart": { + "name": "area_chart", + "signature": "element.area_chart(self, data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/dataframe_selector.py#L247" + }, + "DeltaGenerator.audio": { + "name": "audio", + "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0, *, sample_rate=None)", + "example": "
\n
\nimport streamlit as st\nimport numpy as np\n\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n\nsample_rate = 44100  # 44100 samples per second\nseconds = 2  # Note duration of 2 seconds\nfrequency_la = 440  # Our played note will be 440 Hz\n# Generate array with seconds*sample_rate steps, ranging between 0 and seconds\nt = np.linspace(0, seconds, seconds * sample_rate, False)\n# Generate a 440 Hz sine wave\nnote_la = np.sin(frequency_la * t * 2 * np.pi)\n\nst.audio(note_la, sample_rate=sample_rate)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an audio player.", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw audio data, filename, or a URL pointing to the file to load.\nRaw data formats must include all necessary file headers to match the file\nformat specified via format.\nIf data is a numpy array, it must either be a 1D array of the waveform\nor a 2D array of shape (num_channels, num_samples) with waveforms\nfor all channels. See the default channel order at\nhttp://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx

\n", + "default": "channel" + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + }, + { + "name": "sample_rate", + "type_name": "int or None", + "is_optional": false, + "description": "

The sample rate of the audio data in samples per second. Only required if\ndata is a numpy array.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/media.py#L43" + }, + "DeltaGenerator.balloons": { + "name": "balloons", + "signature": "element.balloons(self)", + "example": "
\n
\nimport streamlit as st\n\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", + "description": "Draw celebratory balloons.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/balloons.py#L25" + }, + "DeltaGenerator.bar_chart": { + "name": "bar_chart", + "signature": "element.bar_chart(self, data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/dataframe_selector.py#L334" + }, + "DeltaGenerator.beta_columns": { + "name": "beta_columns", + "signature": "element.beta_columns(self, spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/layouts.py#L77" + }, + "DeltaGenerator.beta_container": { + "name": "beta_container", + "signature": "element.beta_container(self)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/layouts.py#L29" + }, + "DeltaGenerator.beta_expander": { + "name": "beta_expander", + "signature": "element.beta_expander(self, label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/layouts.py#L306" + }, + "DeltaGenerator.bokeh_chart": { + "name": "bokeh_chart", + "signature": "element.bokeh_chart(self, figure, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", + "args": [ + { + "name": "figure", + "type_name": "bokeh.plotting.figure.Figure", + "is_optional": false, + "description": "

A Bokeh figure to plot.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Bokeh's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/bokeh_chart.py#L36" + }, + "DeltaGenerator.button": { + "name": "button", + "signature": "element.button(self, label, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\n\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a button widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, and Emojis.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/button.py#L61" + }, + "DeltaGenerator.camera_input": { + "name": "camera_input", + "signature": "element.camera_input(self, label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", + "description": "Display a widget that returns pictures from the user's webcam.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this widget is used for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the camera input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this camera_input's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile", + "is_generator": false, + "description": "

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/camera_input.py#L109" + }, + "DeltaGenerator.caption": { + "name": "caption", + "signature": "element.caption(self, body, unsafe_allow_html=False)", + "examples": "
\n
\nimport streamlit as st\n\nst.caption('This is a string that explains something above.')\nst.caption('A caption with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/markdown.py#L119" + }, + "DeltaGenerator.checkbox": { + "name": "checkbox", + "signature": "element.checkbox(self, label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a checkbox widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this checkbox is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "value", + "type_name": "bool", + "is_optional": false, + "description": "

Preselect the checkbox when it first renders. This will be\ncast to bool internally.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the checkbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this checkbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

Whether or not the checkbox is checked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/checkbox.py#L52" + }, + "DeltaGenerator.code": { + "name": "code", + "signature": "element.code(self, body, language=\"python\")", + "example": "
\n
\nimport streamlit as st\n\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", + "description": "

Display a code block with optional syntax highlighting.

\n

(This is a convenience wrapper around st.markdown())

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as code.

\n", + "default": null + }, + { + "name": "language", + "type_name": "str or None", + "is_optional": false, + "description": "

The language that the code is written in, for syntax highlighting.\nIf None, the code will be unstyled. Defaults to "python".

\n

For a list of available language values, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/markdown.py#L83" + }, + "DeltaGenerator.color_picker": { + "name": "color_picker", + "signature": "element.color_picker(self, label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a color picker widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "str", + "is_optional": false, + "description": "

The hex value of this widget when it first renders. If None,\ndefaults to black.

\n", + "default": "black." + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the color picker.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this color_picker's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The selected color as a hex string.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/color_picker.py#L52" + }, + "DeltaGenerator.columns": { + "name": "columns", + "signature": "element.columns(self, spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/layouts.py#L77" + }, + "DeltaGenerator.container": { + "name": "container", + "signature": "element.container(self)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/layouts.py#L29" + }, + "DeltaGenerator.dataframe": { + "name": "dataframe", + "signature": "element.dataframe(self, data=None, width=None, height=None, *, use_container_width=False)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\nst.dataframe(df, 200, 100)\n
\n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a dataframe as an interactive table.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. (It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.)\nStyler support is experimental!\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the dataframe expressed in pixels. If None, the width\nwill be automatically calculated based on the column content.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the dataframe expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the dataframe width to the width of the parent container.\nThis takes precedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/dataframe_selector.py#L40" + }, + "DeltaGenerator.date_input": { + "name": "date_input", + "signature": "element.date_input(self, label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nd = st.date_input(\n    "When\\'s your birthday",\n    datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a date input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this date input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", + "is_optional": false, + "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", + "default": "today" + }, + { + "name": "min_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", + "default": "value" + }, + { + "name": "max_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", + "default": "value" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this date_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.date or a tuple with 0-2 dates", + "is_generator": false, + "description": "

The current value of the date input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/time_widgets.py#L380" + }, + "DeltaGenerator.download_button": { + "name": "download_button", + "signature": "element.download_button(self, label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False, use_container_width=False)", + "examples": "
\n

Download a large DataFrame as a CSV:

\n
\nimport streamlit as st\n\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\nimport streamlit as st\n\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nimport streamlit as st\n\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nimport streamlit as st\n\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, and Emojis.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "data", + "type_name": "str or bytes or file", + "is_optional": false, + "description": "

The contents of the file to be downloaded. See example below for\ncaching techniques to avoid recomputing this data unnecessarily.

\n", + "default": null + }, + { + "name": "file_name", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the name of the file to be downloaded,\nsuch as 'my_file.csv'. If not specified, the name will be\nautomatically generated.

\n", + "default": null + }, + { + "name": "mime", + "type_name": "str or None", + "is_optional": false, + "description": "

The MIME type of the data. If None, defaults to "text/plain"\n(if data is of type str or is a textual file) or\n"application/octet-stream" (if data is of type bytes or is a\nbinary file).

\n", + "default": "s" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/button.py#L155" + }, + "DeltaGenerator.empty": { + "name": "empty", + "signature": "element.empty(self)", + "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport streamlit as st\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nimport streamlit as st\n\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", + "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/empty.py#L24" + }, + "DeltaGenerator.error": { + "name": "error", + "signature": "element.error(self, body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", + "description": "Display error message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The error text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/alert.py#L39" + }, + "DeltaGenerator.exception": { + "name": "exception", + "signature": "element.exception(self, exception)", + "example": "
\n
\nimport streamlit as st\n\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", + "description": "Display an exception.", + "args": [ + { + "name": "exception", + "type_name": "Exception", + "is_optional": false, + "description": "

The exception to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/exception.py#L50" + }, + "DeltaGenerator.expander": { + "name": "expander", + "signature": "element.expander(self, label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/layouts.py#L306" + }, + "DeltaGenerator.experimental_data_editor": { + "name": "experimental_data_editor", + "signature": "element.experimental_data_editor(self, data, *, width=None, height=None, use_container_width=False, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.experimental_data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.experimental_data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n
\n", + "description": "

Display a data editor widget.

\n

Display a data editor widget that allows you to edit DataFrames and\nmany other data structures in a table-like UI.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None", + "is_optional": false, + "description": "

The data to edit in the data editor.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the data editor expressed in pixels. If None, the width\nwill be automatically calculated based on the container width.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the data editor expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the data editor width to the width of the parent container.\nThis takes precedence over the width argument. Defaults to False.

\n", + "default": "False." + }, + { + "name": "num_rows", + "type_name": "\"fixed\" or \"dynamic\"", + "is_optional": false, + "description": "

Specifies if the user can add and delete rows in the data editor.\nIf "fixed", the user cannot add or delete rows. If "dynamic", the user can\nadd and delete rows in the data editor, but column sorting is disabled.\nDefaults to "fixed".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean which, if True, disables the data editor and prevents\nany edits. Defaults to False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the unique key for this widget. If this\nis omitted, a key will be generated for the widget based on its\ncontent. Multiple widgets of the same type may not share the same\nkey.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this data_editor's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "pd.DataFrame, pd.Styler, pyarrow.Table, np.ndarray, list, set, tuple, or dict.", + "is_generator": false, + "description": "

The edited data. The edited data is returned in its original data type if\nit corresponds to any of the supported return types. All other data types\nare returned as a pd.DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/data_editor.py#L448" + }, + "DeltaGenerator.file_uploader": { + "name": "file_uploader", + "signature": "element.file_uploader(self, label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nimport streamlit as st\nimport pandas as pd\nfrom io import StringIO\n\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nimport streamlit as st\n\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this file uploader is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str or list of str or None", + "is_optional": false, + "description": "

Array of allowed extensions. ['png', 'jpg']\nThe default is None, which means all extensions are allowed.

\n", + "default": "None" + }, + { + "name": "accept_multiple_files", + "type_name": "bool", + "is_optional": false, + "description": "

If True, allows the user to upload multiple files at the same time,\nin which case the return value will be a list of files.\nDefault: False

\n", + "default": "False" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the file uploader.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this file_uploader's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the file uploader if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile or list of UploadedFile", + "is_generator": false, + "description": "
    \n
  • If accept_multiple_files is False, returns either None or\nan UploadedFile object.
  • \n
  • If accept_multiple_files is True, returns a list with the\nuploaded files as UploadedFile objects. If no files were\nuploaded, returns an empty list.
  • \n
\n

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/file_uploader.py#L205" + }, + "DeltaGenerator.form": { + "name": "form", + "signature": "element.form(self, key, clear_on_submit=False)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n

Inserting elements out of order:

\n
\nimport streamlit as st\n\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n
\n", + "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

A string that identifies the form. Each form must have its own\nkey. (This key is not displayed to the user in the interface.)

\n", + "default": null + }, + { + "name": "clear_on_submit", + "type_name": "bool", + "is_optional": false, + "description": "

If True, all widgets inside the form will be reset to their default\nvalues after the user presses the Submit button. Defaults to False.\n(Note that Custom Components are unaffected by this flag, and\nwill not be reset to their defaults on form submission.)

\n", + "default": "values" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/form.py#L118" + }, + "DeltaGenerator.form_submit_button": { + "name": "form_submit_button", + "signature": "element.form_submit_button(self, label=\"Submit\", help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nDefaults to "Submit".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

A tooltip that gets displayed when the button is hovered over.\nDefaults to None.

\n", + "default": "None." + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/form.py#L211" + }, + "DeltaGenerator.graphviz_chart": { + "name": "graphviz_chart", + "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nimport graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a graph using the dagre-d3 library.", + "args": [ + { + "name": "figure_or_dot", + "type_name": "graphviz.dot.Graph, graphviz.dot.Digraph, str", + "is_optional": false, + "description": "

The Graphlib graph object or dot string to display

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/graphviz_chart.py#L39" + }, + "DeltaGenerator.header": { + "name": "header", + "signature": "element.header(self, body, anchor=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.header('This is a header')\nst.header('A header with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "Display text in header formatting.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/heading.py#L31" + }, + "DeltaGenerator.help": { + "name": "help", + "signature": "element.help(self, obj)", + "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nimport streamlit as st\nimport pandas\n\nst.help(pandas.DataFrame)\n
\n

Want to quickly check what datatype is output by a certain function?\nTry:

\n
\nimport streamlit as st\n\nx = my_poorly_documented_function()\nst.help(x)\n
\n
\n", + "description": "

Display object's doc string, nicely formatted.

\n

Displays the doc string for this object.

\n", + "args": [ + { + "name": "obj", + "type_name": "Object", + "is_optional": false, + "description": "

The object whose docstring should be displayed.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/doc_string.py#L44" + }, + "DeltaGenerator.image": { + "name": "image", + "signature": "element.image(self, image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", + "example": "
\n
\nimport streamlit as st\nfrom PIL import Image\n\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an image or list of images.", + "args": [ + { + "name": "image", + "type_name": "numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]", + "is_optional": false, + "description": "

Monochrome image of shape (w,h) or (w,h,1)\nOR a color image of shape (w,h,3)\nOR an RGBA image of shape (w,h,4)\nOR a URL to fetch the image from\nOR a path of a local image file\nOR an SVG XML string like <svg xmlns=...</svg>\nOR a list of one of the above, to display multiple images.

\n", + "default": null + }, + { + "name": "caption", + "type_name": "str or list of str", + "is_optional": false, + "description": "

Image caption. If displaying multiple images, caption should be a\nlist of captions (one for each image).

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Image width. None means use the image width,\nbut do not exceed the width of the column.\nShould be set for SVG images, as they have no default image width.

\n", + "default": "image" + }, + { + "name": "use_column_width", + "type_name": "'auto' or 'always' or 'never' or bool", + "is_optional": false, + "description": "

If 'auto', set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf 'always' or True, set the image's width to the column width.\nIf 'never' or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", + "default": null + }, + { + "name": "clamp", + "type_name": "bool", + "is_optional": false, + "description": "

Clamp image pixel values to a valid range ([0-255] per channel).\nThis is only meaningful for byte array images; the parameter is\nignored for image URLs. If this is not set, and an image has an\nout-of-range value, an error will be thrown.

\n", + "default": null + }, + { + "name": "channels", + "type_name": "'RGB' or 'BGR'", + "is_optional": false, + "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to 'RGB', meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to 'BGR', instead.

\n", + "default": "s" + }, + { + "name": "output_format", + "type_name": "'JPEG', 'PNG', or 'auto'", + "is_optional": false, + "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to 'auto' which identifies the compression type based\non the type and format of the image argument.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/image.py#L67" + }, + "DeltaGenerator.info": { + "name": "info", + "signature": "element.info(self, body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", + "description": "Display an informational message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The info text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/alert.py#L103" + }, + "DeltaGenerator.json": { + "name": "json", + "signature": "element.json(self, body, *, expanded=True)", + "example": "
\n
\nimport streamlit as st\n\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display object or string as a pretty-printed JSON string.", + "args": [ + { + "name": "body", + "type_name": "object or str", + "is_optional": false, + "description": "

The object to print as JSON. All referenced objects should be\nserializable to JSON as well. If object is a string, we assume it\ncontains serialized JSON.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean that allows the user to set whether the initial\nstate of this json element should be expanded. Defaults to True.\nThis argument can only be supplied by keyword.

\n", + "default": "True." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/json.py#L35" + }, + "DeltaGenerator.latex": { + "name": "latex", + "signature": "element.latex(self, body)", + "example": "
\n
\nimport streamlit as st\n\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", + "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", + "args": [ + { + "name": "body", + "type_name": "str or SymPy expression", + "is_optional": false, + "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/markdown.py#L174" + }, + "DeltaGenerator.line_chart": { + "name": "line_chart", + "signature": "element.line_chart(self, data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\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 \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict or None", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/dataframe_selector.py#L160" + }, + "DeltaGenerator.map": { + "name": "map", + "signature": "element.map(self, data=None, zoom=None, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a map with points on it.

\n

This is a wrapper around st.pydeck_chart to quickly create scatterplot\ncharts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more\ninfo on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to be plotted. Must have two columns:

\n
    \n
  • latitude called 'lat', 'latitude', 'LAT', 'LATITUDE'
  • \n
  • longitude called 'lon', 'longitude', 'LON', 'LONGITUDE'.
  • \n
\n", + "default": null + }, + { + "name": "zoom", + "type_name": "int", + "is_optional": false, + "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/map.py#L76" + }, + "DeltaGenerator.markdown": { + "name": "markdown", + "signature": "element.markdown(self, body, unsafe_allow_html=False)", + "examples": "
\n
\nimport streamlit as st\n\nst.markdown('Streamlit is **_really_ cool**.')\nst.markdown(\u201dThis text is :red[colored red], and this is **:blue[colored]** and bold.\u201d)\nst.markdown(":green[$\\sqrt{x^2+y^2}=1$] is a Pythagorean identity. :pencil:")\n
\n
\n", + "description": "Display string formatted as Markdown.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/markdown.py#L29" + }, + "DeltaGenerator.metric": { + "name": "metric", + "signature": "element.metric(self, label, value, delta=None, delta_color=\"normal\", help=None, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n \n (view standalone Streamlit app)\n \n

st.metric looks especially nice in combination with st.columns:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n \n (view standalone Streamlit app)\n \n

The delta indicator color can also be inverted or turned off:

\n
\nimport streamlit as st\n\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

The header or title for the metric. The label can optionally contain\nMarkdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Value of the metric. None is rendered as a long dash.

\n", + "default": null + }, + { + "name": "delta", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Indicator of how the metric changed, rendered with an arrow below\nthe metric. If delta is negative (int/float) or starts with a minus\nsign (str), the arrow points down and the text is red; else the\narrow points up and the text is green. If None (default), no delta\nindicator is shown.

\n", + "default": null + }, + { + "name": "delta_color", + "type_name": "str", + "is_optional": false, + "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the metric label.

\n", + "default": null + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/metric.py#L46" + }, + "DeltaGenerator.multiselect": { + "name": "multiselect", + "signature": "element.multiselect(self, label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", max_selections=None)", + "example": "
\n
\nimport streamlit as st\n\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence[V], numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "default", + "type_name": "[V], V, or None", + "is_optional": false, + "description": "

List of default values. Can also be a single value.

\n", + "default": "values." + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of selectbox options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe multiselect.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the multiselect.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this multiselect's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the multiselect widget if set\nto True. The default is False. This argument can only be supplied\nby keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "max_selections", + "type_name": "int", + "is_optional": false, + "description": "

The max selections that can be selected at a time.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list", + "is_generator": false, + "description": "

A list with the selected options

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/multiselect.py#L145" + }, + "DeltaGenerator.number_input": { + "name": "number_input", + "signature": "element.number_input(self, label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a numeric input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. Output must be purely numeric. This does not impact\nthe return value. Valid formatters: %d %e %f %g %i %u

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this number_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the number input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int or float", + "is_generator": false, + "description": "

The current value of the numeric input widget. The return type\nwill match the data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/number_input.py#L66" + }, + "DeltaGenerator.plotly_chart": { + "name": "plotly_chart", + "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", theme=\"streamlit\", **kwargs)", + "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport numpy as np\nimport plotly.figure_factory as ff\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n        hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", + "args": [ + { + "name": "figure_or_data", + "type_name": "plotly.graph_objs.Figure, plotly.graph_objs.Data,", + "is_optional": false, + "description": "

dict/list of plotly.graph_objs.Figure/Data

\n

See https://plot.ly/python/ for examples of graph descriptions.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + }, + { + "name": "sharing", + "type_name": "{'streamlit', 'private', 'secret', 'public'}", + "is_optional": false, + "description": "

Use 'streamlit' to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": null, + "is_optional": null, + "description": "

Any argument accepted by Plotly's plot() function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/plotly_chart.py#L81" + }, + "DeltaGenerator.progress": { + "name": "progress", + "signature": "element.progress(self, value, text=None)", + "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport streamlit as st\nimport time\n\nprogress_text = "Operation in progress. Please wait."\nmy_bar = st.progress(0, text=progress_text)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1, text=progress_text)\n
\n
\n", + "description": "Display a progress bar.", + "args": [ + { + "name": "value", + "type_name": "int or float", + "is_optional": false, + "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", + "default": null + }, + { + "name": "text", + "type_name": "str or None", + "is_optional": false, + "description": "

A message to display above the progress bar. The text can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/progress.py#L66" + }, + "DeltaGenerator.pydeck_chart": { + "name": "pydeck_chart", + "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)", + "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport pydeck as pdk\n\nchart_data = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=chart_data,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=chart_data,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", + "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "pydeck_obj", + "type_name": "pydeck.Deck or None", + "is_optional": false, + "description": "

Object specifying the PyDeck chart to draw.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/deck_gl_json_chart.py#L36" + }, + "DeltaGenerator.pyplot": { + "name": "pyplot", + "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)", + "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", + "example": "
\n
\nimport streamlit as st\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a matplotlib.pyplot figure.", + "args": [ + { + "name": "fig", + "type_name": "Matplotlib Figure", + "is_optional": false, + "description": "

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

\n", + "default": null + }, + { + "name": "clear_figure", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", + "default": "based" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Arguments to pass to Matplotlib's savefig function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/pyplot.py#L38" + }, + "DeltaGenerator.radio": { + "name": "radio", + "signature": "element.radio(self, label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ngenre = st.radio(\n    "What\\'s your favorite movie genre",\n    ('Comedy', 'Drama', 'Documentary'))\n\nif genre == 'Comedy':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn\\'t select comedy.")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a radio button widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this radio group is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the radio options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of radio options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe radio.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the radio.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this radio's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the radio button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "horizontal", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", + "default": "false" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/radio.py#L75" + }, + "DeltaGenerator.select_slider": { + "name": "select_slider", + "signature": "element.select_slider(self, label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\nimport streamlit as st\n\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nimport streamlit as st\n\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n \n (view standalone Streamlit app)\n \n ", + "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the slider options. All options will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", + "default": "." + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to first option.

\n", + "default": "first" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels from the options.\nargument. It receives the option as an argument and its output\nwill be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the select slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this select_slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the select slider if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any value or tuple of any value", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/select_slider.py#L106" + }, + "DeltaGenerator.selectbox": { + "name": "selectbox", + "signature": "element.selectbox(self, label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a select widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels. It receives the option\nas an argument and its output will be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the selectbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this selectbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the selectbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/selectbox.py#L71" + }, + "DeltaGenerator.slider": { + "name": "slider", + "signature": "element.slider(self, label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nimport streamlit as st\n\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nimport streamlit as st\nfrom datetime import time\n\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nimport streamlit as st\nfrom datetime import datetime\n\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The minimum permitted value.\nDefaults to 0 if the value is an int, 0.0 if a float,\nvalue - timedelta(days=14) if a date/datetime, time.min if a time

\n", + "default": "0" + }, + { + "name": "max_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The maximum permitted value.\nDefaults to 100 if the value is an int, 1.0 if a float,\nvalue + timedelta(days=14) if a date/datetime, time.max if a time

\n", + "default": "100" + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to min_value.

\n", + "default": "min_value." + }, + { + "name": "step", + "type_name": "int/float/timedelta or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. This does not impact the return value.\nFormatter for int/float supports: %d %e %f %g %i\nFormatter for date/time/datetime uses Moment.js notation:\nhttps://momentjs.com/docs/#/displaying/format/

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the slider if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int/float/date/time/datetime or tuple of int/float/date/time/datetime", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/slider.py#L171" + }, + "DeltaGenerator.snow": { + "name": "snow", + "signature": "element.snow(self)", + "example": "
\n
\nimport streamlit as st\n\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", + "description": "Draw celebratory snowfall.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/snow.py#L25" + }, + "DeltaGenerator.subheader": { + "name": "subheader", + "signature": "element.subheader(self, body, anchor=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.subheader('This is a subheader')\nst.subheader('A subheader with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "Display text in subheader formatting.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/heading.py#L76" + }, + "DeltaGenerator.success": { + "name": "success", + "signature": "element.success(self, body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", + "description": "Display a success message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The success text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/alert.py#L136" + }, + "DeltaGenerator.table": { + "name": "table", + "signature": "element.table(self, data=None)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/dataframe_selector.py#L122" + }, + "DeltaGenerator.tabs": { + "name": "tabs", + "signature": "element.tabs(self, tabs)", + "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\nimport streamlit as st\n\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", + "args": [ + { + "name": "tabs", + "type_name": "list of strings", + "is_optional": false, + "description": "

Creates a tab for each string in the list. The first tab is selected by default.\nThe string is used as the name of the tab and can optionally contain Markdown,\nsupporting the following elements: Bold, Italics, Strikethroughs, Inline Code,\nEmojis, and Links.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": "." + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/layouts.py#L208" + }, + "DeltaGenerator.text": { + "name": "text", + "signature": "element.text(self, body)", + "example": "
\n
\nimport streamlit as st\n\nst.text('This is some text.')\n
\n
\n", + "description": "Write fixed-width and preformatted text.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/text.py#L27" + }, + "DeltaGenerator.text_area": { + "name": "text_area", + "signature": "element.text_area(self, label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", + "description": "Display a multi-line text input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Maximum number of characters allowed in text area.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the textarea.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_area's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text area is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text area if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/text_widgets.py#L272" + }, + "DeltaGenerator.text_input": { + "name": "text_input", + "signature": "element.text_input(self, label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a single-line text input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Max number of characters allowed in text input.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str", + "is_optional": false, + "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "autocomplete", + "type_name": "str", + "is_optional": false, + "description": "

An optional value that will be passed to the <input> element's\nautocomplete property. If unspecified, this value will be set to\n"new-password" for "password" inputs, and the empty string for\n"default" inputs. For more details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text input is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/text_widgets.py#L69" + }, + "DeltaGenerator.time_input": { + "name": "time_input", + "signature": "element.time_input(self, label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a time input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this time input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.time/datetime.datetime", + "is_optional": false, + "description": "

The value of this widget when it first renders. This will be\ncast to str internally. Defaults to the current time.

\n", + "default": "the" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this time_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the time input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.time", + "is_generator": false, + "description": "

The current value of the time input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/time_widgets.py#L212" + }, + "DeltaGenerator.title": { + "name": "title", + "signature": "element.title(self, body, anchor=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.title('This is a title')\nst.title('A title with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/heading.py#L122" + }, + "DeltaGenerator.vega_lite_chart": { + "name": "vega_lite_chart", + "signature": "element.vega_lite_chart(self, data=None, spec=None, use_container_width=False, theme=\"streamlit\", **kwargs)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(chart_data, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", + "description": "Display a chart using the Vega-Lite library.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "spec", + "type_name": "dict or None", + "is_optional": false, + "description": "

The Vega-Lite spec for the chart. If the spec was already passed in\nthe previous argument, this must be set to None. See\nhttps://vega.github.io/vega-lite/docs/ for more info.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Same as spec, but as keywords.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/dataframe_selector.py#L475" + }, + "DeltaGenerator.video": { + "name": "video", + "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)", + "example": "
\n
\nimport streamlit as st\n\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", + "description": "Display a video player.", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "default": null + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the video file. Defaults to 'video/mp4'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/media.py#L117" + }, + "DeltaGenerator.warning": { + "name": "warning", + "signature": "element.warning(self, body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", + "description": "Display warning message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The warning text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/alert.py#L71" + }, + "DeltaGenerator.write": { + "name": "write", + "signature": "element.write(self, *args, unsafe_allow_html=False, **kwargs)", + "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nimport streamlit as st\n\nst.write('Hello, *World!* :sunglasses:')\n
\n\n \n \n (view standalone Streamlit app)\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nimport streamlit as st\nimport pandas as pd\n\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n \n (view standalone Streamlit app)\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nimport streamlit as st\n\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n \n (view standalone Streamlit app)\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression, emoji shortcodes, and colored text.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.18.0/lib/streamlit/elements/write.py#L47" + } + }, + "1.19.0": { + "streamlit.altair_chart": { + "name": "altair_chart", + "signature": "st.altair_chart(altair_chart, use_container_width=False, theme=\"streamlit\")", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(chart_data).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a chart using the Altair library.", + "args": [ + { + "name": "altair_chart", + "type_name": "altair.vegalite.v2.api.Chart", + "is_optional": false, + "description": "

The Altair chart object to display.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/dataframe_selector.py#L422" + }, + "streamlit.area_chart": { + "name": "area_chart", + "signature": "st.area_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/dataframe_selector.py#L247" + }, + "streamlit.audio": { + "name": "audio", + "signature": "st.audio(data, format=\"audio/wav\", start_time=0, *, sample_rate=None)", + "example": "
\n
\nimport streamlit as st\nimport numpy as np\n\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n\nsample_rate = 44100  # 44100 samples per second\nseconds = 2  # Note duration of 2 seconds\nfrequency_la = 440  # Our played note will be 440 Hz\n# Generate array with seconds*sample_rate steps, ranging between 0 and seconds\nt = np.linspace(0, seconds, seconds * sample_rate, False)\n# Generate a 440 Hz sine wave\nnote_la = np.sin(frequency_la * t * 2 * np.pi)\n\nst.audio(note_la, sample_rate=sample_rate)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an audio player.", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw audio data, filename, or a URL pointing to the file to load.\nRaw data formats must include all necessary file headers to match the file\nformat specified via format.\nIf data is a numpy array, it must either be a 1D array of the waveform\nor a 2D array of shape (num_channels, num_samples) with waveforms\nfor all channels. See the default channel order at\nhttp://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx

\n", + "default": "channel" + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + }, + { + "name": "sample_rate", + "type_name": "int or None", + "is_optional": false, + "description": "

The sample rate of the audio data in samples per second. Only required if\ndata is a numpy array.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/media.py#L43" + }, + "streamlit.balloons": { + "name": "balloons", + "signature": "st.balloons()", + "example": "
\n
\nimport streamlit as st\n\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", + "description": "Draw celebratory balloons.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/balloons.py#L25" + }, + "streamlit.bar_chart": { + "name": "bar_chart", + "signature": "st.bar_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/dataframe_selector.py#L334" + }, + "streamlit.beta_columns": { + "name": "beta_columns", + "signature": "st.beta_columns(spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/layouts.py#L77" + }, + "streamlit.beta_container": { + "name": "beta_container", + "signature": "st.beta_container()", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/layouts.py#L29" + }, + "streamlit.beta_expander": { + "name": "beta_expander", + "signature": "st.beta_expander(label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/layouts.py#L306" + }, + "streamlit.bokeh_chart": { + "name": "bokeh_chart", + "signature": "st.bokeh_chart(figure, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", + "args": [ + { + "name": "figure", + "type_name": "bokeh.plotting.figure.Figure", + "is_optional": false, + "description": "

A Bokeh figure to plot.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Bokeh's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/bokeh_chart.py#L36" + }, + "streamlit.button": { + "name": "button", + "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\n\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a button widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, and Emojis.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/button.py#L61" + }, + "streamlit.cache": { + "name": "cache", + "signature": "st.cache(func=None, persist=False, allow_output_mutation=False, show_spinner=True, suppress_st_warning=False, hash_funcs=None, max_entries=None, ttl=None)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\n@st.cache(persist=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To disable hashing return values, set the allow_output_mutation parameter to True:

\n
\n@st.cache(allow_output_mutation=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. MongoClient) to a hash function (id) like this:

\n
\n@st.cache(hash_funcs={MongoClient: id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "pymongo.mongo_client.MongoClient") to the hash function instead:

\n
\n@st.cache(hash_funcs={"pymongo.mongo_client.MongoClient": id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n
\n", + "description": "Function decorator to memoize function executions.", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to cache. Streamlit hashes the function and dependent code.

\n", + "default": null + }, + { + "name": "persist", + "type_name": "boolean", + "is_optional": false, + "description": "

Whether to persist the cache on disk.

\n", + "default": null + }, + { + "name": "allow_output_mutation", + "type_name": "boolean", + "is_optional": false, + "description": "

Streamlit shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.

\n

If you know what you're doing and would like to override this warning, set this to True.

\n", + "default": null + }, + { + "name": "show_spinner", + "type_name": "boolean", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na cache miss.

\n", + "default": "True" + }, + { + "name": "suppress_st_warning", + "type_name": "boolean", + "is_optional": false, + "description": "

Suppress warnings about calling Streamlit commands from within\nthe cached function.

\n", + "default": null + }, + { + "name": "hash_funcs", + "type_name": "dict or None", + "is_optional": false, + "description": "

Mapping of types or fully qualified names to hash functions. This is used to override\nthe behavior of the hasher inside Streamlit's caching mechanism: when the hasher\nencounters an object, it will first check to see if its type matches a key in this\ndict and, if so, will use the provided function to generate a hash for it. See below\nfor an example of how this can be used.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." + }, + { + "name": "ttl", + "type_name": "float or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.

\n", + "default": "None." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/runtime/legacy_caching/caching.py#L486" + }, + "streamlit.cache_data": { + "name": "cache_data", + "signature": "st.cache_data(func=None, *, ttl, max_entries, show_spinner, persist, experimental_allow_widgets)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\nimport streamlit as st\n\n@st.cache_data(persist="disk")\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

By default, all parameters to a cached function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nconnection = make_database_connection()\nd1 = fetch_and_clean_data(connection, num_rows=10)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nanother_connection = make_database_connection()\nd2 = fetch_and_clean_data(another_connection, num_rows=10)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _database_connection parameter was different\n# in both calls.\n
\n

A cached function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nfetch_and_clean_data.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Decorator to cache functions that return data (e.g. dataframe transforms, database queries, ML inference).

\n

Cached objects are stored in "pickled" form, which means that the return\nvalue of a cached function must be pickleable. Each caller of the cached\nfunction gets its own copy of the cached data.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_data.clear().

\n

To cache global resources, use st.cache_resource instead. Learn more\nabout caching at https://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to cache. Streamlit hashes the function's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float or timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.\nNote that ttl is incompatible with persist="disk" - ttl will be\nignored if persist is specified.

\n", + "default": "None." + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." + }, + { + "name": "show_spinner", + "type_name": "boolean", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na cache miss.

\n", + "default": "True" + }, + { + "name": "persist", + "type_name": "str or boolean or None", + "is_optional": false, + "description": "

Optional location to persist cached data to. Passing "disk" (or True)\nwill persist the cached data to the local disk. None (or False) will disable\npersistence. The default is None.

\n", + "default": "None." + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/runtime/caching/cache_data_api.py#L274" + }, + "streamlit.cache_resource": { + "name": "cache_resource", + "signature": "st.cache_resource(func, *, ttl, max_entries, show_spinner, validate, experimental_allow_widgets)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(url):\n    # Create a database session object that points to the URL.\n    return session\n\ns1 = get_database_session(SESSION_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(SESSION_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the connection object in s1 is the same as in s2.\n\ns3 = get_database_session(SESSION_URL_2)\n# This is a different URL, so the function executes.\n
\n

By default, all parameters to a cache_resource function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\ns1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _sessionmaker parameter was different\n# in both calls.\n
\n

A cache_resource function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\nget_database_session.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Decorator to cache functions that return global resources (e.g. database connections, ML models).

\n

Cached objects are shared across all users, sessions, and reruns. They\nmust be thread-safe because they can be accessed from multiple threads\nconcurrently. If thread safety is an issue, consider using st.session_state\nto store resources per session instead.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_resource.clear().

\n

To cache data, use st.cache_data instead. Learn more about caching at\nhttps://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function that creates the cached resource. Streamlit hashes the\nfunction's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float or timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.

\n", + "default": "None." + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached resource is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "validate", + "type_name": "callable or None", + "is_optional": false, + "description": "

An optional validation function for cached data. validate is called\neach time the cached value is accessed. It receives the cached value as\nits only parameter and it must return a boolean. If validate returns\nFalse, the current cached value is discarded, and the decorated function\nis called to compute a new value. This is useful e.g. to check the\nhealth of database connections.

\n", + "default": null + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/runtime/caching/cache_resource_api.py#L258" + }, + "streamlit.camera_input": { + "name": "camera_input", + "signature": "st.camera_input(label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", + "description": "Display a widget that returns pictures from the user's webcam.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this widget is used for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the camera input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this camera_input's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile", + "is_generator": false, + "description": "

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/camera_input.py#L109" + }, + "streamlit.caption": { + "name": "caption", + "signature": "st.caption(body, unsafe_allow_html=False)", + "examples": "
\n
\nimport streamlit as st\n\nst.caption('This is a string that explains something above.')\nst.caption('A caption with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/markdown.py#L119" + }, + "streamlit.checkbox": { + "name": "checkbox", + "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a checkbox widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this checkbox is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "value", + "type_name": "bool", + "is_optional": false, + "description": "

Preselect the checkbox when it first renders. This will be\ncast to bool internally.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the checkbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this checkbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

Whether or not the checkbox is checked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/checkbox.py#L52" + }, + "streamlit.code": { + "name": "code", + "signature": "st.code(body, language=\"python\")", + "example": "
\n
\nimport streamlit as st\n\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", + "description": "

Display a code block with optional syntax highlighting.

\n

(This is a convenience wrapper around st.markdown())

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as code.

\n", + "default": null + }, + { + "name": "language", + "type_name": "str or None", + "is_optional": false, + "description": "

The language that the code is written in, for syntax highlighting.\nIf None, the code will be unstyled. Defaults to "python".

\n

For a list of available language values, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/markdown.py#L83" + }, + "streamlit.color_picker": { + "name": "color_picker", + "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a color picker widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "str", + "is_optional": false, + "description": "

The hex value of this widget when it first renders. If None,\ndefaults to black.

\n", + "default": "black." + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the color picker.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this color_picker's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The selected color as a hex string.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/color_picker.py#L52" + }, + "streamlit.columns": { + "name": "columns", + "signature": "st.columns(spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/layouts.py#L77" + }, + "streamlit.container": { + "name": "container", + "signature": "st.container()", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/layouts.py#L29" + }, + "streamlit.dataframe": { + "name": "dataframe", + "signature": "st.dataframe(data=None, width=None, height=None, *, use_container_width=False)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\nst.dataframe(df, 200, 100)\n
\n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a dataframe as an interactive table.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. (It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.)\nStyler support is experimental!\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the dataframe expressed in pixels. If None, the width\nwill be automatically calculated based on the column content.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the dataframe expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the dataframe width to the width of the parent container.\nThis takes precedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/dataframe_selector.py#L40" + }, + "streamlit.date_input": { + "name": "date_input", + "signature": "st.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nd = st.date_input(\n    "When\\'s your birthday",\n    datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a date input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this date input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", + "is_optional": false, + "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", + "default": "today" + }, + { + "name": "min_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", + "default": "value" + }, + { + "name": "max_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", + "default": "value" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this date_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.date or a tuple with 0-2 dates", + "is_generator": false, + "description": "

The current value of the date input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/time_widgets.py#L380" + }, + "streamlit.download_button": { + "name": "download_button", + "signature": "st.download_button(label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False, use_container_width=False)", + "examples": "
\n

Download a large DataFrame as a CSV:

\n
\nimport streamlit as st\n\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\nimport streamlit as st\n\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nimport streamlit as st\n\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nimport streamlit as st\n\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, and Emojis.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "data", + "type_name": "str or bytes or file", + "is_optional": false, + "description": "

The contents of the file to be downloaded. See example below for\ncaching techniques to avoid recomputing this data unnecessarily.

\n", + "default": null + }, + { + "name": "file_name", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the name of the file to be downloaded,\nsuch as 'my_file.csv'. If not specified, the name will be\nautomatically generated.

\n", + "default": null + }, + { + "name": "mime", + "type_name": "str or None", + "is_optional": false, + "description": "

The MIME type of the data. If None, defaults to "text/plain"\n(if data is of type str or is a textual file) or\n"application/octet-stream" (if data is of type bytes or is a\nbinary file).

\n", + "default": "s" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/button.py#L155" + }, + "streamlit.echo": { + "name": "echo", + "signature": "st.echo(code_location=\"above\")", + "example": "
\n
\nimport streamlit as st\n\nwith st.echo():\n    st.write('This code will be printed')\n
\n
\n", + "description": "Use in a `with` block to draw some code on the app, then execute it.", + "args": [ + { + "name": "code_location", + "type_name": "\"above\" or \"below\"", + "is_optional": false, + "description": "

Whether to show the echoed code before or after the results of the\nexecuted code block.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/echo.py#L27" + }, + "streamlit.empty": { + "name": "empty", + "signature": "st.empty()", + "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport streamlit as st\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nimport streamlit as st\n\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", + "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/empty.py#L24" + }, + "streamlit.error": { + "name": "error", + "signature": "st.error(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", + "description": "Display error message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The error text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/alert.py#L39" + }, + "streamlit.exception": { + "name": "exception", + "signature": "st.exception(exception)", + "example": "
\n
\nimport streamlit as st\n\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", + "description": "Display an exception.", + "args": [ + { + "name": "exception", + "type_name": "Exception", + "is_optional": false, + "description": "

The exception to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/exception.py#L50" + }, + "streamlit.expander": { + "name": "expander", + "signature": "st.expander(label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/layouts.py#L306" + }, + "streamlit.experimental_data_editor": { + "name": "experimental_data_editor", + "signature": "st.experimental_data_editor(data, *, width=None, height=None, use_container_width=False, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.experimental_data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n \n (view standalone Streamlit app)\n \n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.experimental_data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a data editor widget.

\n

Display a data editor widget that allows you to edit DataFrames and\nmany other data structures in a table-like UI.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None", + "is_optional": false, + "description": "

The data to edit in the data editor.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the data editor expressed in pixels. If None, the width will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the data editor expressed in pixels. If None, the height will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the data editor width to the width of the parent container.\nThis takes precedence over the width argument. Defaults to False.

\n", + "default": "False." + }, + { + "name": "num_rows", + "type_name": "\"fixed\" or \"dynamic\"", + "is_optional": false, + "description": "

Specifies if the user can add and delete rows in the data editor.\nIf "fixed", the user cannot add or delete rows. If "dynamic", the user can\nadd and delete rows in the data editor, but column sorting is disabled.\nDefaults to "fixed".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean which, if True, disables the data editor and prevents\nany edits. Defaults to False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the unique key for this widget. If this\nis omitted, a key will be generated for the widget based on its\ncontent. Multiple widgets of the same type may not share the same\nkey.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this data_editor's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "pd.DataFrame, pd.Styler, pyarrow.Table, np.ndarray, list, set, tuple, or dict.", + "is_generator": false, + "description": "

The edited data. The edited data is returned in its original data type if\nit corresponds to any of the supported return types. All other data types\nare returned as a pd.DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/data_editor.py#L448" + }, + "streamlit.experimental_get_query_params": { + "name": "experimental_get_query_params", + "signature": "st.experimental_get_query_params()", + "example": "
\n

Let's say the user's web browser is at\nhttp://localhost:8501/?show_map=True&selected=asia&selected=america.\nThen, you can get the query parameters using the following:

\n
\nimport streamlit as st\n\nst.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\n

Note that the values in the returned dict are always lists. This is\nbecause we internally use Python's urllib.parse.parse_qs(), which behaves\nthis way. And this behavior makes sense when you consider that every item\nin a query string is potentially a 1-element array.

\n
\n", + "description": "Return the query parameters that is currently showing in the browser's URL bar.", + "args": [], + "returns": [ + { + "type_name": "dict", + "is_generator": false, + "description": "

The current query parameters as a dict. "Query parameters" are the part of the URL that comes\nafter the first "?".

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/commands/query_params.py#L23" + }, + "streamlit.experimental_memo": { + "name": "experimental_memo", + "signature": "st.experimental_memo(func=None, *, ttl, max_entries, show_spinner, persist, experimental_allow_widgets)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\nimport streamlit as st\n\n@st.cache_data(persist="disk")\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

By default, all parameters to a cached function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nconnection = make_database_connection()\nd1 = fetch_and_clean_data(connection, num_rows=10)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nanother_connection = make_database_connection()\nd2 = fetch_and_clean_data(another_connection, num_rows=10)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _database_connection parameter was different\n# in both calls.\n
\n

A cached function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nfetch_and_clean_data.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Decorator to cache functions that return data (e.g. dataframe transforms, database queries, ML inference).

\n

Cached objects are stored in "pickled" form, which means that the return\nvalue of a cached function must be pickleable. Each caller of the cached\nfunction gets its own copy of the cached data.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_data.clear().

\n

To cache global resources, use st.cache_resource instead. Learn more\nabout caching at https://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to cache. Streamlit hashes the function's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float or timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.\nNote that ttl is incompatible with persist="disk" - ttl will be\nignored if persist is specified.

\n", + "default": "None." + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." + }, + { + "name": "show_spinner", + "type_name": "boolean", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na cache miss.

\n", + "default": "True" + }, + { + "name": "persist", + "type_name": "str or boolean or None", + "is_optional": false, + "description": "

Optional location to persist cached data to. Passing "disk" (or True)\nwill persist the cached data to the local disk. None (or False) will disable\npersistence. The default is None.

\n", + "default": "None." + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/runtime/caching/cache_data_api.py#L274" + }, + "streamlit.experimental_rerun": { + "name": "experimental_rerun", + "signature": "st.experimental_rerun()", + "description": "

Rerun the script immediately.

\n

When st.experimental_rerun() is called, the script is halted - no\nmore statements will be run, and the script will be queued to re-run\nfrom the top.

\n

If this function is called outside of Streamlit, it will raise an\nException.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/commands/execution_control.py#L46" + }, + "streamlit.experimental_set_query_params": { + "name": "experimental_set_query_params", + "signature": "st.experimental_set_query_params(**query_params)", + "example": "
\n

To point the user's web browser to something like\n"http://localhost:8501/?show_map=True&selected=asia&selected=america",\nyou would do the following:

\n
\nimport streamlit as st\n\nst.experimental_set_query_params(\n    show_map=True,\n    selected=["asia", "america"],\n)\n
\n
\n", + "description": "Set the query parameters that are shown in the browser's URL bar.", + "args": [ + { + "name": "**query_params", + "type_name": "dict", + "is_optional": false, + "description": "

The query parameters to set, as key-value pairs.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/commands/query_params.py#L56" + }, + "streamlit.experimental_show": { + "name": "experimental_show", + "signature": "st.experimental_show(*args)", + "notes": "
\n

This is an experimental feature with usage limitations:

\n
    \n
  • The method must be called with the name show.
  • \n
  • Must be called in one line of code, and only once per line.
  • \n
  • \n
    When passing multiple arguments the inclusion of , or ) in a string
    \n
    argument may cause an error.
    \n
    \n
  • \n
\n
\n", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndataframe = pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n})\nst.experimental_show(dataframe)\n
\n
\n", + "description": "

Write arguments and argument names to your app for debugging purposes.

\n

Show() has similar properties to write():

\n
\n
    \n
  1. You can pass in multiple arguments, all of which will be debugged.
  2. \n
  3. It returns None, so it's "slot" in the app cannot be reused.
  4. \n
\n
\n

Note: This is an experimental feature. See\nhttps://docs.streamlit.io/library/advanced-features/prerelease#experimental for more information.

\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to debug in the App.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/show.py#L23" + }, + "streamlit.experimental_singleton": { + "name": "experimental_singleton", + "signature": "st.experimental_singleton(func, *, ttl, max_entries, show_spinner, validate, experimental_allow_widgets)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(url):\n    # Create a database session object that points to the URL.\n    return session\n\ns1 = get_database_session(SESSION_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(SESSION_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the connection object in s1 is the same as in s2.\n\ns3 = get_database_session(SESSION_URL_2)\n# This is a different URL, so the function executes.\n
\n

By default, all parameters to a cache_resource function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\ns1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _sessionmaker parameter was different\n# in both calls.\n
\n

A cache_resource function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\nget_database_session.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Decorator to cache functions that return global resources (e.g. database connections, ML models).

\n

Cached objects are shared across all users, sessions, and reruns. They\nmust be thread-safe because they can be accessed from multiple threads\nconcurrently. If thread safety is an issue, consider using st.session_state\nto store resources per session instead.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_resource.clear().

\n

To cache data, use st.cache_data instead. Learn more about caching at\nhttps://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function that creates the cached resource. Streamlit hashes the\nfunction's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float or timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.

\n", + "default": "None." + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached resource is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "validate", + "type_name": "callable or None", + "is_optional": false, + "description": "

An optional validation function for cached data. validate is called\neach time the cached value is accessed. It receives the cached value as\nits only parameter and it must return a boolean. If validate returns\nFalse, the current cached value is discarded, and the decorated function\nis called to compute a new value. This is useful e.g. to check the\nhealth of database connections.

\n", + "default": null + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/runtime/caching/cache_resource_api.py#L258" + }, + "streamlit.file_uploader": { + "name": "file_uploader", + "signature": "st.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nimport streamlit as st\nimport pandas as pd\nfrom io import StringIO\n\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nimport streamlit as st\n\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this file uploader is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str or list of str or None", + "is_optional": false, + "description": "

Array of allowed extensions. ['png', 'jpg']\nThe default is None, which means all extensions are allowed.

\n", + "default": "None" + }, + { + "name": "accept_multiple_files", + "type_name": "bool", + "is_optional": false, + "description": "

If True, allows the user to upload multiple files at the same time,\nin which case the return value will be a list of files.\nDefault: False

\n", + "default": "False" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the file uploader.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this file_uploader's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the file uploader if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile or list of UploadedFile", + "is_generator": false, + "description": "
    \n
  • If accept_multiple_files is False, returns either None or\nan UploadedFile object.
  • \n
  • If accept_multiple_files is True, returns a list with the\nuploaded files as UploadedFile objects. If no files were\nuploaded, returns an empty list.
  • \n
\n

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/file_uploader.py#L205" + }, + "streamlit.form": { + "name": "form", + "signature": "st.form(key, clear_on_submit=False)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n

Inserting elements out of order:

\n
\nimport streamlit as st\n\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n
\n", + "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

A string that identifies the form. Each form must have its own\nkey. (This key is not displayed to the user in the interface.)

\n", + "default": null + }, + { + "name": "clear_on_submit", + "type_name": "bool", + "is_optional": false, + "description": "

If True, all widgets inside the form will be reset to their default\nvalues after the user presses the Submit button. Defaults to False.\n(Note that Custom Components are unaffected by this flag, and\nwill not be reset to their defaults on form submission.)

\n", + "default": "values" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/form.py#L118" + }, + "streamlit.form_submit_button": { + "name": "form_submit_button", + "signature": "st.form_submit_button(label=\"Submit\", help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nDefaults to "Submit".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

A tooltip that gets displayed when the button is hovered over.\nDefaults to None.

\n", + "default": "None." + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/form.py#L211" + }, + "streamlit.get_option": { + "name": "get_option", + "signature": "st.get_option(key)", + "description": "

Return the current value of a given Streamlit config option.

\n

Run streamlit config show in the terminal to see all available options.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

The config option key of the form "section.optionName". To see all\navailable options, run streamlit config show on a terminal.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/config.py#L128" + }, + "streamlit.graphviz_chart": { + "name": "graphviz_chart", + "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nimport graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a graph using the dagre-d3 library.", + "args": [ + { + "name": "figure_or_dot", + "type_name": "graphviz.dot.Graph, graphviz.dot.Digraph, str", + "is_optional": false, + "description": "

The Graphlib graph object or dot string to display

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/graphviz_chart.py#L39" + }, + "streamlit.header": { + "name": "header", + "signature": "st.header(body, anchor=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.header('This is a header')\nst.header('A header with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "Display text in header formatting.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/heading.py#L31" + }, + "streamlit.help": { + "name": "help", + "signature": "st.help(obj)", + "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nimport streamlit as st\nimport pandas\n\nst.help(pandas.DataFrame)\n
\n

Want to quickly check what datatype is output by a certain function?\nTry:

\n
\nimport streamlit as st\n\nx = my_poorly_documented_function()\nst.help(x)\n
\n
\n", + "description": "

Display object's doc string, nicely formatted.

\n

Displays the doc string for this object.

\n", + "args": [ + { + "name": "obj", + "type_name": "Object", + "is_optional": false, + "description": "

The object whose docstring should be displayed.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/doc_string.py#L44" + }, + "streamlit.image": { + "name": "image", + "signature": "st.image(image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", + "example": "
\n
\nimport streamlit as st\nfrom PIL import Image\n\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an image or list of images.", + "args": [ + { + "name": "image", + "type_name": "numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]", + "is_optional": false, + "description": "

Monochrome image of shape (w,h) or (w,h,1)\nOR a color image of shape (w,h,3)\nOR an RGBA image of shape (w,h,4)\nOR a URL to fetch the image from\nOR a path of a local image file\nOR an SVG XML string like <svg xmlns=...</svg>\nOR a list of one of the above, to display multiple images.

\n", + "default": null + }, + { + "name": "caption", + "type_name": "str or list of str", + "is_optional": false, + "description": "

Image caption. If displaying multiple images, caption should be a\nlist of captions (one for each image).

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Image width. None means use the image width,\nbut do not exceed the width of the column.\nShould be set for SVG images, as they have no default image width.

\n", + "default": "image" + }, + { + "name": "use_column_width", + "type_name": "'auto' or 'always' or 'never' or bool", + "is_optional": false, + "description": "

If 'auto', set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf 'always' or True, set the image's width to the column width.\nIf 'never' or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", + "default": null + }, + { + "name": "clamp", + "type_name": "bool", + "is_optional": false, + "description": "

Clamp image pixel values to a valid range ([0-255] per channel).\nThis is only meaningful for byte array images; the parameter is\nignored for image URLs. If this is not set, and an image has an\nout-of-range value, an error will be thrown.

\n", + "default": null + }, + { + "name": "channels", + "type_name": "'RGB' or 'BGR'", + "is_optional": false, + "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to 'RGB', meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to 'BGR', instead.

\n", + "default": "s" + }, + { + "name": "output_format", + "type_name": "'JPEG', 'PNG', or 'auto'", + "is_optional": false, + "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to 'auto' which identifies the compression type based\non the type and format of the image argument.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/image.py#L67" + }, + "streamlit.info": { + "name": "info", + "signature": "st.info(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", + "description": "Display an informational message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The info text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/alert.py#L103" + }, + "streamlit.json": { + "name": "json", + "signature": "st.json(body, *, expanded=True)", + "example": "
\n
\nimport streamlit as st\n\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display object or string as a pretty-printed JSON string.", + "args": [ + { + "name": "body", + "type_name": "object or str", + "is_optional": false, + "description": "

The object to print as JSON. All referenced objects should be\nserializable to JSON as well. If object is a string, we assume it\ncontains serialized JSON.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean that allows the user to set whether the initial\nstate of this json element should be expanded. Defaults to True.\nThis argument can only be supplied by keyword.

\n", + "default": "True." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/json.py#L35" + }, + "streamlit.latex": { + "name": "latex", + "signature": "st.latex(body)", + "example": "
\n
\nimport streamlit as st\n\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", + "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", + "args": [ + { + "name": "body", + "type_name": "str or SymPy expression", + "is_optional": false, + "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/markdown.py#L174" + }, + "streamlit.line_chart": { + "name": "line_chart", + "signature": "st.line_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\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 \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict or None", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/dataframe_selector.py#L160" + }, + "streamlit.map": { + "name": "map", + "signature": "st.map(data=None, zoom=None, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a map with points on it.

\n

This is a wrapper around st.pydeck_chart to quickly create scatterplot\ncharts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more\ninfo on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to be plotted. Must have two columns:

\n
    \n
  • latitude called 'lat', 'latitude', 'LAT', 'LATITUDE'
  • \n
  • longitude called 'lon', 'longitude', 'LON', 'LONGITUDE'.
  • \n
\n", + "default": null + }, + { + "name": "zoom", + "type_name": "int", + "is_optional": false, + "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/map.py#L76" + }, + "streamlit.markdown": { + "name": "markdown", + "signature": "st.markdown(body, unsafe_allow_html=False)", + "examples": "
\n
\nimport streamlit as st\n\nst.markdown('Streamlit is **_really_ cool**.')\nst.markdown(\u201dThis text is :red[colored red], and this is **:blue[colored]** and bold.\u201d)\nst.markdown(":green[$\\sqrt{x^2+y^2}=1$] is a Pythagorean identity. :pencil:")\n
\n
\n", + "description": "Display string formatted as Markdown.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/markdown.py#L29" + }, + "streamlit.metric": { + "name": "metric", + "signature": "st.metric(label, value, delta=None, delta_color=\"normal\", help=None, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n \n (view standalone Streamlit app)\n \n

st.metric looks especially nice in combination with st.columns:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n \n (view standalone Streamlit app)\n \n

The delta indicator color can also be inverted or turned off:

\n
\nimport streamlit as st\n\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

The header or title for the metric. The label can optionally contain\nMarkdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Value of the metric. None is rendered as a long dash.

\n", + "default": null + }, + { + "name": "delta", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Indicator of how the metric changed, rendered with an arrow below\nthe metric. If delta is negative (int/float) or starts with a minus\nsign (str), the arrow points down and the text is red; else the\narrow points up and the text is green. If None (default), no delta\nindicator is shown.

\n", + "default": null + }, + { + "name": "delta_color", + "type_name": "str", + "is_optional": false, + "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the metric label.

\n", + "default": null + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/metric.py#L46" + }, + "streamlit.multiselect": { + "name": "multiselect", + "signature": "st.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", max_selections=None)", + "example": "
\n
\nimport streamlit as st\n\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence[V], numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "default", + "type_name": "[V], V, or None", + "is_optional": false, + "description": "

List of default values. Can also be a single value.

\n", + "default": "values." + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of selectbox options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe multiselect.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the multiselect.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this multiselect's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the multiselect widget if set\nto True. The default is False. This argument can only be supplied\nby keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "max_selections", + "type_name": "int", + "is_optional": false, + "description": "

The max selections that can be selected at a time.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list", + "is_generator": false, + "description": "

A list with the selected options

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/multiselect.py#L145" + }, + "streamlit.number_input": { + "name": "number_input", + "signature": "st.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a numeric input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. Output must be purely numeric. This does not impact\nthe return value. Valid formatters: %d %e %f %g %i %u

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this number_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the number input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int or float", + "is_generator": false, + "description": "

The current value of the numeric input widget. The return type\nwill match the data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/number_input.py#L66" + }, + "streamlit.plotly_chart": { + "name": "plotly_chart", + "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", theme=\"streamlit\", **kwargs)", + "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport numpy as np\nimport plotly.figure_factory as ff\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n        hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", + "args": [ + { + "name": "figure_or_data", + "type_name": "plotly.graph_objs.Figure, plotly.graph_objs.Data,", + "is_optional": false, + "description": "

dict/list of plotly.graph_objs.Figure/Data

\n

See https://plot.ly/python/ for examples of graph descriptions.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + }, + { + "name": "sharing", + "type_name": "{'streamlit', 'private', 'secret', 'public'}", + "is_optional": false, + "description": "

Use 'streamlit' to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": null, + "is_optional": null, + "description": "

Any argument accepted by Plotly's plot() function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/plotly_chart.py#L81" + }, + "streamlit.progress": { + "name": "progress", + "signature": "st.progress(value, text=None)", + "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport streamlit as st\nimport time\n\nprogress_text = "Operation in progress. Please wait."\nmy_bar = st.progress(0, text=progress_text)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1, text=progress_text)\n
\n
\n", + "description": "Display a progress bar.", + "args": [ + { + "name": "value", + "type_name": "int or float", + "is_optional": false, + "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", + "default": null + }, + { + "name": "text", + "type_name": "str or None", + "is_optional": false, + "description": "

A message to display above the progress bar. The text can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/progress.py#L66" + }, + "streamlit.pydeck_chart": { + "name": "pydeck_chart", + "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)", + "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport pydeck as pdk\n\nchart_data = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=chart_data,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=chart_data,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", + "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "pydeck_obj", + "type_name": "pydeck.Deck or None", + "is_optional": false, + "description": "

Object specifying the PyDeck chart to draw.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/deck_gl_json_chart.py#L36" + }, + "streamlit.pyplot": { + "name": "pyplot", + "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)", + "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", + "example": "
\n
\nimport streamlit as st\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a matplotlib.pyplot figure.", + "args": [ + { + "name": "fig", + "type_name": "Matplotlib Figure", + "is_optional": false, + "description": "

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

\n", + "default": null + }, + { + "name": "clear_figure", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", + "default": "based" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Arguments to pass to Matplotlib's savefig function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/pyplot.py#L38" + }, + "streamlit.radio": { + "name": "radio", + "signature": "st.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ngenre = st.radio(\n    "What\\'s your favorite movie genre",\n    ('Comedy', 'Drama', 'Documentary'))\n\nif genre == 'Comedy':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn\\'t select comedy.")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a radio button widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this radio group is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the radio options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of radio options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe radio.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the radio.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this radio's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the radio button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "horizontal", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", + "default": "false" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/radio.py#L75" + }, + "streamlit.select_slider": { + "name": "select_slider", + "signature": "st.select_slider(label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\nimport streamlit as st\n\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nimport streamlit as st\n\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n \n (view standalone Streamlit app)\n \n ", + "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the slider options. All options will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", + "default": "." + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to first option.

\n", + "default": "first" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels from the options.\nargument. It receives the option as an argument and its output\nwill be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the select slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this select_slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the select slider if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any value or tuple of any value", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/select_slider.py#L106" + }, + "streamlit.selectbox": { + "name": "selectbox", + "signature": "st.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a select widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels. It receives the option\nas an argument and its output will be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the selectbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this selectbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the selectbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/selectbox.py#L71" + }, + "streamlit.set_option": { + "name": "set_option", + "signature": "st.set_option(key, value)", + "description": "

Set config option.

\n
\n
Currently, only the following config options can be set within the script itself:
\n
    \n
  • client.caching
  • \n
  • client.displayEnabled
  • \n
  • deprecation.*
  • \n
\n
\n
\n

Calling with any other options will raise StreamlitAPIException.

\n

Run streamlit config show in the terminal to see all available options.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

The config option key of the form "section.optionName". To see all\navailable options, run streamlit config show on a terminal.

\n", + "default": null + }, + { + "name": "value", + "type_name": null, + "is_optional": null, + "description": "

The new value to assign to this config option.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/config.py#L89" + }, + "streamlit.set_page_config": { + "name": "set_page_config", + "signature": "st.set_page_config(page_title=None, page_icon=None, layout=\"centered\", initial_sidebar_state=\"auto\", menu_items=None)", + "example": "
\nimport streamlit as st\n\nst.set_page_config(\n    page_title="Ex-stream-ly Cool App",\n    page_icon="\ud83e\uddca",\n    layout="wide",\n    initial_sidebar_state="expanded",\n    menu_items={\n        'Get Help': 'https://www.extremelycoolapp.com/help',\n        'Report a bug': "https://www.extremelycoolapp.com/bug",\n        'About': "# This is a header. This is an *extremely* cool app!"\n    }\n)\n
\n", + "description": "

Configures the default settings of the page.

\n
\n

Note

\n

This must be the first Streamlit command used in your app, and must only\nbe set once.

\n
\n", + "args": [ + { + "name": "page_title", + "type_name": "str or None", + "is_optional": false, + "description": "

The page title, shown in the browser tab. If None, defaults to the\nfilename of the script ("app.py" would show "app \u2022 Streamlit").

\n", + "default": "the" + }, + { + "name": "page_icon", + "type_name": "Anything supported by st.image or str or None", + "is_optional": false, + "description": "

The page favicon.\nBesides the types supported by st.image (like URLs or numpy arrays),\nyou can pass in an emoji as a string ("\ud83e\udd88") or a shortcode (":shark:").\nIf you're feeling lucky, try "random" for a random emoji!\nEmoji icons are courtesy of Twemoji and loaded from MaxCDN.

\n", + "default": null + }, + { + "name": "layout", + "type_name": "\"centered\" or \"wide\"", + "is_optional": false, + "description": "

How the page content should be laid out. Defaults to "centered",\nwhich constrains the elements into a centered column of fixed width;\n"wide" uses the entire screen.

\n", + "default": "s" + }, + { + "name": "initial_sidebar_state", + "type_name": "\"auto\" or \"expanded\" or \"collapsed\"", + "is_optional": false, + "description": "

How the sidebar should start out. Defaults to "auto",\nwhich hides the sidebar on mobile-sized devices, and shows it otherwise.\n"expanded" shows the sidebar initially; "collapsed" hides it.

\n", + "default": "s" + }, + { + "name": "menu_items", + "type_name": "dict", + "is_optional": false, + "description": "

Configure the menu that appears on the top-right side of this app.\nThe keys in this dict denote the menu item you'd like to configure:

\n
    \n
  • \n
    "Get help": str or None
    \n
    The URL this menu item should point to.\nIf None, hides this menu item.
    \n
    \n
  • \n
  • \n
    "Report a Bug": str or None
    \n
    The URL this menu item should point to.\nIf None, hides this menu item.
    \n
    \n
  • \n
  • \n
    "About": str or None
    \n
    A markdown string to show in the About dialog.\nIf None, only shows Streamlit's default About text.
    \n
    \n
  • \n
\n

The URL may also refer to an email address e.g. mailto:john@example.com.

\n", + "default": "About" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/commands/page_config.py#L114" + }, + "streamlit.slider": { + "name": "slider", + "signature": "st.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nimport streamlit as st\n\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nimport streamlit as st\nfrom datetime import time\n\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nimport streamlit as st\nfrom datetime import datetime\n\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The minimum permitted value.\nDefaults to 0 if the value is an int, 0.0 if a float,\nvalue - timedelta(days=14) if a date/datetime, time.min if a time

\n", + "default": "0" + }, + { + "name": "max_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The maximum permitted value.\nDefaults to 100 if the value is an int, 1.0 if a float,\nvalue + timedelta(days=14) if a date/datetime, time.max if a time

\n", + "default": "100" + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to min_value.

\n", + "default": "min_value." + }, + { + "name": "step", + "type_name": "int/float/timedelta or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. This does not impact the return value.\nFormatter for int/float supports: %d %e %f %g %i\nFormatter for date/time/datetime uses Moment.js notation:\nhttps://momentjs.com/docs/#/displaying/format/

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the slider if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int/float/date/time/datetime or tuple of int/float/date/time/datetime", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/slider.py#L171" + }, + "streamlit.snow": { + "name": "snow", + "signature": "st.snow()", + "example": "
\n
\nimport streamlit as st\n\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", + "description": "Draw celebratory snowfall.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/snow.py#L25" + }, + "streamlit.spinner": { + "name": "spinner", + "signature": "st.spinner(text=\"In progress...\")", + "example": "
\n
\nimport time\nimport streamlit as st\n\nwith st.spinner('Wait for it...'):\n    time.sleep(5)\nst.success('Done!')\n
\n
\n", + "description": "Temporarily displays a message while executing a block of code.", + "args": [ + { + "name": "text", + "type_name": "str", + "is_optional": false, + "description": "

A message to display while executing that block

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/spinner.py#L23" + }, + "streamlit.stop": { + "name": "stop", + "signature": "st.stop()", + "example": "
\n
\nimport streamlit as st\n\nname = st.text_input('Name')\nif not name:\n  st.warning('Please input a name.')\n  st.stop()\nst.success('Thank you for inputting a name.')\n
\n
\n", + "description": "

Stops execution immediately.

\n

Streamlit will not run any statements after st.stop().\nWe recommend rendering a message to explain why the script has stopped.\nWhen run outside of Streamlit, this will raise an Exception.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/commands/execution_control.py#L25" + }, + "streamlit.subheader": { + "name": "subheader", + "signature": "st.subheader(body, anchor=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.subheader('This is a subheader')\nst.subheader('A subheader with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "Display text in subheader formatting.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/heading.py#L76" + }, + "streamlit.success": { + "name": "success", + "signature": "st.success(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", + "description": "Display a success message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The success text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/alert.py#L136" + }, + "streamlit.table": { + "name": "table", + "signature": "st.table(data=None)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/dataframe_selector.py#L122" + }, + "streamlit.tabs": { + "name": "tabs", + "signature": "st.tabs(tabs)", + "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\nimport streamlit as st\n\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", + "args": [ + { + "name": "tabs", + "type_name": "list of strings", + "is_optional": false, + "description": "

Creates a tab for each string in the list. The first tab is selected by default.\nThe string is used as the name of the tab and can optionally contain Markdown,\nsupporting the following elements: Bold, Italics, Strikethroughs, Inline Code,\nEmojis, and Links.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": "." + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/layouts.py#L208" + }, + "streamlit.text": { + "name": "text", + "signature": "st.text(body)", + "example": "
\n
\nimport streamlit as st\n\nst.text('This is some text.')\n
\n
\n", + "description": "Write fixed-width and preformatted text.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/text.py#L27" + }, + "streamlit.text_area": { + "name": "text_area", + "signature": "st.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", + "description": "Display a multi-line text input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Maximum number of characters allowed in text area.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the textarea.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_area's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text area is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text area if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/text_widgets.py#L272" + }, + "streamlit.text_input": { + "name": "text_input", + "signature": "st.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a single-line text input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Max number of characters allowed in text input.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str", + "is_optional": false, + "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "autocomplete", + "type_name": "str", + "is_optional": false, + "description": "

An optional value that will be passed to the <input> element's\nautocomplete property. If unspecified, this value will be set to\n"new-password" for "password" inputs, and the empty string for\n"default" inputs. For more details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text input is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/text_widgets.py#L69" + }, + "streamlit.time_input": { + "name": "time_input", + "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a time input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this time input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.time/datetime.datetime", + "is_optional": false, + "description": "

The value of this widget when it first renders. This will be\ncast to str internally. Defaults to the current time.

\n", + "default": "the" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this time_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the time input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.time", + "is_generator": false, + "description": "

The current value of the time input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/time_widgets.py#L212" + }, + "streamlit.title": { + "name": "title", + "signature": "st.title(body, anchor=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.title('This is a title')\nst.title('A title with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/heading.py#L122" + }, + "streamlit.vega_lite_chart": { + "name": "vega_lite_chart", + "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, theme=\"streamlit\", **kwargs)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(chart_data, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", + "description": "Display a chart using the Vega-Lite library.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "spec", + "type_name": "dict or None", + "is_optional": false, + "description": "

The Vega-Lite spec for the chart. If the spec was already passed in\nthe previous argument, this must be set to None. See\nhttps://vega.github.io/vega-lite/docs/ for more info.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Same as spec, but as keywords.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/dataframe_selector.py#L475" + }, + "streamlit.video": { + "name": "video", + "signature": "st.video(data, format=\"video/mp4\", start_time=0)", + "example": "
\n
\nimport streamlit as st\n\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", + "description": "Display a video player.", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "default": null + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the video file. Defaults to 'video/mp4'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/media.py#L117" + }, + "streamlit.warning": { + "name": "warning", + "signature": "st.warning(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", + "description": "Display warning message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The warning text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/alert.py#L71" + }, + "streamlit.write": { + "name": "write", + "signature": "st.write(*args, unsafe_allow_html=False, **kwargs)", + "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nimport streamlit as st\n\nst.write('Hello, *World!* :sunglasses:')\n
\n\n \n \n (view standalone Streamlit app)\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nimport streamlit as st\nimport pandas as pd\n\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n \n (view standalone Streamlit app)\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nimport streamlit as st\n\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n \n (view standalone Streamlit app)\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression, emoji shortcodes, and colored text.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/write.py#L47" + }, + "streamlit.experimental_memo.clear": { + "name": "experimental_memo.clear", + "signature": "st.experimental_memo.clear()", + "description": "Clear all in-memory and on-disk data caches.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/runtime/caching/cache_data_api.py#L445" + }, + "streamlit.cache_data.clear": { + "name": "cache_data.clear", + "signature": "st.cache_data.clear(self)", + "description": "Clear all in-memory and on-disk data caches.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/runtime/caching/cache_data_api.py#L445" + }, + "streamlit.experimental_singleton.clear": { + "name": "experimental_singleton.clear", + "signature": "st.experimental_singleton.clear()", + "description": "Clear all cache_resource caches.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/runtime/caching/cache_resource_api.py#L396" + }, + "streamlit.cache_resource.clear": { + "name": "cache_resource.clear", + "signature": "st.cache_resource.clear(self)", + "description": "Clear all cache_resource caches.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/runtime/caching/cache_resource_api.py#L396" + }, + "streamlit.components.v1.declare_component": { + "name": "declare_component", + "signature": "st.components.v1.declare_component(name, path=None, url=None)", + "description": "Create and register a custom component.", + "args": [ + { + "name": "name", + "type_name": "str", + "is_optional": false, + "description": "

A short, descriptive name for the component. Like, "slider".

\n", + "default": null + }, + { + "name": "path", + "type_name": "str or None", + "is_optional": false, + "description": "

The path to serve the component's frontend files from. Either\npath or url must be specified, but not both.

\n", + "default": null + }, + { + "name": "url", + "type_name": "str or None", + "is_optional": false, + "description": "

The URL that the component is served from. Either path or url\nmust be specified, but not both.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "CustomComponent", + "is_generator": false, + "description": "

A CustomComponent that can be called like a function.\nCalling the component will create a new instance of the component\nin the Streamlit app.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/components/v1/components.py#L246" + }, + "streamlit.components.v1.html": { + "name": "html", + "signature": "st.components.v1.html(html, width=None, height=None, scrolling=False)", + "description": "Display an HTML string in an iframe.", + "args": [ + { + "name": "html", + "type_name": "str", + "is_optional": false, + "description": "

The HTML string to embed in the iframe.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", + "default": "the" + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", + "default": "150." + }, + { + "name": "scrolling", + "type_name": "bool", + "is_optional": false, + "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/iframe.py#L59" + }, + "streamlit.components.v1.iframe": { + "name": "iframe", + "signature": "st.components.v1.iframe(src, width=None, height=None, scrolling=False)", + "description": "Load a remote URL in an iframe.", + "args": [ + { + "name": "src", + "type_name": "str", + "is_optional": false, + "description": "

The URL of the page to embed.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", + "default": "the" + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", + "default": "150." + }, + { + "name": "scrolling", + "type_name": "bool", + "is_optional": false, + "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/iframe.py#L25" + }, + "DeltaGenerator.add_rows": { + "name": "add_rows", + "signature": "element.add_rows(self, data=None, **kwargs)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf1 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table = st.table(df1)\n\ndf2 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table.add_rows(df2)\n# Now the table shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

You can do the same thing with plots. For example, if you want to add\nmore data to a line chart:

\n
\n# Assuming df1 and df2 from the example above still exist...\nmy_chart = st.line_chart(df1)\nmy_chart.add_rows(df2)\n# Now the chart shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

And for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:

\n
\nmy_chart = st.vega_lite_chart({\n    'mark': 'line',\n    'encoding': {'x': 'a', 'y': 'b'},\n    'datasets': {\n      'some_fancy_name': df1,  # <-- named dataset\n     },\n    'data': {'name': 'some_fancy_name'},\n}),\nmy_chart.add_rows(some_fancy_name=df2)  # <-- name used as keyword\n
\n
\n", + "description": "Concatenate a dataframe to the bottom of the current one.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, Iterable, dict, or None", + "is_optional": false, + "description": "

Table to concat. Optional.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "**kwargs", + "type_name": "pandas.DataFrame, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

The named dataset to concat. Optional. You can only pass in 1\ndataset (including the one in the data parameter).

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/dataframe_selector.py#L550" + }, + "DeltaGenerator.altair_chart": { + "name": "altair_chart", + "signature": "element.altair_chart(self, altair_chart, use_container_width=False, theme=\"streamlit\")", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(chart_data).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a chart using the Altair library.", + "args": [ + { + "name": "altair_chart", + "type_name": "altair.vegalite.v2.api.Chart", + "is_optional": false, + "description": "

The Altair chart object to display.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/dataframe_selector.py#L422" + }, + "DeltaGenerator.area_chart": { + "name": "area_chart", + "signature": "element.area_chart(self, data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/dataframe_selector.py#L247" + }, + "DeltaGenerator.audio": { + "name": "audio", + "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0, *, sample_rate=None)", + "example": "
\n
\nimport streamlit as st\nimport numpy as np\n\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n\nsample_rate = 44100  # 44100 samples per second\nseconds = 2  # Note duration of 2 seconds\nfrequency_la = 440  # Our played note will be 440 Hz\n# Generate array with seconds*sample_rate steps, ranging between 0 and seconds\nt = np.linspace(0, seconds, seconds * sample_rate, False)\n# Generate a 440 Hz sine wave\nnote_la = np.sin(frequency_la * t * 2 * np.pi)\n\nst.audio(note_la, sample_rate=sample_rate)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an audio player.", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw audio data, filename, or a URL pointing to the file to load.\nRaw data formats must include all necessary file headers to match the file\nformat specified via format.\nIf data is a numpy array, it must either be a 1D array of the waveform\nor a 2D array of shape (num_channels, num_samples) with waveforms\nfor all channels. See the default channel order at\nhttp://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx

\n", + "default": "channel" + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + }, + { + "name": "sample_rate", + "type_name": "int or None", + "is_optional": false, + "description": "

The sample rate of the audio data in samples per second. Only required if\ndata is a numpy array.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/media.py#L43" + }, + "DeltaGenerator.balloons": { + "name": "balloons", + "signature": "element.balloons(self)", + "example": "
\n
\nimport streamlit as st\n\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", + "description": "Draw celebratory balloons.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/balloons.py#L25" + }, + "DeltaGenerator.bar_chart": { + "name": "bar_chart", + "signature": "element.bar_chart(self, data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/dataframe_selector.py#L334" + }, + "DeltaGenerator.beta_columns": { + "name": "beta_columns", + "signature": "element.beta_columns(self, spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/layouts.py#L77" + }, + "DeltaGenerator.beta_container": { + "name": "beta_container", + "signature": "element.beta_container(self)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/layouts.py#L29" + }, + "DeltaGenerator.beta_expander": { + "name": "beta_expander", + "signature": "element.beta_expander(self, label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/layouts.py#L306" + }, + "DeltaGenerator.bokeh_chart": { + "name": "bokeh_chart", + "signature": "element.bokeh_chart(self, figure, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", + "args": [ + { + "name": "figure", + "type_name": "bokeh.plotting.figure.Figure", + "is_optional": false, + "description": "

A Bokeh figure to plot.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Bokeh's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/bokeh_chart.py#L36" + }, + "DeltaGenerator.button": { + "name": "button", + "signature": "element.button(self, label, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\n\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a button widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, and Emojis.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/button.py#L61" + }, + "DeltaGenerator.camera_input": { + "name": "camera_input", + "signature": "element.camera_input(self, label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", + "description": "Display a widget that returns pictures from the user's webcam.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this widget is used for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the camera input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this camera_input's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile", + "is_generator": false, + "description": "

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/camera_input.py#L109" + }, + "DeltaGenerator.caption": { + "name": "caption", + "signature": "element.caption(self, body, unsafe_allow_html=False)", + "examples": "
\n
\nimport streamlit as st\n\nst.caption('This is a string that explains something above.')\nst.caption('A caption with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/markdown.py#L119" + }, + "DeltaGenerator.checkbox": { + "name": "checkbox", + "signature": "element.checkbox(self, label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a checkbox widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this checkbox is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "value", + "type_name": "bool", + "is_optional": false, + "description": "

Preselect the checkbox when it first renders. This will be\ncast to bool internally.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the checkbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this checkbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

Whether or not the checkbox is checked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/checkbox.py#L52" + }, + "DeltaGenerator.code": { + "name": "code", + "signature": "element.code(self, body, language=\"python\")", + "example": "
\n
\nimport streamlit as st\n\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", + "description": "

Display a code block with optional syntax highlighting.

\n

(This is a convenience wrapper around st.markdown())

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as code.

\n", + "default": null + }, + { + "name": "language", + "type_name": "str or None", + "is_optional": false, + "description": "

The language that the code is written in, for syntax highlighting.\nIf None, the code will be unstyled. Defaults to "python".

\n

For a list of available language values, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/markdown.py#L83" + }, + "DeltaGenerator.color_picker": { + "name": "color_picker", + "signature": "element.color_picker(self, label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a color picker widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "str", + "is_optional": false, + "description": "

The hex value of this widget when it first renders. If None,\ndefaults to black.

\n", + "default": "black." + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the color picker.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this color_picker's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The selected color as a hex string.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/color_picker.py#L52" + }, + "DeltaGenerator.columns": { + "name": "columns", + "signature": "element.columns(self, spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/layouts.py#L77" + }, + "DeltaGenerator.container": { + "name": "container", + "signature": "element.container(self)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/layouts.py#L29" + }, + "DeltaGenerator.dataframe": { + "name": "dataframe", + "signature": "element.dataframe(self, data=None, width=None, height=None, *, use_container_width=False)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\nst.dataframe(df, 200, 100)\n
\n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a dataframe as an interactive table.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. (It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.)\nStyler support is experimental!\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the dataframe expressed in pixels. If None, the width\nwill be automatically calculated based on the column content.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the dataframe expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the dataframe width to the width of the parent container.\nThis takes precedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/dataframe_selector.py#L40" + }, + "DeltaGenerator.date_input": { + "name": "date_input", + "signature": "element.date_input(self, label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nd = st.date_input(\n    "When\\'s your birthday",\n    datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a date input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this date input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", + "is_optional": false, + "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", + "default": "today" + }, + { + "name": "min_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", + "default": "value" + }, + { + "name": "max_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", + "default": "value" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this date_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.date or a tuple with 0-2 dates", + "is_generator": false, + "description": "

The current value of the date input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/time_widgets.py#L380" + }, + "DeltaGenerator.download_button": { + "name": "download_button", + "signature": "element.download_button(self, label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False, use_container_width=False)", + "examples": "
\n

Download a large DataFrame as a CSV:

\n
\nimport streamlit as st\n\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\nimport streamlit as st\n\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nimport streamlit as st\n\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nimport streamlit as st\n\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, and Emojis.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "data", + "type_name": "str or bytes or file", + "is_optional": false, + "description": "

The contents of the file to be downloaded. See example below for\ncaching techniques to avoid recomputing this data unnecessarily.

\n", + "default": null + }, + { + "name": "file_name", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the name of the file to be downloaded,\nsuch as 'my_file.csv'. If not specified, the name will be\nautomatically generated.

\n", + "default": null + }, + { + "name": "mime", + "type_name": "str or None", + "is_optional": false, + "description": "

The MIME type of the data. If None, defaults to "text/plain"\n(if data is of type str or is a textual file) or\n"application/octet-stream" (if data is of type bytes or is a\nbinary file).

\n", + "default": "s" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/button.py#L155" + }, + "DeltaGenerator.empty": { + "name": "empty", + "signature": "element.empty(self)", + "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport streamlit as st\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nimport streamlit as st\n\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", + "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/empty.py#L24" + }, + "DeltaGenerator.error": { + "name": "error", + "signature": "element.error(self, body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", + "description": "Display error message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The error text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/alert.py#L39" + }, + "DeltaGenerator.exception": { + "name": "exception", + "signature": "element.exception(self, exception)", + "example": "
\n
\nimport streamlit as st\n\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", + "description": "Display an exception.", + "args": [ + { + "name": "exception", + "type_name": "Exception", + "is_optional": false, + "description": "

The exception to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/exception.py#L50" + }, + "DeltaGenerator.expander": { + "name": "expander", + "signature": "element.expander(self, label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/layouts.py#L306" + }, + "DeltaGenerator.experimental_data_editor": { + "name": "experimental_data_editor", + "signature": "element.experimental_data_editor(self, data, *, width=None, height=None, use_container_width=False, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.experimental_data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n \n (view standalone Streamlit app)\n \n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.experimental_data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a data editor widget.

\n

Display a data editor widget that allows you to edit DataFrames and\nmany other data structures in a table-like UI.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None", + "is_optional": false, + "description": "

The data to edit in the data editor.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the data editor expressed in pixels. If None, the width will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the data editor expressed in pixels. If None, the height will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the data editor width to the width of the parent container.\nThis takes precedence over the width argument. Defaults to False.

\n", + "default": "False." + }, + { + "name": "num_rows", + "type_name": "\"fixed\" or \"dynamic\"", + "is_optional": false, + "description": "

Specifies if the user can add and delete rows in the data editor.\nIf "fixed", the user cannot add or delete rows. If "dynamic", the user can\nadd and delete rows in the data editor, but column sorting is disabled.\nDefaults to "fixed".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean which, if True, disables the data editor and prevents\nany edits. Defaults to False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the unique key for this widget. If this\nis omitted, a key will be generated for the widget based on its\ncontent. Multiple widgets of the same type may not share the same\nkey.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this data_editor's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "pd.DataFrame, pd.Styler, pyarrow.Table, np.ndarray, list, set, tuple, or dict.", + "is_generator": false, + "description": "

The edited data. The edited data is returned in its original data type if\nit corresponds to any of the supported return types. All other data types\nare returned as a pd.DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/data_editor.py#L448" + }, + "DeltaGenerator.file_uploader": { + "name": "file_uploader", + "signature": "element.file_uploader(self, label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nimport streamlit as st\nimport pandas as pd\nfrom io import StringIO\n\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nimport streamlit as st\n\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this file uploader is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str or list of str or None", + "is_optional": false, + "description": "

Array of allowed extensions. ['png', 'jpg']\nThe default is None, which means all extensions are allowed.

\n", + "default": "None" + }, + { + "name": "accept_multiple_files", + "type_name": "bool", + "is_optional": false, + "description": "

If True, allows the user to upload multiple files at the same time,\nin which case the return value will be a list of files.\nDefault: False

\n", + "default": "False" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the file uploader.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this file_uploader's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the file uploader if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile or list of UploadedFile", + "is_generator": false, + "description": "
    \n
  • If accept_multiple_files is False, returns either None or\nan UploadedFile object.
  • \n
  • If accept_multiple_files is True, returns a list with the\nuploaded files as UploadedFile objects. If no files were\nuploaded, returns an empty list.
  • \n
\n

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/file_uploader.py#L205" + }, + "DeltaGenerator.form": { + "name": "form", + "signature": "element.form(self, key, clear_on_submit=False)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n

Inserting elements out of order:

\n
\nimport streamlit as st\n\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n
\n", + "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

A string that identifies the form. Each form must have its own\nkey. (This key is not displayed to the user in the interface.)

\n", + "default": null + }, + { + "name": "clear_on_submit", + "type_name": "bool", + "is_optional": false, + "description": "

If True, all widgets inside the form will be reset to their default\nvalues after the user presses the Submit button. Defaults to False.\n(Note that Custom Components are unaffected by this flag, and\nwill not be reset to their defaults on form submission.)

\n", + "default": "values" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/form.py#L118" + }, + "DeltaGenerator.form_submit_button": { + "name": "form_submit_button", + "signature": "element.form_submit_button(self, label=\"Submit\", help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nDefaults to "Submit".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

A tooltip that gets displayed when the button is hovered over.\nDefaults to None.

\n", + "default": "None." + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/form.py#L211" + }, + "DeltaGenerator.graphviz_chart": { + "name": "graphviz_chart", + "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nimport graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a graph using the dagre-d3 library.", + "args": [ + { + "name": "figure_or_dot", + "type_name": "graphviz.dot.Graph, graphviz.dot.Digraph, str", + "is_optional": false, + "description": "

The Graphlib graph object or dot string to display

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/graphviz_chart.py#L39" + }, + "DeltaGenerator.header": { + "name": "header", + "signature": "element.header(self, body, anchor=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.header('This is a header')\nst.header('A header with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "Display text in header formatting.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/heading.py#L31" + }, + "DeltaGenerator.help": { + "name": "help", + "signature": "element.help(self, obj)", + "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nimport streamlit as st\nimport pandas\n\nst.help(pandas.DataFrame)\n
\n

Want to quickly check what datatype is output by a certain function?\nTry:

\n
\nimport streamlit as st\n\nx = my_poorly_documented_function()\nst.help(x)\n
\n
\n", + "description": "

Display object's doc string, nicely formatted.

\n

Displays the doc string for this object.

\n", + "args": [ + { + "name": "obj", + "type_name": "Object", + "is_optional": false, + "description": "

The object whose docstring should be displayed.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/doc_string.py#L44" + }, + "DeltaGenerator.image": { + "name": "image", + "signature": "element.image(self, image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", + "example": "
\n
\nimport streamlit as st\nfrom PIL import Image\n\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an image or list of images.", + "args": [ + { + "name": "image", + "type_name": "numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]", + "is_optional": false, + "description": "

Monochrome image of shape (w,h) or (w,h,1)\nOR a color image of shape (w,h,3)\nOR an RGBA image of shape (w,h,4)\nOR a URL to fetch the image from\nOR a path of a local image file\nOR an SVG XML string like <svg xmlns=...</svg>\nOR a list of one of the above, to display multiple images.

\n", + "default": null + }, + { + "name": "caption", + "type_name": "str or list of str", + "is_optional": false, + "description": "

Image caption. If displaying multiple images, caption should be a\nlist of captions (one for each image).

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Image width. None means use the image width,\nbut do not exceed the width of the column.\nShould be set for SVG images, as they have no default image width.

\n", + "default": "image" + }, + { + "name": "use_column_width", + "type_name": "'auto' or 'always' or 'never' or bool", + "is_optional": false, + "description": "

If 'auto', set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf 'always' or True, set the image's width to the column width.\nIf 'never' or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", + "default": null + }, + { + "name": "clamp", + "type_name": "bool", + "is_optional": false, + "description": "

Clamp image pixel values to a valid range ([0-255] per channel).\nThis is only meaningful for byte array images; the parameter is\nignored for image URLs. If this is not set, and an image has an\nout-of-range value, an error will be thrown.

\n", + "default": null + }, + { + "name": "channels", + "type_name": "'RGB' or 'BGR'", + "is_optional": false, + "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to 'RGB', meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to 'BGR', instead.

\n", + "default": "s" + }, + { + "name": "output_format", + "type_name": "'JPEG', 'PNG', or 'auto'", + "is_optional": false, + "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to 'auto' which identifies the compression type based\non the type and format of the image argument.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/image.py#L67" + }, + "DeltaGenerator.info": { + "name": "info", + "signature": "element.info(self, body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", + "description": "Display an informational message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The info text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/alert.py#L103" + }, + "DeltaGenerator.json": { + "name": "json", + "signature": "element.json(self, body, *, expanded=True)", + "example": "
\n
\nimport streamlit as st\n\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display object or string as a pretty-printed JSON string.", + "args": [ + { + "name": "body", + "type_name": "object or str", + "is_optional": false, + "description": "

The object to print as JSON. All referenced objects should be\nserializable to JSON as well. If object is a string, we assume it\ncontains serialized JSON.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean that allows the user to set whether the initial\nstate of this json element should be expanded. Defaults to True.\nThis argument can only be supplied by keyword.

\n", + "default": "True." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/json.py#L35" + }, + "DeltaGenerator.latex": { + "name": "latex", + "signature": "element.latex(self, body)", + "example": "
\n
\nimport streamlit as st\n\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", + "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", + "args": [ + { + "name": "body", + "type_name": "str or SymPy expression", + "is_optional": false, + "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/markdown.py#L174" + }, + "DeltaGenerator.line_chart": { + "name": "line_chart", + "signature": "element.line_chart(self, data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\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 \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict or None", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/dataframe_selector.py#L160" + }, + "DeltaGenerator.map": { + "name": "map", + "signature": "element.map(self, data=None, zoom=None, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a map with points on it.

\n

This is a wrapper around st.pydeck_chart to quickly create scatterplot\ncharts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more\ninfo on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to be plotted. Must have two columns:

\n
    \n
  • latitude called 'lat', 'latitude', 'LAT', 'LATITUDE'
  • \n
  • longitude called 'lon', 'longitude', 'LON', 'LONGITUDE'.
  • \n
\n", + "default": null + }, + { + "name": "zoom", + "type_name": "int", + "is_optional": false, + "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/map.py#L76" + }, + "DeltaGenerator.markdown": { + "name": "markdown", + "signature": "element.markdown(self, body, unsafe_allow_html=False)", + "examples": "
\n
\nimport streamlit as st\n\nst.markdown('Streamlit is **_really_ cool**.')\nst.markdown(\u201dThis text is :red[colored red], and this is **:blue[colored]** and bold.\u201d)\nst.markdown(":green[$\\sqrt{x^2+y^2}=1$] is a Pythagorean identity. :pencil:")\n
\n
\n", + "description": "Display string formatted as Markdown.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/markdown.py#L29" + }, + "DeltaGenerator.metric": { + "name": "metric", + "signature": "element.metric(self, label, value, delta=None, delta_color=\"normal\", help=None, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n \n (view standalone Streamlit app)\n \n

st.metric looks especially nice in combination with st.columns:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n \n (view standalone Streamlit app)\n \n

The delta indicator color can also be inverted or turned off:

\n
\nimport streamlit as st\n\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

The header or title for the metric. The label can optionally contain\nMarkdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Value of the metric. None is rendered as a long dash.

\n", + "default": null + }, + { + "name": "delta", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Indicator of how the metric changed, rendered with an arrow below\nthe metric. If delta is negative (int/float) or starts with a minus\nsign (str), the arrow points down and the text is red; else the\narrow points up and the text is green. If None (default), no delta\nindicator is shown.

\n", + "default": null + }, + { + "name": "delta_color", + "type_name": "str", + "is_optional": false, + "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the metric label.

\n", + "default": null + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/metric.py#L46" + }, + "DeltaGenerator.multiselect": { + "name": "multiselect", + "signature": "element.multiselect(self, label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", max_selections=None)", + "example": "
\n
\nimport streamlit as st\n\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence[V], numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "default", + "type_name": "[V], V, or None", + "is_optional": false, + "description": "

List of default values. Can also be a single value.

\n", + "default": "values." + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of selectbox options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe multiselect.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the multiselect.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this multiselect's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the multiselect widget if set\nto True. The default is False. This argument can only be supplied\nby keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "max_selections", + "type_name": "int", + "is_optional": false, + "description": "

The max selections that can be selected at a time.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list", + "is_generator": false, + "description": "

A list with the selected options

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/multiselect.py#L145" + }, + "DeltaGenerator.number_input": { + "name": "number_input", + "signature": "element.number_input(self, label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a numeric input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. Output must be purely numeric. This does not impact\nthe return value. Valid formatters: %d %e %f %g %i %u

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this number_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the number input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int or float", + "is_generator": false, + "description": "

The current value of the numeric input widget. The return type\nwill match the data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/number_input.py#L66" + }, + "DeltaGenerator.plotly_chart": { + "name": "plotly_chart", + "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", theme=\"streamlit\", **kwargs)", + "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport numpy as np\nimport plotly.figure_factory as ff\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n        hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", + "args": [ + { + "name": "figure_or_data", + "type_name": "plotly.graph_objs.Figure, plotly.graph_objs.Data,", + "is_optional": false, + "description": "

dict/list of plotly.graph_objs.Figure/Data

\n

See https://plot.ly/python/ for examples of graph descriptions.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + }, + { + "name": "sharing", + "type_name": "{'streamlit', 'private', 'secret', 'public'}", + "is_optional": false, + "description": "

Use 'streamlit' to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": null, + "is_optional": null, + "description": "

Any argument accepted by Plotly's plot() function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/plotly_chart.py#L81" + }, + "DeltaGenerator.progress": { + "name": "progress", + "signature": "element.progress(self, value, text=None)", + "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport streamlit as st\nimport time\n\nprogress_text = "Operation in progress. Please wait."\nmy_bar = st.progress(0, text=progress_text)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1, text=progress_text)\n
\n
\n", + "description": "Display a progress bar.", + "args": [ + { + "name": "value", + "type_name": "int or float", + "is_optional": false, + "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", + "default": null + }, + { + "name": "text", + "type_name": "str or None", + "is_optional": false, + "description": "

A message to display above the progress bar. The text can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/progress.py#L66" + }, + "DeltaGenerator.pydeck_chart": { + "name": "pydeck_chart", + "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)", + "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport pydeck as pdk\n\nchart_data = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=chart_data,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=chart_data,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", + "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, we advise all users to use a personal Mapbox\ntoken. This ensures the map tiles used in this chart are more\nrobust. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at\nhttps://mapbox.com. It's free! (for moderate usage levels). For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "pydeck_obj", + "type_name": "pydeck.Deck or None", + "is_optional": false, + "description": "

Object specifying the PyDeck chart to draw.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/deck_gl_json_chart.py#L36" + }, + "DeltaGenerator.pyplot": { + "name": "pyplot", + "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)", + "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", + "example": "
\n
\nimport streamlit as st\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a matplotlib.pyplot figure.", + "args": [ + { + "name": "fig", + "type_name": "Matplotlib Figure", + "is_optional": false, + "description": "

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

\n", + "default": null + }, + { + "name": "clear_figure", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", + "default": "based" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Arguments to pass to Matplotlib's savefig function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/pyplot.py#L38" + }, + "DeltaGenerator.radio": { + "name": "radio", + "signature": "element.radio(self, label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ngenre = st.radio(\n    "What\\'s your favorite movie genre",\n    ('Comedy', 'Drama', 'Documentary'))\n\nif genre == 'Comedy':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn\\'t select comedy.")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a radio button widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this radio group is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the radio options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of radio options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe radio.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the radio.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this radio's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the radio button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "horizontal", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", + "default": "false" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/radio.py#L75" + }, + "DeltaGenerator.select_slider": { + "name": "select_slider", + "signature": "element.select_slider(self, label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\nimport streamlit as st\n\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nimport streamlit as st\n\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n \n (view standalone Streamlit app)\n \n ", + "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the slider options. All options will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", + "default": "." + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to first option.

\n", + "default": "first" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels from the options.\nargument. It receives the option as an argument and its output\nwill be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the select slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this select_slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the select slider if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any value or tuple of any value", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/select_slider.py#L106" + }, + "DeltaGenerator.selectbox": { + "name": "selectbox", + "signature": "element.selectbox(self, label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a select widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels. It receives the option\nas an argument and its output will be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the selectbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this selectbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the selectbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/selectbox.py#L71" + }, + "DeltaGenerator.slider": { + "name": "slider", + "signature": "element.slider(self, label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nimport streamlit as st\n\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nimport streamlit as st\nfrom datetime import time\n\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nimport streamlit as st\nfrom datetime import datetime\n\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The minimum permitted value.\nDefaults to 0 if the value is an int, 0.0 if a float,\nvalue - timedelta(days=14) if a date/datetime, time.min if a time

\n", + "default": "0" + }, + { + "name": "max_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The maximum permitted value.\nDefaults to 100 if the value is an int, 1.0 if a float,\nvalue + timedelta(days=14) if a date/datetime, time.max if a time

\n", + "default": "100" + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to min_value.

\n", + "default": "min_value." + }, + { + "name": "step", + "type_name": "int/float/timedelta or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. This does not impact the return value.\nFormatter for int/float supports: %d %e %f %g %i\nFormatter for date/time/datetime uses Moment.js notation:\nhttps://momentjs.com/docs/#/displaying/format/

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the slider if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int/float/date/time/datetime or tuple of int/float/date/time/datetime", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/slider.py#L171" + }, + "DeltaGenerator.snow": { + "name": "snow", + "signature": "element.snow(self)", + "example": "
\n
\nimport streamlit as st\n\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", + "description": "Draw celebratory snowfall.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/snow.py#L25" + }, + "DeltaGenerator.subheader": { + "name": "subheader", + "signature": "element.subheader(self, body, anchor=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.subheader('This is a subheader')\nst.subheader('A subheader with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "Display text in subheader formatting.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/heading.py#L76" + }, + "DeltaGenerator.success": { + "name": "success", + "signature": "element.success(self, body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", + "description": "Display a success message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The success text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/alert.py#L136" + }, + "DeltaGenerator.table": { + "name": "table", + "signature": "element.table(self, data=None)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/dataframe_selector.py#L122" + }, + "DeltaGenerator.tabs": { + "name": "tabs", + "signature": "element.tabs(self, tabs)", + "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\nimport streamlit as st\n\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", + "args": [ + { + "name": "tabs", + "type_name": "list of strings", + "is_optional": false, + "description": "

Creates a tab for each string in the list. The first tab is selected by default.\nThe string is used as the name of the tab and can optionally contain Markdown,\nsupporting the following elements: Bold, Italics, Strikethroughs, Inline Code,\nEmojis, and Links.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": "." + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/layouts.py#L208" + }, + "DeltaGenerator.text": { + "name": "text", + "signature": "element.text(self, body)", + "example": "
\n
\nimport streamlit as st\n\nst.text('This is some text.')\n
\n
\n", + "description": "Write fixed-width and preformatted text.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/text.py#L27" + }, + "DeltaGenerator.text_area": { + "name": "text_area", + "signature": "element.text_area(self, label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", + "description": "Display a multi-line text input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Maximum number of characters allowed in text area.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the textarea.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_area's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text area is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text area if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/text_widgets.py#L272" + }, + "DeltaGenerator.text_input": { + "name": "text_input", + "signature": "element.text_input(self, label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a single-line text input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Max number of characters allowed in text input.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str", + "is_optional": false, + "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "autocomplete", + "type_name": "str", + "is_optional": false, + "description": "

An optional value that will be passed to the <input> element's\nautocomplete property. If unspecified, this value will be set to\n"new-password" for "password" inputs, and the empty string for\n"default" inputs. For more details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text input is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/text_widgets.py#L69" + }, + "DeltaGenerator.time_input": { + "name": "time_input", + "signature": "element.time_input(self, label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a time input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this time input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.time/datetime.datetime", + "is_optional": false, + "description": "

The value of this widget when it first renders. This will be\ncast to str internally. Defaults to the current time.

\n", + "default": "the" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this time_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the time input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.time", + "is_generator": false, + "description": "

The current value of the time input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/time_widgets.py#L212" + }, + "DeltaGenerator.title": { + "name": "title", + "signature": "element.title(self, body, anchor=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.title('This is a title')\nst.title('A title with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/heading.py#L122" + }, + "DeltaGenerator.vega_lite_chart": { + "name": "vega_lite_chart", + "signature": "element.vega_lite_chart(self, data=None, spec=None, use_container_width=False, theme=\"streamlit\", **kwargs)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(chart_data, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", + "description": "Display a chart using the Vega-Lite library.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "spec", + "type_name": "dict or None", + "is_optional": false, + "description": "

The Vega-Lite spec for the chart. If the spec was already passed in\nthe previous argument, this must be set to None. See\nhttps://vega.github.io/vega-lite/docs/ for more info.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Same as spec, but as keywords.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/dataframe_selector.py#L475" + }, + "DeltaGenerator.video": { + "name": "video", + "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)", + "example": "
\n
\nimport streamlit as st\n\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", + "description": "Display a video player.", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "default": null + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the video file. Defaults to 'video/mp4'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/media.py#L117" + }, + "DeltaGenerator.warning": { + "name": "warning", + "signature": "element.warning(self, body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", + "description": "Display warning message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The warning text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/alert.py#L71" + }, + "DeltaGenerator.write": { + "name": "write", + "signature": "element.write(self, *args, unsafe_allow_html=False, **kwargs)", + "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nimport streamlit as st\n\nst.write('Hello, *World!* :sunglasses:')\n
\n\n \n \n (view standalone Streamlit app)\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nimport streamlit as st\nimport pandas as pd\n\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n \n (view standalone Streamlit app)\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nimport streamlit as st\n\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n \n (view standalone Streamlit app)\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression, emoji shortcodes, and colored text.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.19.0/lib/streamlit/elements/write.py#L47" + } + }, + "1.20.0": { + "streamlit.altair_chart": { + "name": "altair_chart", + "signature": "st.altair_chart(altair_chart, use_container_width=False, theme=\"streamlit\")", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(chart_data).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a chart using the Altair library.", + "args": [ + { + "name": "altair_chart", + "type_name": "altair.vegalite.v2.api.Chart", + "is_optional": false, + "description": "

The Altair chart object to display.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/dataframe_selector.py#L422" + }, + "streamlit.area_chart": { + "name": "area_chart", + "signature": "st.area_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/dataframe_selector.py#L247" + }, + "streamlit.audio": { + "name": "audio", + "signature": "st.audio(data, format=\"audio/wav\", start_time=0, *, sample_rate=None)", + "example": "
\n
\nimport streamlit as st\nimport numpy as np\n\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n\nsample_rate = 44100  # 44100 samples per second\nseconds = 2  # Note duration of 2 seconds\nfrequency_la = 440  # Our played note will be 440 Hz\n# Generate array with seconds*sample_rate steps, ranging between 0 and seconds\nt = np.linspace(0, seconds, seconds * sample_rate, False)\n# Generate a 440 Hz sine wave\nnote_la = np.sin(frequency_la * t * 2 * np.pi)\n\nst.audio(note_la, sample_rate=sample_rate)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an audio player.", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw audio data, filename, or a URL pointing to the file to load.\nRaw data formats must include all necessary file headers to match the file\nformat specified via format.\nIf data is a numpy array, it must either be a 1D array of the waveform\nor a 2D array of shape (num_channels, num_samples) with waveforms\nfor all channels. See the default channel order at\nhttp://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx

\n", + "default": "channel" + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + }, + { + "name": "sample_rate", + "type_name": "int or None", + "is_optional": false, + "description": "

The sample rate of the audio data in samples per second. Only required if\ndata is a numpy array.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/media.py#L43" + }, + "streamlit.balloons": { + "name": "balloons", + "signature": "st.balloons()", + "example": "
\n
\nimport streamlit as st\n\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", + "description": "Draw celebratory balloons.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/balloons.py#L25" + }, + "streamlit.bar_chart": { + "name": "bar_chart", + "signature": "st.bar_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/dataframe_selector.py#L334" + }, + "streamlit.beta_columns": { + "name": "beta_columns", + "signature": "st.beta_columns(spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/layouts.py#L77" + }, + "streamlit.beta_container": { + "name": "beta_container", + "signature": "st.beta_container()", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/layouts.py#L29" + }, + "streamlit.beta_expander": { + "name": "beta_expander", + "signature": "st.beta_expander(label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/layouts.py#L306" + }, + "streamlit.bokeh_chart": { + "name": "bokeh_chart", + "signature": "st.bokeh_chart(figure, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", + "args": [ + { + "name": "figure", + "type_name": "bokeh.plotting.figure.Figure", + "is_optional": false, + "description": "

A Bokeh figure to plot.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Bokeh's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/bokeh_chart.py#L36" + }, + "streamlit.button": { + "name": "button", + "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\n\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a button widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, and Emojis.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/button.py#L61" + }, + "streamlit.cache": { + "name": "cache", + "signature": "st.cache(func=None, persist=False, allow_output_mutation=False, show_spinner=True, suppress_st_warning=False, hash_funcs=None, max_entries=None, ttl=None)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\n@st.cache(persist=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To disable hashing return values, set the allow_output_mutation parameter to True:

\n
\n@st.cache(allow_output_mutation=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. MongoClient) to a hash function (id) like this:

\n
\n@st.cache(hash_funcs={MongoClient: id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "pymongo.mongo_client.MongoClient") to the hash function instead:

\n
\n@st.cache(hash_funcs={"pymongo.mongo_client.MongoClient": id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n
\n", + "description": "Function decorator to memoize function executions.", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to cache. Streamlit hashes the function and dependent code.

\n", + "default": null + }, + { + "name": "persist", + "type_name": "boolean", + "is_optional": false, + "description": "

Whether to persist the cache on disk.

\n", + "default": null + }, + { + "name": "allow_output_mutation", + "type_name": "boolean", + "is_optional": false, + "description": "

Streamlit shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.

\n

If you know what you're doing and would like to override this warning, set this to True.

\n", + "default": null + }, + { + "name": "show_spinner", + "type_name": "boolean", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na cache miss.

\n", + "default": "True" + }, + { + "name": "suppress_st_warning", + "type_name": "boolean", + "is_optional": false, + "description": "

Suppress warnings about calling Streamlit commands from within\nthe cached function.

\n", + "default": null + }, + { + "name": "hash_funcs", + "type_name": "dict or None", + "is_optional": false, + "description": "

Mapping of types or fully qualified names to hash functions. This is used to override\nthe behavior of the hasher inside Streamlit's caching mechanism: when the hasher\nencounters an object, it will first check to see if its type matches a key in this\ndict and, if so, will use the provided function to generate a hash for it. See below\nfor an example of how this can be used.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." + }, + { + "name": "ttl", + "type_name": "float or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.

\n", + "default": "None." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/runtime/legacy_caching/caching.py#L486" + }, + "streamlit.cache_data": { + "name": "cache_data", + "signature": "st.cache_data(func=None, *, ttl, max_entries, show_spinner, persist, experimental_allow_widgets)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\nimport streamlit as st\n\n@st.cache_data(persist="disk")\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

By default, all parameters to a cached function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nconnection = make_database_connection()\nd1 = fetch_and_clean_data(connection, num_rows=10)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nanother_connection = make_database_connection()\nd2 = fetch_and_clean_data(another_connection, num_rows=10)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _database_connection parameter was different\n# in both calls.\n
\n

A cached function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nfetch_and_clean_data.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Decorator to cache functions that return data (e.g. dataframe transforms, database queries, ML inference).

\n

Cached objects are stored in "pickled" form, which means that the return\nvalue of a cached function must be pickleable. Each caller of the cached\nfunction gets its own copy of the cached data.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_data.clear().

\n

To cache global resources, use st.cache_resource instead. Learn more\nabout caching at https://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to cache. Streamlit hashes the function's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float or timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.\nNote that ttl is incompatible with persist="disk" - ttl will be\nignored if persist is specified.

\n", + "default": "None." + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached data is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "persist", + "type_name": "str or boolean or None", + "is_optional": false, + "description": "

Optional location to persist cached data to. Passing "disk" (or True)\nwill persist the cached data to the local disk. None (or False) will disable\npersistence. The default is None.

\n", + "default": "None." + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/runtime/caching/cache_data_api.py#L378" + }, + "streamlit.cache_resource": { + "name": "cache_resource", + "signature": "st.cache_resource(func, *, ttl, max_entries, show_spinner, validate, experimental_allow_widgets)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(url):\n    # Create a database session object that points to the URL.\n    return session\n\ns1 = get_database_session(SESSION_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(SESSION_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the connection object in s1 is the same as in s2.\n\ns3 = get_database_session(SESSION_URL_2)\n# This is a different URL, so the function executes.\n
\n

By default, all parameters to a cache_resource function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\ns1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _sessionmaker parameter was different\n# in both calls.\n
\n

A cache_resource function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\nget_database_session.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Decorator to cache functions that return global resources (e.g. database connections, ML models).

\n

Cached objects are shared across all users, sessions, and reruns. They\nmust be thread-safe because they can be accessed from multiple threads\nconcurrently. If thread safety is an issue, consider using st.session_state\nto store resources per session instead.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_resource.clear().

\n

To cache data, use st.cache_data instead. Learn more about caching at\nhttps://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function that creates the cached resource. Streamlit hashes the\nfunction's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float or timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.

\n", + "default": "None." + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached resource is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "validate", + "type_name": "callable or None", + "is_optional": false, + "description": "

An optional validation function for cached data. validate is called\neach time the cached value is accessed. It receives the cached value as\nits only parameter and it must return a boolean. If validate returns\nFalse, the current cached value is discarded, and the decorated function\nis called to compute a new value. This is useful e.g. to check the\nhealth of database connections.

\n", + "default": null + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/runtime/caching/cache_resource_api.py#L258" + }, + "streamlit.camera_input": { + "name": "camera_input", + "signature": "st.camera_input(label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", + "description": "Display a widget that returns pictures from the user's webcam.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this widget is used for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the camera input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this camera_input's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile", + "is_generator": false, + "description": "

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/camera_input.py#L109" + }, + "streamlit.caption": { + "name": "caption", + "signature": "st.caption(body, unsafe_allow_html=False)", + "examples": "
\n
\nimport streamlit as st\n\nst.caption('This is a string that explains something above.')\nst.caption('A caption with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/markdown.py#L119" + }, + "streamlit.checkbox": { + "name": "checkbox", + "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a checkbox widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this checkbox is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "value", + "type_name": "bool", + "is_optional": false, + "description": "

Preselect the checkbox when it first renders. This will be\ncast to bool internally.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the checkbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this checkbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

Whether or not the checkbox is checked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/checkbox.py#L52" + }, + "streamlit.code": { + "name": "code", + "signature": "st.code(body, language=\"python\")", + "example": "
\n
\nimport streamlit as st\n\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", + "description": "

Display a code block with optional syntax highlighting.

\n

(This is a convenience wrapper around st.markdown())

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as code.

\n", + "default": null + }, + { + "name": "language", + "type_name": "str or None", + "is_optional": false, + "description": "

The language that the code is written in, for syntax highlighting.\nIf None, the code will be unstyled. Defaults to "python".

\n

For a list of available language values, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/markdown.py#L83" + }, + "streamlit.color_picker": { + "name": "color_picker", + "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a color picker widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "str", + "is_optional": false, + "description": "

The hex value of this widget when it first renders. If None,\ndefaults to black.

\n", + "default": "black." + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the color picker.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this color_picker's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The selected color as a hex string.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/color_picker.py#L52" + }, + "streamlit.columns": { + "name": "columns", + "signature": "st.columns(spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/layouts.py#L77" + }, + "streamlit.container": { + "name": "container", + "signature": "st.container()", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/layouts.py#L29" + }, + "streamlit.dataframe": { + "name": "dataframe", + "signature": "st.dataframe(data=None, width=None, height=None, *, use_container_width=False)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\nst.dataframe(df, 200, 100)\n
\n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a dataframe as an interactive table.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. (It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.)\nStyler support is experimental!\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the dataframe expressed in pixels. If None, the width\nwill be automatically calculated based on the column content.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the dataframe expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the dataframe width to the width of the parent container.\nThis takes precedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/dataframe_selector.py#L40" + }, + "streamlit.date_input": { + "name": "date_input", + "signature": "st.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nd = st.date_input(\n    "When\\'s your birthday",\n    datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a date input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this date input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", + "is_optional": false, + "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", + "default": "today" + }, + { + "name": "min_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", + "default": "value" + }, + { + "name": "max_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", + "default": "value" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this date_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.date or a tuple with 0-2 dates", + "is_generator": false, + "description": "

The current value of the date input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/time_widgets.py#L380" + }, + "streamlit.download_button": { + "name": "download_button", + "signature": "st.download_button(label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False, use_container_width=False)", + "examples": "
\n

Download a large DataFrame as a CSV:

\n
\nimport streamlit as st\n\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\nimport streamlit as st\n\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nimport streamlit as st\n\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nimport streamlit as st\n\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, and Emojis.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "data", + "type_name": "str or bytes or file", + "is_optional": false, + "description": "

The contents of the file to be downloaded. See example below for\ncaching techniques to avoid recomputing this data unnecessarily.

\n", + "default": null + }, + { + "name": "file_name", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the name of the file to be downloaded,\nsuch as 'my_file.csv'. If not specified, the name will be\nautomatically generated.

\n", + "default": null + }, + { + "name": "mime", + "type_name": "str or None", + "is_optional": false, + "description": "

The MIME type of the data. If None, defaults to "text/plain"\n(if data is of type str or is a textual file) or\n"application/octet-stream" (if data is of type bytes or is a\nbinary file).

\n", + "default": "s" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/button.py#L155" + }, + "streamlit.echo": { + "name": "echo", + "signature": "st.echo(code_location=\"above\")", + "example": "
\n
\nimport streamlit as st\n\nwith st.echo():\n    st.write('This code will be printed')\n
\n
\n", + "description": "Use in a `with` block to draw some code on the app, then execute it.", + "args": [ + { + "name": "code_location", + "type_name": "\"above\" or \"below\"", + "is_optional": false, + "description": "

Whether to show the echoed code before or after the results of the\nexecuted code block.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/echo.py#L27" + }, + "streamlit.empty": { + "name": "empty", + "signature": "st.empty()", + "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport streamlit as st\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nimport streamlit as st\n\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", + "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/empty.py#L24" + }, + "streamlit.error": { + "name": "error", + "signature": "st.error(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", + "description": "Display error message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The error text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/alert.py#L39" + }, + "streamlit.exception": { + "name": "exception", + "signature": "st.exception(exception)", + "example": "
\n
\nimport streamlit as st\n\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", + "description": "Display an exception.", + "args": [ + { + "name": "exception", + "type_name": "Exception", + "is_optional": false, + "description": "

The exception to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/exception.py#L50" + }, + "streamlit.expander": { + "name": "expander", + "signature": "st.expander(label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/layouts.py#L306" + }, + "streamlit.experimental_data_editor": { + "name": "experimental_data_editor", + "signature": "st.experimental_data_editor(data, *, width=None, height=None, use_container_width=False, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.experimental_data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n \n (view standalone Streamlit app)\n \n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.experimental_data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a data editor widget.

\n

Display a data editor widget that allows you to edit DataFrames and\nmany other data structures in a table-like UI.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None", + "is_optional": false, + "description": "

The data to edit in the data editor.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the data editor expressed in pixels. If None, the width will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the data editor expressed in pixels. If None, the height will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the data editor width to the width of the parent container.\nThis takes precedence over the width argument. Defaults to False.

\n", + "default": "False." + }, + { + "name": "num_rows", + "type_name": "\"fixed\" or \"dynamic\"", + "is_optional": false, + "description": "

Specifies if the user can add and delete rows in the data editor.\nIf "fixed", the user cannot add or delete rows. If "dynamic", the user can\nadd and delete rows in the data editor, but column sorting is disabled.\nDefaults to "fixed".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean which, if True, disables the data editor and prevents\nany edits. Defaults to False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the unique key for this widget. If this\nis omitted, a key will be generated for the widget based on its\ncontent. Multiple widgets of the same type may not share the same\nkey.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this data_editor's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "pd.DataFrame, pd.Styler, pyarrow.Table, np.ndarray, list, set, tuple, or dict.", + "is_generator": false, + "description": "

The edited data. The edited data is returned in its original data type if\nit corresponds to any of the supported return types. All other data types\nare returned as a pd.DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/data_editor.py#L448" + }, + "streamlit.experimental_get_query_params": { + "name": "experimental_get_query_params", + "signature": "st.experimental_get_query_params()", + "example": "
\n

Let's say the user's web browser is at\nhttp://localhost:8501/?show_map=True&selected=asia&selected=america.\nThen, you can get the query parameters using the following:

\n
\nimport streamlit as st\n\nst.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\n

Note that the values in the returned dict are always lists. This is\nbecause we internally use Python's urllib.parse.parse_qs(), which behaves\nthis way. And this behavior makes sense when you consider that every item\nin a query string is potentially a 1-element array.

\n
\n", + "description": "Return the query parameters that is currently showing in the browser's URL bar.", + "args": [], + "returns": [ + { + "type_name": "dict", + "is_generator": false, + "description": "

The current query parameters as a dict. "Query parameters" are the part of the URL that comes\nafter the first "?".

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/commands/query_params.py#L29" + }, + "streamlit.experimental_memo": { + "name": "experimental_memo", + "signature": "st.experimental_memo(func=None, *, ttl, max_entries, show_spinner, persist, experimental_allow_widgets)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\nimport streamlit as st\n\n@st.cache_data(persist="disk")\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

By default, all parameters to a cached function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nconnection = make_database_connection()\nd1 = fetch_and_clean_data(connection, num_rows=10)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nanother_connection = make_database_connection()\nd2 = fetch_and_clean_data(another_connection, num_rows=10)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _database_connection parameter was different\n# in both calls.\n
\n

A cached function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nfetch_and_clean_data.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Decorator to cache functions that return data (e.g. dataframe transforms, database queries, ML inference).

\n

Cached objects are stored in "pickled" form, which means that the return\nvalue of a cached function must be pickleable. Each caller of the cached\nfunction gets its own copy of the cached data.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_data.clear().

\n

To cache global resources, use st.cache_resource instead. Learn more\nabout caching at https://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to cache. Streamlit hashes the function's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float or timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.\nNote that ttl is incompatible with persist="disk" - ttl will be\nignored if persist is specified.

\n", + "default": "None." + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached data is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "persist", + "type_name": "str or boolean or None", + "is_optional": false, + "description": "

Optional location to persist cached data to. Passing "disk" (or True)\nwill persist the cached data to the local disk. None (or False) will disable\npersistence. The default is None.

\n", + "default": "None." + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/runtime/caching/cache_data_api.py#L378" + }, + "streamlit.experimental_rerun": { + "name": "experimental_rerun", + "signature": "st.experimental_rerun()", + "description": "

Rerun the script immediately.

\n

When st.experimental_rerun() is called, the script is halted - no\nmore statements will be run, and the script will be queued to re-run\nfrom the top.

\n

If this function is called outside of Streamlit, it will raise an\nException.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/commands/execution_control.py#L46" + }, + "streamlit.experimental_set_query_params": { + "name": "experimental_set_query_params", + "signature": "st.experimental_set_query_params(**query_params)", + "example": "
\n

To point the user's web browser to something like\n"http://localhost:8501/?show_map=True&selected=asia&selected=america",\nyou would do the following:

\n
\nimport streamlit as st\n\nst.experimental_set_query_params(\n    show_map=True,\n    selected=["asia", "america"],\n)\n
\n
\n", + "description": "

Set the query parameters that are shown in the browser's URL bar.

\n
\n

Warning

\n

Query param embed cannot be set using this method.

\n
\n", + "args": [ + { + "name": "**query_params", + "type_name": "dict", + "is_optional": false, + "description": "

The query parameters to set, as key-value pairs.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/commands/query_params.py#L65" + }, + "streamlit.experimental_show": { + "name": "experimental_show", + "signature": "st.experimental_show(*args)", + "notes": "
\n

This is an experimental feature with usage limitations:

\n
    \n
  • The method must be called with the name show.
  • \n
  • Must be called in one line of code, and only once per line.
  • \n
  • \n
    When passing multiple arguments the inclusion of , or ) in a string
    \n
    argument may cause an error.
    \n
    \n
  • \n
\n
\n", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndataframe = pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n})\nst.experimental_show(dataframe)\n
\n
\n", + "description": "

Write arguments and argument names to your app for debugging purposes.

\n

Show() has similar properties to write():

\n
\n
    \n
  1. You can pass in multiple arguments, all of which will be debugged.
  2. \n
  3. It returns None, so it's "slot" in the app cannot be reused.
  4. \n
\n
\n

Note: This is an experimental feature. See\nhttps://docs.streamlit.io/library/advanced-features/prerelease#experimental for more information.

\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to debug in the App.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/show.py#L23" + }, + "streamlit.experimental_singleton": { + "name": "experimental_singleton", + "signature": "st.experimental_singleton(func, *, ttl, max_entries, show_spinner, validate, experimental_allow_widgets)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(url):\n    # Create a database session object that points to the URL.\n    return session\n\ns1 = get_database_session(SESSION_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(SESSION_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the connection object in s1 is the same as in s2.\n\ns3 = get_database_session(SESSION_URL_2)\n# This is a different URL, so the function executes.\n
\n

By default, all parameters to a cache_resource function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\ns1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _sessionmaker parameter was different\n# in both calls.\n
\n

A cache_resource function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\nget_database_session.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Decorator to cache functions that return global resources (e.g. database connections, ML models).

\n

Cached objects are shared across all users, sessions, and reruns. They\nmust be thread-safe because they can be accessed from multiple threads\nconcurrently. If thread safety is an issue, consider using st.session_state\nto store resources per session instead.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_resource.clear().

\n

To cache data, use st.cache_data instead. Learn more about caching at\nhttps://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function that creates the cached resource. Streamlit hashes the\nfunction's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float or timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.

\n", + "default": "None." + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached resource is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "validate", + "type_name": "callable or None", + "is_optional": false, + "description": "

An optional validation function for cached data. validate is called\neach time the cached value is accessed. It receives the cached value as\nits only parameter and it must return a boolean. If validate returns\nFalse, the current cached value is discarded, and the decorated function\nis called to compute a new value. This is useful e.g. to check the\nhealth of database connections.

\n", + "default": null + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/runtime/caching/cache_resource_api.py#L258" + }, + "streamlit.file_uploader": { + "name": "file_uploader", + "signature": "st.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nimport streamlit as st\nimport pandas as pd\nfrom io import StringIO\n\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nimport streamlit as st\n\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this file uploader is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str or list of str or None", + "is_optional": false, + "description": "

Array of allowed extensions. ['png', 'jpg']\nThe default is None, which means all extensions are allowed.

\n", + "default": "None" + }, + { + "name": "accept_multiple_files", + "type_name": "bool", + "is_optional": false, + "description": "

If True, allows the user to upload multiple files at the same time,\nin which case the return value will be a list of files.\nDefault: False

\n", + "default": "False" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the file uploader.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this file_uploader's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the file uploader if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile or list of UploadedFile", + "is_generator": false, + "description": "
    \n
  • If accept_multiple_files is False, returns either None or\nan UploadedFile object.
  • \n
  • If accept_multiple_files is True, returns a list with the\nuploaded files as UploadedFile objects. If no files were\nuploaded, returns an empty list.
  • \n
\n

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/file_uploader.py#L205" + }, + "streamlit.form": { + "name": "form", + "signature": "st.form(key, clear_on_submit=False)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n

Inserting elements out of order:

\n
\nimport streamlit as st\n\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n
\n", + "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

A string that identifies the form. Each form must have its own\nkey. (This key is not displayed to the user in the interface.)

\n", + "default": null + }, + { + "name": "clear_on_submit", + "type_name": "bool", + "is_optional": false, + "description": "

If True, all widgets inside the form will be reset to their default\nvalues after the user presses the Submit button. Defaults to False.\n(Note that Custom Components are unaffected by this flag, and\nwill not be reset to their defaults on form submission.)

\n", + "default": "values" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/form.py#L118" + }, + "streamlit.form_submit_button": { + "name": "form_submit_button", + "signature": "st.form_submit_button(label=\"Submit\", help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nDefaults to "Submit".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

A tooltip that gets displayed when the button is hovered over.\nDefaults to None.

\n", + "default": "None." + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/form.py#L211" + }, + "streamlit.get_option": { + "name": "get_option", + "signature": "st.get_option(key)", + "description": "

Return the current value of a given Streamlit config option.

\n

Run streamlit config show in the terminal to see all available options.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

The config option key of the form "section.optionName". To see all\navailable options, run streamlit config show on a terminal.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/config.py#L128" + }, + "streamlit.graphviz_chart": { + "name": "graphviz_chart", + "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nimport graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a graph using the dagre-d3 library.", + "args": [ + { + "name": "figure_or_dot", + "type_name": "graphviz.dot.Graph, graphviz.dot.Digraph, str", + "is_optional": false, + "description": "

The Graphlib graph object or dot string to display

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/graphviz_chart.py#L39" + }, + "streamlit.header": { + "name": "header", + "signature": "st.header(body, anchor=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.header('This is a header')\nst.header('A header with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "Display text in header formatting.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/heading.py#L31" + }, + "streamlit.help": { + "name": "help", + "signature": "st.help(obj)", + "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nimport streamlit as st\nimport pandas\n\nst.help(pandas.DataFrame)\n
\n

Want to quickly check what datatype is output by a certain function?\nTry:

\n
\nimport streamlit as st\n\nx = my_poorly_documented_function()\nst.help(x)\n
\n
\n", + "description": "

Display object's doc string, nicely formatted.

\n

Displays the doc string for this object.

\n", + "args": [ + { + "name": "obj", + "type_name": "Object", + "is_optional": false, + "description": "

The object whose docstring should be displayed.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/doc_string.py#L44" + }, + "streamlit.image": { + "name": "image", + "signature": "st.image(image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", + "example": "
\n
\nimport streamlit as st\nfrom PIL import Image\n\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an image or list of images.", + "args": [ + { + "name": "image", + "type_name": "numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]", + "is_optional": false, + "description": "

Monochrome image of shape (w,h) or (w,h,1)\nOR a color image of shape (w,h,3)\nOR an RGBA image of shape (w,h,4)\nOR a URL to fetch the image from\nOR a path of a local image file\nOR an SVG XML string like <svg xmlns=...</svg>\nOR a list of one of the above, to display multiple images.

\n", + "default": null + }, + { + "name": "caption", + "type_name": "str or list of str", + "is_optional": false, + "description": "

Image caption. If displaying multiple images, caption should be a\nlist of captions (one for each image).

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Image width. None means use the image width,\nbut do not exceed the width of the column.\nShould be set for SVG images, as they have no default image width.

\n", + "default": "image" + }, + { + "name": "use_column_width", + "type_name": "'auto' or 'always' or 'never' or bool", + "is_optional": false, + "description": "

If 'auto', set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf 'always' or True, set the image's width to the column width.\nIf 'never' or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", + "default": null + }, + { + "name": "clamp", + "type_name": "bool", + "is_optional": false, + "description": "

Clamp image pixel values to a valid range ([0-255] per channel).\nThis is only meaningful for byte array images; the parameter is\nignored for image URLs. If this is not set, and an image has an\nout-of-range value, an error will be thrown.

\n", + "default": null + }, + { + "name": "channels", + "type_name": "'RGB' or 'BGR'", + "is_optional": false, + "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to 'RGB', meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to 'BGR', instead.

\n", + "default": "s" + }, + { + "name": "output_format", + "type_name": "'JPEG', 'PNG', or 'auto'", + "is_optional": false, + "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to 'auto' which identifies the compression type based\non the type and format of the image argument.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/image.py#L67" + }, + "streamlit.info": { + "name": "info", + "signature": "st.info(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", + "description": "Display an informational message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The info text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/alert.py#L103" + }, + "streamlit.json": { + "name": "json", + "signature": "st.json(body, *, expanded=True)", + "example": "
\n
\nimport streamlit as st\n\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display object or string as a pretty-printed JSON string.", + "args": [ + { + "name": "body", + "type_name": "object or str", + "is_optional": false, + "description": "

The object to print as JSON. All referenced objects should be\nserializable to JSON as well. If object is a string, we assume it\ncontains serialized JSON.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean that allows the user to set whether the initial\nstate of this json element should be expanded. Defaults to True.\nThis argument can only be supplied by keyword.

\n", + "default": "True." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/json.py#L35" + }, + "streamlit.latex": { + "name": "latex", + "signature": "st.latex(body)", + "example": "
\n
\nimport streamlit as st\n\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", + "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", + "args": [ + { + "name": "body", + "type_name": "str or SymPy expression", + "is_optional": false, + "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/markdown.py#L174" + }, + "streamlit.line_chart": { + "name": "line_chart", + "signature": "st.line_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\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 \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict or None", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/dataframe_selector.py#L160" + }, + "streamlit.map": { + "name": "map", + "signature": "st.map(data=None, zoom=None, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a map with points on it.

\n

This is a wrapper around st.pydeck_chart to quickly create\nscatterplot charts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to be plotted. Must have two columns:

\n
    \n
  • latitude called 'lat', 'latitude', 'LAT', 'LATITUDE'
  • \n
  • longitude called 'lon', 'longitude', 'LON', 'LONGITUDE'.
  • \n
\n", + "default": null + }, + { + "name": "zoom", + "type_name": "int", + "is_optional": false, + "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/map.py#L76" + }, + "streamlit.markdown": { + "name": "markdown", + "signature": "st.markdown(body, unsafe_allow_html=False)", + "examples": "
\n
\nimport streamlit as st\n\nst.markdown('Streamlit is **_really_ cool**.')\nst.markdown(\u201dThis text is :red[colored red], and this is **:blue[colored]** and bold.\u201d)\nst.markdown(":green[$\\sqrt{x^2+y^2}=1$] is a Pythagorean identity. :pencil:")\n
\n
\n", + "description": "Display string formatted as Markdown.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/markdown.py#L29" + }, + "streamlit.metric": { + "name": "metric", + "signature": "st.metric(label, value, delta=None, delta_color=\"normal\", help=None, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n \n (view standalone Streamlit app)\n \n

st.metric looks especially nice in combination with st.columns:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n \n (view standalone Streamlit app)\n \n

The delta indicator color can also be inverted or turned off:

\n
\nimport streamlit as st\n\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

The header or title for the metric. The label can optionally contain\nMarkdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Value of the metric. None is rendered as a long dash.

\n", + "default": null + }, + { + "name": "delta", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Indicator of how the metric changed, rendered with an arrow below\nthe metric. If delta is negative (int/float) or starts with a minus\nsign (str), the arrow points down and the text is red; else the\narrow points up and the text is green. If None (default), no delta\nindicator is shown.

\n", + "default": null + }, + { + "name": "delta_color", + "type_name": "str", + "is_optional": false, + "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the metric label.

\n", + "default": null + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/metric.py#L46" + }, + "streamlit.multiselect": { + "name": "multiselect", + "signature": "st.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", max_selections=None)", + "example": "
\n
\nimport streamlit as st\n\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence[V], numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "default", + "type_name": "[V], V, or None", + "is_optional": false, + "description": "

List of default values. Can also be a single value.

\n", + "default": "values." + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of selectbox options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe multiselect.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the multiselect.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this multiselect's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the multiselect widget if set\nto True. The default is False. This argument can only be supplied\nby keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "max_selections", + "type_name": "int", + "is_optional": false, + "description": "

The max selections that can be selected at a time.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list", + "is_generator": false, + "description": "

A list with the selected options

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/multiselect.py#L145" + }, + "streamlit.number_input": { + "name": "number_input", + "signature": "st.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a numeric input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. Output must be purely numeric. This does not impact\nthe return value. Valid formatters: %d %e %f %g %i %u

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this number_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the number input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int or float", + "is_generator": false, + "description": "

The current value of the numeric input widget. The return type\nwill match the data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/number_input.py#L66" + }, + "streamlit.plotly_chart": { + "name": "plotly_chart", + "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", theme=\"streamlit\", **kwargs)", + "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport numpy as np\nimport plotly.figure_factory as ff\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n        hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", + "args": [ + { + "name": "figure_or_data", + "type_name": "plotly.graph_objs.Figure, plotly.graph_objs.Data,", + "is_optional": false, + "description": "

dict/list of plotly.graph_objs.Figure/Data

\n

See https://plot.ly/python/ for examples of graph descriptions.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + }, + { + "name": "sharing", + "type_name": "{'streamlit', 'private', 'secret', 'public'}", + "is_optional": false, + "description": "

Use 'streamlit' to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": null, + "is_optional": null, + "description": "

Any argument accepted by Plotly's plot() function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/plotly_chart.py#L81" + }, + "streamlit.progress": { + "name": "progress", + "signature": "st.progress(value, text=None)", + "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport streamlit as st\nimport time\n\nprogress_text = "Operation in progress. Please wait."\nmy_bar = st.progress(0, text=progress_text)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1, text=progress_text)\n
\n
\n", + "description": "Display a progress bar.", + "args": [ + { + "name": "value", + "type_name": "int or float", + "is_optional": false, + "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", + "default": null + }, + { + "name": "text", + "type_name": "str or None", + "is_optional": false, + "description": "

A message to display above the progress bar. The text can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/progress.py#L66" + }, + "streamlit.pydeck_chart": { + "name": "pydeck_chart", + "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)", + "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport pydeck as pdk\n\nchart_data = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=chart_data,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=chart_data,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", + "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "args": [ + { + "name": "pydeck_obj", + "type_name": "pydeck.Deck or None", + "is_optional": false, + "description": "

Object specifying the PyDeck chart to draw.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/deck_gl_json_chart.py#L36" + }, + "streamlit.pyplot": { + "name": "pyplot", + "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)", + "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", + "example": "
\n
\nimport streamlit as st\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a matplotlib.pyplot figure.", + "args": [ + { + "name": "fig", + "type_name": "Matplotlib Figure", + "is_optional": false, + "description": "

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

\n", + "default": null + }, + { + "name": "clear_figure", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", + "default": "based" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Arguments to pass to Matplotlib's savefig function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/pyplot.py#L38" + }, + "streamlit.radio": { + "name": "radio", + "signature": "st.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ngenre = st.radio(\n    "What\\'s your favorite movie genre",\n    ('Comedy', 'Drama', 'Documentary'))\n\nif genre == 'Comedy':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn\\'t select comedy.")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a radio button widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this radio group is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the radio options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of radio options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe radio.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the radio.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this radio's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the radio button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "horizontal", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", + "default": "false" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/radio.py#L75" + }, + "streamlit.select_slider": { + "name": "select_slider", + "signature": "st.select_slider(label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\nimport streamlit as st\n\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nimport streamlit as st\n\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n \n (view standalone Streamlit app)\n \n ", + "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the slider options. All options will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", + "default": "." + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to first option.

\n", + "default": "first" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels from the options.\nargument. It receives the option as an argument and its output\nwill be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the select slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this select_slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the select slider if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any value or tuple of any value", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/select_slider.py#L106" + }, + "streamlit.selectbox": { + "name": "selectbox", + "signature": "st.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a select widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels. It receives the option\nas an argument and its output will be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the selectbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this selectbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the selectbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/selectbox.py#L71" + }, + "streamlit.set_option": { + "name": "set_option", + "signature": "st.set_option(key, value)", + "description": "

Set config option.

\n
\n
Currently, only the following config options can be set within the script itself:
\n
    \n
  • client.caching
  • \n
  • client.displayEnabled
  • \n
  • deprecation.*
  • \n
\n
\n
\n

Calling with any other options will raise StreamlitAPIException.

\n

Run streamlit config show in the terminal to see all available options.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

The config option key of the form "section.optionName". To see all\navailable options, run streamlit config show on a terminal.

\n", + "default": null + }, + { + "name": "value", + "type_name": null, + "is_optional": null, + "description": "

The new value to assign to this config option.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/config.py#L89" + }, + "streamlit.set_page_config": { + "name": "set_page_config", + "signature": "st.set_page_config(page_title=None, page_icon=None, layout=\"centered\", initial_sidebar_state=\"auto\", menu_items=None)", + "example": "
\nimport streamlit as st\n\nst.set_page_config(\n    page_title="Ex-stream-ly Cool App",\n    page_icon="\ud83e\uddca",\n    layout="wide",\n    initial_sidebar_state="expanded",\n    menu_items={\n        'Get Help': 'https://www.extremelycoolapp.com/help',\n        'Report a bug': "https://www.extremelycoolapp.com/bug",\n        'About': "# This is a header. This is an *extremely* cool app!"\n    }\n)\n
\n", + "description": "

Configures the default settings of the page.

\n
\n

Note

\n

This must be the first Streamlit command used in your app, and must only\nbe set once.

\n
\n", + "args": [ + { + "name": "page_title", + "type_name": "str or None", + "is_optional": false, + "description": "

The page title, shown in the browser tab. If None, defaults to the\nfilename of the script ("app.py" would show "app \u2022 Streamlit").

\n", + "default": "the" + }, + { + "name": "page_icon", + "type_name": "Anything supported by st.image or str or None", + "is_optional": false, + "description": "

The page favicon.\nBesides the types supported by st.image (like URLs or numpy arrays),\nyou can pass in an emoji as a string ("\ud83e\udd88") or a shortcode (":shark:").\nIf you're feeling lucky, try "random" for a random emoji!\nEmoji icons are courtesy of Twemoji and loaded from MaxCDN.

\n", + "default": null + }, + { + "name": "layout", + "type_name": "\"centered\" or \"wide\"", + "is_optional": false, + "description": "

How the page content should be laid out. Defaults to "centered",\nwhich constrains the elements into a centered column of fixed width;\n"wide" uses the entire screen.

\n", + "default": "s" + }, + { + "name": "initial_sidebar_state", + "type_name": "\"auto\" or \"expanded\" or \"collapsed\"", + "is_optional": false, + "description": "

How the sidebar should start out. Defaults to "auto",\nwhich hides the sidebar on mobile-sized devices, and shows it otherwise.\n"expanded" shows the sidebar initially; "collapsed" hides it.

\n", + "default": "s" + }, + { + "name": "menu_items", + "type_name": "dict", + "is_optional": false, + "description": "

Configure the menu that appears on the top-right side of this app.\nThe keys in this dict denote the menu item you'd like to configure:

\n
    \n
  • \n
    "Get help": str or None
    \n
    The URL this menu item should point to.\nIf None, hides this menu item.
    \n
    \n
  • \n
  • \n
    "Report a Bug": str or None
    \n
    The URL this menu item should point to.\nIf None, hides this menu item.
    \n
    \n
  • \n
  • \n
    "About": str or None
    \n
    A markdown string to show in the About dialog.\nIf None, only shows Streamlit's default About text.
    \n
    \n
  • \n
\n

The URL may also refer to an email address e.g. mailto:john@example.com.

\n", + "default": "About" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/commands/page_config.py#L114" + }, + "streamlit.slider": { + "name": "slider", + "signature": "st.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nimport streamlit as st\n\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nimport streamlit as st\nfrom datetime import time\n\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nimport streamlit as st\nfrom datetime import datetime\n\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The minimum permitted value.\nDefaults to 0 if the value is an int, 0.0 if a float,\nvalue - timedelta(days=14) if a date/datetime, time.min if a time

\n", + "default": "0" + }, + { + "name": "max_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The maximum permitted value.\nDefaults to 100 if the value is an int, 1.0 if a float,\nvalue + timedelta(days=14) if a date/datetime, time.max if a time

\n", + "default": "100" + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to min_value.

\n", + "default": "min_value." + }, + { + "name": "step", + "type_name": "int/float/timedelta or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. This does not impact the return value.\nFormatter for int/float supports: %d %e %f %g %i\nFormatter for date/time/datetime uses Moment.js notation:\nhttps://momentjs.com/docs/#/displaying/format/

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the slider if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int/float/date/time/datetime or tuple of int/float/date/time/datetime", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/slider.py#L171" + }, + "streamlit.snow": { + "name": "snow", + "signature": "st.snow()", + "example": "
\n
\nimport streamlit as st\n\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", + "description": "Draw celebratory snowfall.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/snow.py#L25" + }, + "streamlit.spinner": { + "name": "spinner", + "signature": "st.spinner(text=\"In progress...\")", + "example": "
\n
\nimport time\nimport streamlit as st\n\nwith st.spinner('Wait for it...'):\n    time.sleep(5)\nst.success('Done!')\n
\n
\n", + "description": "Temporarily displays a message while executing a block of code.", + "args": [ + { + "name": "text", + "type_name": "str", + "is_optional": false, + "description": "

A message to display while executing that block

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/spinner.py#L23" + }, + "streamlit.stop": { + "name": "stop", + "signature": "st.stop()", + "example": "
\n
\nimport streamlit as st\n\nname = st.text_input('Name')\nif not name:\n  st.warning('Please input a name.')\n  st.stop()\nst.success('Thank you for inputting a name.')\n
\n
\n", + "description": "

Stops execution immediately.

\n

Streamlit will not run any statements after st.stop().\nWe recommend rendering a message to explain why the script has stopped.\nWhen run outside of Streamlit, this will raise an Exception.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/commands/execution_control.py#L25" + }, + "streamlit.subheader": { + "name": "subheader", + "signature": "st.subheader(body, anchor=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.subheader('This is a subheader')\nst.subheader('A subheader with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "Display text in subheader formatting.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/heading.py#L76" + }, + "streamlit.success": { + "name": "success", + "signature": "st.success(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", + "description": "Display a success message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The success text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/alert.py#L136" + }, + "streamlit.table": { + "name": "table", + "signature": "st.table(data=None)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/dataframe_selector.py#L122" + }, + "streamlit.tabs": { + "name": "tabs", + "signature": "st.tabs(tabs)", + "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\nimport streamlit as st\n\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", + "args": [ + { + "name": "tabs", + "type_name": "list of strings", + "is_optional": false, + "description": "

Creates a tab for each string in the list. The first tab is selected by default.\nThe string is used as the name of the tab and can optionally contain Markdown,\nsupporting the following elements: Bold, Italics, Strikethroughs, Inline Code,\nEmojis, and Links.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": "." + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/layouts.py#L208" + }, + "streamlit.text": { + "name": "text", + "signature": "st.text(body)", + "example": "
\n
\nimport streamlit as st\n\nst.text('This is some text.')\n
\n
\n", + "description": "Write fixed-width and preformatted text.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/text.py#L27" + }, + "streamlit.text_area": { + "name": "text_area", + "signature": "st.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", + "description": "Display a multi-line text input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Maximum number of characters allowed in text area.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the textarea.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_area's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text area is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text area if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/text_widgets.py#L272" + }, + "streamlit.text_input": { + "name": "text_input", + "signature": "st.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a single-line text input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Max number of characters allowed in text input.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str", + "is_optional": false, + "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "autocomplete", + "type_name": "str", + "is_optional": false, + "description": "

An optional value that will be passed to the <input> element's\nautocomplete property. If unspecified, this value will be set to\n"new-password" for "password" inputs, and the empty string for\n"default" inputs. For more details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text input is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/text_widgets.py#L69" + }, + "streamlit.time_input": { + "name": "time_input", + "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a time input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this time input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.time/datetime.datetime", + "is_optional": false, + "description": "

The value of this widget when it first renders. This will be\ncast to str internally. Defaults to the current time.

\n", + "default": "the" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this time_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the time input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.time", + "is_generator": false, + "description": "

The current value of the time input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/time_widgets.py#L212" + }, + "streamlit.title": { + "name": "title", + "signature": "st.title(body, anchor=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.title('This is a title')\nst.title('A title with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/heading.py#L122" + }, + "streamlit.vega_lite_chart": { + "name": "vega_lite_chart", + "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, theme=\"streamlit\", **kwargs)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(chart_data, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", + "description": "Display a chart using the Vega-Lite library.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "spec", + "type_name": "dict or None", + "is_optional": false, + "description": "

The Vega-Lite spec for the chart. If the spec was already passed in\nthe previous argument, this must be set to None. See\nhttps://vega.github.io/vega-lite/docs/ for more info.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Same as spec, but as keywords.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/dataframe_selector.py#L475" + }, + "streamlit.video": { + "name": "video", + "signature": "st.video(data, format=\"video/mp4\", start_time=0)", + "example": "
\n
\nimport streamlit as st\n\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", + "description": "Display a video player.", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "default": null + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the video file. Defaults to 'video/mp4'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/media.py#L117" + }, + "streamlit.warning": { + "name": "warning", + "signature": "st.warning(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", + "description": "Display warning message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The warning text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/alert.py#L71" + }, + "streamlit.write": { + "name": "write", + "signature": "st.write(*args, unsafe_allow_html=False, **kwargs)", + "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nimport streamlit as st\n\nst.write('Hello, *World!* :sunglasses:')\n
\n\n \n \n (view standalone Streamlit app)\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nimport streamlit as st\nimport pandas as pd\n\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n \n (view standalone Streamlit app)\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nimport streamlit as st\n\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n \n (view standalone Streamlit app)\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression, emoji shortcodes, and colored text.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/write.py#L47" + }, + "streamlit.experimental_memo.clear": { + "name": "experimental_memo.clear", + "signature": "st.experimental_memo.clear()", + "description": "Clear all in-memory and on-disk data caches.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/runtime/caching/cache_data_api.py#L541" + }, + "streamlit.cache_data.clear": { + "name": "cache_data.clear", + "signature": "st.cache_data.clear(self)", + "description": "Clear all in-memory and on-disk data caches.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/runtime/caching/cache_data_api.py#L541" + }, + "streamlit.experimental_singleton.clear": { + "name": "experimental_singleton.clear", + "signature": "st.experimental_singleton.clear()", + "description": "Clear all cache_resource caches.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/runtime/caching/cache_resource_api.py#L396" + }, + "streamlit.cache_resource.clear": { + "name": "cache_resource.clear", + "signature": "st.cache_resource.clear(self)", + "description": "Clear all cache_resource caches.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/runtime/caching/cache_resource_api.py#L396" + }, + "streamlit.components.v1.declare_component": { + "name": "declare_component", + "signature": "st.components.v1.declare_component(name, path=None, url=None)", + "description": "Create and register a custom component.", + "args": [ + { + "name": "name", + "type_name": "str", + "is_optional": false, + "description": "

A short, descriptive name for the component. Like, "slider".

\n", + "default": null + }, + { + "name": "path", + "type_name": "str or None", + "is_optional": false, + "description": "

The path to serve the component's frontend files from. Either\npath or url must be specified, but not both.

\n", + "default": null + }, + { + "name": "url", + "type_name": "str or None", + "is_optional": false, + "description": "

The URL that the component is served from. Either path or url\nmust be specified, but not both.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "CustomComponent", + "is_generator": false, + "description": "

A CustomComponent that can be called like a function.\nCalling the component will create a new instance of the component\nin the Streamlit app.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/components/v1/components.py#L246" + }, + "streamlit.components.v1.html": { + "name": "html", + "signature": "st.components.v1.html(html, width=None, height=None, scrolling=False)", + "description": "Display an HTML string in an iframe.", + "args": [ + { + "name": "html", + "type_name": "str", + "is_optional": false, + "description": "

The HTML string to embed in the iframe.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", + "default": "the" + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", + "default": "150." + }, + { + "name": "scrolling", + "type_name": "bool", + "is_optional": false, + "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/iframe.py#L59" + }, + "streamlit.components.v1.iframe": { + "name": "iframe", + "signature": "st.components.v1.iframe(src, width=None, height=None, scrolling=False)", + "description": "Load a remote URL in an iframe.", + "args": [ + { + "name": "src", + "type_name": "str", + "is_optional": false, + "description": "

The URL of the page to embed.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", + "default": "the" + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", + "default": "150." + }, + { + "name": "scrolling", + "type_name": "bool", + "is_optional": false, + "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/iframe.py#L25" + }, + "DeltaGenerator.add_rows": { + "name": "add_rows", + "signature": "element.add_rows(self, data=None, **kwargs)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf1 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table = st.table(df1)\n\ndf2 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table.add_rows(df2)\n# Now the table shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

You can do the same thing with plots. For example, if you want to add\nmore data to a line chart:

\n
\n# Assuming df1 and df2 from the example above still exist...\nmy_chart = st.line_chart(df1)\nmy_chart.add_rows(df2)\n# Now the chart shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

And for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:

\n
\nmy_chart = st.vega_lite_chart({\n    'mark': 'line',\n    'encoding': {'x': 'a', 'y': 'b'},\n    'datasets': {\n      'some_fancy_name': df1,  # <-- named dataset\n     },\n    'data': {'name': 'some_fancy_name'},\n}),\nmy_chart.add_rows(some_fancy_name=df2)  # <-- name used as keyword\n
\n
\n", + "description": "Concatenate a dataframe to the bottom of the current one.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, Iterable, dict, or None", + "is_optional": false, + "description": "

Table to concat. Optional.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "**kwargs", + "type_name": "pandas.DataFrame, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

The named dataset to concat. Optional. You can only pass in 1\ndataset (including the one in the data parameter).

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/dataframe_selector.py#L550" + }, + "DeltaGenerator.altair_chart": { + "name": "altair_chart", + "signature": "element.altair_chart(self, altair_chart, use_container_width=False, theme=\"streamlit\")", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(chart_data).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a chart using the Altair library.", + "args": [ + { + "name": "altair_chart", + "type_name": "altair.vegalite.v2.api.Chart", + "is_optional": false, + "description": "

The Altair chart object to display.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/dataframe_selector.py#L422" + }, + "DeltaGenerator.area_chart": { + "name": "area_chart", + "signature": "element.area_chart(self, data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/dataframe_selector.py#L247" + }, + "DeltaGenerator.audio": { + "name": "audio", + "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0, *, sample_rate=None)", + "example": "
\n
\nimport streamlit as st\nimport numpy as np\n\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n\nsample_rate = 44100  # 44100 samples per second\nseconds = 2  # Note duration of 2 seconds\nfrequency_la = 440  # Our played note will be 440 Hz\n# Generate array with seconds*sample_rate steps, ranging between 0 and seconds\nt = np.linspace(0, seconds, seconds * sample_rate, False)\n# Generate a 440 Hz sine wave\nnote_la = np.sin(frequency_la * t * 2 * np.pi)\n\nst.audio(note_la, sample_rate=sample_rate)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an audio player.", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw audio data, filename, or a URL pointing to the file to load.\nRaw data formats must include all necessary file headers to match the file\nformat specified via format.\nIf data is a numpy array, it must either be a 1D array of the waveform\nor a 2D array of shape (num_channels, num_samples) with waveforms\nfor all channels. See the default channel order at\nhttp://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx

\n", + "default": "channel" + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + }, + { + "name": "sample_rate", + "type_name": "int or None", + "is_optional": false, + "description": "

The sample rate of the audio data in samples per second. Only required if\ndata is a numpy array.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/media.py#L43" + }, + "DeltaGenerator.balloons": { + "name": "balloons", + "signature": "element.balloons(self)", + "example": "
\n
\nimport streamlit as st\n\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", + "description": "Draw celebratory balloons.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/balloons.py#L25" + }, + "DeltaGenerator.bar_chart": { + "name": "bar_chart", + "signature": "element.bar_chart(self, data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/dataframe_selector.py#L334" + }, + "DeltaGenerator.beta_columns": { + "name": "beta_columns", + "signature": "element.beta_columns(self, spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/layouts.py#L77" + }, + "DeltaGenerator.beta_container": { + "name": "beta_container", + "signature": "element.beta_container(self)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/layouts.py#L29" + }, + "DeltaGenerator.beta_expander": { + "name": "beta_expander", + "signature": "element.beta_expander(self, label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/layouts.py#L306" + }, + "DeltaGenerator.bokeh_chart": { + "name": "bokeh_chart", + "signature": "element.bokeh_chart(self, figure, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", + "args": [ + { + "name": "figure", + "type_name": "bokeh.plotting.figure.Figure", + "is_optional": false, + "description": "

A Bokeh figure to plot.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Bokeh's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/bokeh_chart.py#L36" + }, + "DeltaGenerator.button": { + "name": "button", + "signature": "element.button(self, label, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\n\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a button widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, and Emojis.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/button.py#L61" + }, + "DeltaGenerator.camera_input": { + "name": "camera_input", + "signature": "element.camera_input(self, label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", + "description": "Display a widget that returns pictures from the user's webcam.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this widget is used for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the camera input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this camera_input's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile", + "is_generator": false, + "description": "

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/camera_input.py#L109" + }, + "DeltaGenerator.caption": { + "name": "caption", + "signature": "element.caption(self, body, unsafe_allow_html=False)", + "examples": "
\n
\nimport streamlit as st\n\nst.caption('This is a string that explains something above.')\nst.caption('A caption with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/markdown.py#L119" + }, + "DeltaGenerator.checkbox": { + "name": "checkbox", + "signature": "element.checkbox(self, label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a checkbox widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this checkbox is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "value", + "type_name": "bool", + "is_optional": false, + "description": "

Preselect the checkbox when it first renders. This will be\ncast to bool internally.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the checkbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this checkbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

Whether or not the checkbox is checked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/checkbox.py#L52" + }, + "DeltaGenerator.code": { + "name": "code", + "signature": "element.code(self, body, language=\"python\")", + "example": "
\n
\nimport streamlit as st\n\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", + "description": "

Display a code block with optional syntax highlighting.

\n

(This is a convenience wrapper around st.markdown())

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as code.

\n", + "default": null + }, + { + "name": "language", + "type_name": "str or None", + "is_optional": false, + "description": "

The language that the code is written in, for syntax highlighting.\nIf None, the code will be unstyled. Defaults to "python".

\n

For a list of available language values, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/markdown.py#L83" + }, + "DeltaGenerator.color_picker": { + "name": "color_picker", + "signature": "element.color_picker(self, label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a color picker widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "str", + "is_optional": false, + "description": "

The hex value of this widget when it first renders. If None,\ndefaults to black.

\n", + "default": "black." + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the color picker.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this color_picker's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The selected color as a hex string.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/color_picker.py#L52" + }, + "DeltaGenerator.columns": { + "name": "columns", + "signature": "element.columns(self, spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/layouts.py#L77" + }, + "DeltaGenerator.container": { + "name": "container", + "signature": "element.container(self)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/layouts.py#L29" + }, + "DeltaGenerator.dataframe": { + "name": "dataframe", + "signature": "element.dataframe(self, data=None, width=None, height=None, *, use_container_width=False)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\nst.dataframe(df, 200, 100)\n
\n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a dataframe as an interactive table.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. (It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.)\nStyler support is experimental!\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the dataframe expressed in pixels. If None, the width\nwill be automatically calculated based on the column content.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the dataframe expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the dataframe width to the width of the parent container.\nThis takes precedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/dataframe_selector.py#L40" + }, + "DeltaGenerator.date_input": { + "name": "date_input", + "signature": "element.date_input(self, label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nd = st.date_input(\n    "When\\'s your birthday",\n    datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a date input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this date input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", + "is_optional": false, + "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", + "default": "today" + }, + { + "name": "min_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", + "default": "value" + }, + { + "name": "max_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", + "default": "value" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this date_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.date or a tuple with 0-2 dates", + "is_generator": false, + "description": "

The current value of the date input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/time_widgets.py#L380" + }, + "DeltaGenerator.download_button": { + "name": "download_button", + "signature": "element.download_button(self, label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False, use_container_width=False)", + "examples": "
\n

Download a large DataFrame as a CSV:

\n
\nimport streamlit as st\n\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\nimport streamlit as st\n\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nimport streamlit as st\n\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nimport streamlit as st\n\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, and Emojis.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "data", + "type_name": "str or bytes or file", + "is_optional": false, + "description": "

The contents of the file to be downloaded. See example below for\ncaching techniques to avoid recomputing this data unnecessarily.

\n", + "default": null + }, + { + "name": "file_name", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the name of the file to be downloaded,\nsuch as 'my_file.csv'. If not specified, the name will be\nautomatically generated.

\n", + "default": null + }, + { + "name": "mime", + "type_name": "str or None", + "is_optional": false, + "description": "

The MIME type of the data. If None, defaults to "text/plain"\n(if data is of type str or is a textual file) or\n"application/octet-stream" (if data is of type bytes or is a\nbinary file).

\n", + "default": "s" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/button.py#L155" + }, + "DeltaGenerator.empty": { + "name": "empty", + "signature": "element.empty(self)", + "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport streamlit as st\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nimport streamlit as st\n\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", + "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/empty.py#L24" + }, + "DeltaGenerator.error": { + "name": "error", + "signature": "element.error(self, body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", + "description": "Display error message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The error text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/alert.py#L39" + }, + "DeltaGenerator.exception": { + "name": "exception", + "signature": "element.exception(self, exception)", + "example": "
\n
\nimport streamlit as st\n\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", + "description": "Display an exception.", + "args": [ + { + "name": "exception", + "type_name": "Exception", + "is_optional": false, + "description": "

The exception to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/exception.py#L50" + }, + "DeltaGenerator.expander": { + "name": "expander", + "signature": "element.expander(self, label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/layouts.py#L306" + }, + "DeltaGenerator.experimental_data_editor": { + "name": "experimental_data_editor", + "signature": "element.experimental_data_editor(self, data, *, width=None, height=None, use_container_width=False, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.experimental_data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n \n (view standalone Streamlit app)\n \n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.experimental_data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a data editor widget.

\n

Display a data editor widget that allows you to edit DataFrames and\nmany other data structures in a table-like UI.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None", + "is_optional": false, + "description": "

The data to edit in the data editor.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the data editor expressed in pixels. If None, the width will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the data editor expressed in pixels. If None, the height will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the data editor width to the width of the parent container.\nThis takes precedence over the width argument. Defaults to False.

\n", + "default": "False." + }, + { + "name": "num_rows", + "type_name": "\"fixed\" or \"dynamic\"", + "is_optional": false, + "description": "

Specifies if the user can add and delete rows in the data editor.\nIf "fixed", the user cannot add or delete rows. If "dynamic", the user can\nadd and delete rows in the data editor, but column sorting is disabled.\nDefaults to "fixed".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean which, if True, disables the data editor and prevents\nany edits. Defaults to False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the unique key for this widget. If this\nis omitted, a key will be generated for the widget based on its\ncontent. Multiple widgets of the same type may not share the same\nkey.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this data_editor's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "pd.DataFrame, pd.Styler, pyarrow.Table, np.ndarray, list, set, tuple, or dict.", + "is_generator": false, + "description": "

The edited data. The edited data is returned in its original data type if\nit corresponds to any of the supported return types. All other data types\nare returned as a pd.DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/data_editor.py#L448" + }, + "DeltaGenerator.file_uploader": { + "name": "file_uploader", + "signature": "element.file_uploader(self, label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nimport streamlit as st\nimport pandas as pd\nfrom io import StringIO\n\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nimport streamlit as st\n\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this file uploader is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str or list of str or None", + "is_optional": false, + "description": "

Array of allowed extensions. ['png', 'jpg']\nThe default is None, which means all extensions are allowed.

\n", + "default": "None" + }, + { + "name": "accept_multiple_files", + "type_name": "bool", + "is_optional": false, + "description": "

If True, allows the user to upload multiple files at the same time,\nin which case the return value will be a list of files.\nDefault: False

\n", + "default": "False" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the file uploader.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this file_uploader's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the file uploader if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile or list of UploadedFile", + "is_generator": false, + "description": "
    \n
  • If accept_multiple_files is False, returns either None or\nan UploadedFile object.
  • \n
  • If accept_multiple_files is True, returns a list with the\nuploaded files as UploadedFile objects. If no files were\nuploaded, returns an empty list.
  • \n
\n

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/file_uploader.py#L205" + }, + "DeltaGenerator.form": { + "name": "form", + "signature": "element.form(self, key, clear_on_submit=False)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n

Inserting elements out of order:

\n
\nimport streamlit as st\n\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n
\n", + "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

A string that identifies the form. Each form must have its own\nkey. (This key is not displayed to the user in the interface.)

\n", + "default": null + }, + { + "name": "clear_on_submit", + "type_name": "bool", + "is_optional": false, + "description": "

If True, all widgets inside the form will be reset to their default\nvalues after the user presses the Submit button. Defaults to False.\n(Note that Custom Components are unaffected by this flag, and\nwill not be reset to their defaults on form submission.)

\n", + "default": "values" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/form.py#L118" + }, + "DeltaGenerator.form_submit_button": { + "name": "form_submit_button", + "signature": "element.form_submit_button(self, label=\"Submit\", help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nDefaults to "Submit".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

A tooltip that gets displayed when the button is hovered over.\nDefaults to None.

\n", + "default": "None." + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/form.py#L211" + }, + "DeltaGenerator.graphviz_chart": { + "name": "graphviz_chart", + "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nimport graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a graph using the dagre-d3 library.", + "args": [ + { + "name": "figure_or_dot", + "type_name": "graphviz.dot.Graph, graphviz.dot.Digraph, str", + "is_optional": false, + "description": "

The Graphlib graph object or dot string to display

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/graphviz_chart.py#L39" + }, + "DeltaGenerator.header": { + "name": "header", + "signature": "element.header(self, body, anchor=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.header('This is a header')\nst.header('A header with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "Display text in header formatting.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/heading.py#L31" + }, + "DeltaGenerator.help": { + "name": "help", + "signature": "element.help(self, obj)", + "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nimport streamlit as st\nimport pandas\n\nst.help(pandas.DataFrame)\n
\n

Want to quickly check what datatype is output by a certain function?\nTry:

\n
\nimport streamlit as st\n\nx = my_poorly_documented_function()\nst.help(x)\n
\n
\n", + "description": "

Display object's doc string, nicely formatted.

\n

Displays the doc string for this object.

\n", + "args": [ + { + "name": "obj", + "type_name": "Object", + "is_optional": false, + "description": "

The object whose docstring should be displayed.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/doc_string.py#L44" + }, + "DeltaGenerator.image": { + "name": "image", + "signature": "element.image(self, image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", + "example": "
\n
\nimport streamlit as st\nfrom PIL import Image\n\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display an image or list of images.", + "args": [ + { + "name": "image", + "type_name": "numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]", + "is_optional": false, + "description": "

Monochrome image of shape (w,h) or (w,h,1)\nOR a color image of shape (w,h,3)\nOR an RGBA image of shape (w,h,4)\nOR a URL to fetch the image from\nOR a path of a local image file\nOR an SVG XML string like <svg xmlns=...</svg>\nOR a list of one of the above, to display multiple images.

\n", + "default": null + }, + { + "name": "caption", + "type_name": "str or list of str", + "is_optional": false, + "description": "

Image caption. If displaying multiple images, caption should be a\nlist of captions (one for each image).

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Image width. None means use the image width,\nbut do not exceed the width of the column.\nShould be set for SVG images, as they have no default image width.

\n", + "default": "image" + }, + { + "name": "use_column_width", + "type_name": "'auto' or 'always' or 'never' or bool", + "is_optional": false, + "description": "

If 'auto', set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf 'always' or True, set the image's width to the column width.\nIf 'never' or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", + "default": null + }, + { + "name": "clamp", + "type_name": "bool", + "is_optional": false, + "description": "

Clamp image pixel values to a valid range ([0-255] per channel).\nThis is only meaningful for byte array images; the parameter is\nignored for image URLs. If this is not set, and an image has an\nout-of-range value, an error will be thrown.

\n", + "default": null + }, + { + "name": "channels", + "type_name": "'RGB' or 'BGR'", + "is_optional": false, + "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to 'RGB', meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to 'BGR', instead.

\n", + "default": "s" + }, + { + "name": "output_format", + "type_name": "'JPEG', 'PNG', or 'auto'", + "is_optional": false, + "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to 'auto' which identifies the compression type based\non the type and format of the image argument.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/image.py#L67" + }, + "DeltaGenerator.info": { + "name": "info", + "signature": "element.info(self, body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", + "description": "Display an informational message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The info text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/alert.py#L103" + }, + "DeltaGenerator.json": { + "name": "json", + "signature": "element.json(self, body, *, expanded=True)", + "example": "
\n
\nimport streamlit as st\n\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display object or string as a pretty-printed JSON string.", + "args": [ + { + "name": "body", + "type_name": "object or str", + "is_optional": false, + "description": "

The object to print as JSON. All referenced objects should be\nserializable to JSON as well. If object is a string, we assume it\ncontains serialized JSON.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean that allows the user to set whether the initial\nstate of this json element should be expanded. Defaults to True.\nThis argument can only be supplied by keyword.

\n", + "default": "True." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/json.py#L35" + }, + "DeltaGenerator.latex": { + "name": "latex", + "signature": "element.latex(self, body)", + "example": "
\n
\nimport streamlit as st\n\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", + "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", + "args": [ + { + "name": "body", + "type_name": "str or SymPy expression", + "is_optional": false, + "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/markdown.py#L174" + }, + "DeltaGenerator.line_chart": { + "name": "line_chart", + "signature": "element.line_chart(self, data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\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 \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict or None", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/dataframe_selector.py#L160" + }, + "DeltaGenerator.map": { + "name": "map", + "signature": "element.map(self, data=None, zoom=None, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a map with points on it.

\n

This is a wrapper around st.pydeck_chart to quickly create\nscatterplot charts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to be plotted. Must have two columns:

\n
    \n
  • latitude called 'lat', 'latitude', 'LAT', 'LATITUDE'
  • \n
  • longitude called 'lon', 'longitude', 'LON', 'LONGITUDE'.
  • \n
\n", + "default": null + }, + { + "name": "zoom", + "type_name": "int", + "is_optional": false, + "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/map.py#L76" + }, + "DeltaGenerator.markdown": { + "name": "markdown", + "signature": "element.markdown(self, body, unsafe_allow_html=False)", + "examples": "
\n
\nimport streamlit as st\n\nst.markdown('Streamlit is **_really_ cool**.')\nst.markdown(\u201dThis text is :red[colored red], and this is **:blue[colored]** and bold.\u201d)\nst.markdown(":green[$\\sqrt{x^2+y^2}=1$] is a Pythagorean identity. :pencil:")\n
\n
\n", + "description": "Display string formatted as Markdown.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/markdown.py#L29" + }, + "DeltaGenerator.metric": { + "name": "metric", + "signature": "element.metric(self, label, value, delta=None, delta_color=\"normal\", help=None, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n \n (view standalone Streamlit app)\n \n

st.metric looks especially nice in combination with st.columns:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n \n (view standalone Streamlit app)\n \n

The delta indicator color can also be inverted or turned off:

\n
\nimport streamlit as st\n\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

The header or title for the metric. The label can optionally contain\nMarkdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Value of the metric. None is rendered as a long dash.

\n", + "default": null + }, + { + "name": "delta", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Indicator of how the metric changed, rendered with an arrow below\nthe metric. If delta is negative (int/float) or starts with a minus\nsign (str), the arrow points down and the text is red; else the\narrow points up and the text is green. If None (default), no delta\nindicator is shown.

\n", + "default": null + }, + { + "name": "delta_color", + "type_name": "str", + "is_optional": false, + "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the metric label.

\n", + "default": null + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/metric.py#L46" + }, + "DeltaGenerator.multiselect": { + "name": "multiselect", + "signature": "element.multiselect(self, label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", max_selections=None)", + "example": "
\n
\nimport streamlit as st\n\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence[V], numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "default", + "type_name": "[V], V, or None", + "is_optional": false, + "description": "

List of default values. Can also be a single value.

\n", + "default": "values." + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of selectbox options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe multiselect.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the multiselect.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this multiselect's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the multiselect widget if set\nto True. The default is False. This argument can only be supplied\nby keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "max_selections", + "type_name": "int", + "is_optional": false, + "description": "

The max selections that can be selected at a time.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list", + "is_generator": false, + "description": "

A list with the selected options

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/multiselect.py#L145" + }, + "DeltaGenerator.number_input": { + "name": "number_input", + "signature": "element.number_input(self, label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a numeric input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. Output must be purely numeric. This does not impact\nthe return value. Valid formatters: %d %e %f %g %i %u

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this number_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the number input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int or float", + "is_generator": false, + "description": "

The current value of the numeric input widget. The return type\nwill match the data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/number_input.py#L66" + }, + "DeltaGenerator.plotly_chart": { + "name": "plotly_chart", + "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", theme=\"streamlit\", **kwargs)", + "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport numpy as np\nimport plotly.figure_factory as ff\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n        hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", + "args": [ + { + "name": "figure_or_data", + "type_name": "plotly.graph_objs.Figure, plotly.graph_objs.Data,", + "is_optional": false, + "description": "

dict/list of plotly.graph_objs.Figure/Data

\n

See https://plot.ly/python/ for examples of graph descriptions.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + }, + { + "name": "sharing", + "type_name": "{'streamlit', 'private', 'secret', 'public'}", + "is_optional": false, + "description": "

Use 'streamlit' to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": null, + "is_optional": null, + "description": "

Any argument accepted by Plotly's plot() function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/plotly_chart.py#L81" + }, + "DeltaGenerator.progress": { + "name": "progress", + "signature": "element.progress(self, value, text=None)", + "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport streamlit as st\nimport time\n\nprogress_text = "Operation in progress. Please wait."\nmy_bar = st.progress(0, text=progress_text)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1, text=progress_text)\n
\n
\n", + "description": "Display a progress bar.", + "args": [ + { + "name": "value", + "type_name": "int or float", + "is_optional": false, + "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", + "default": null + }, + { + "name": "text", + "type_name": "str or None", + "is_optional": false, + "description": "

A message to display above the progress bar. The text can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/progress.py#L66" + }, + "DeltaGenerator.pydeck_chart": { + "name": "pydeck_chart", + "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)", + "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport pydeck as pdk\n\nchart_data = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=chart_data,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=chart_data,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", + "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "args": [ + { + "name": "pydeck_obj", + "type_name": "pydeck.Deck or None", + "is_optional": false, + "description": "

Object specifying the PyDeck chart to draw.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/deck_gl_json_chart.py#L36" + }, + "DeltaGenerator.pyplot": { + "name": "pyplot", + "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)", + "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", + "example": "
\n
\nimport streamlit as st\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a matplotlib.pyplot figure.", + "args": [ + { + "name": "fig", + "type_name": "Matplotlib Figure", + "is_optional": false, + "description": "

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

\n", + "default": null + }, + { + "name": "clear_figure", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", + "default": "based" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Arguments to pass to Matplotlib's savefig function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/pyplot.py#L38" + }, + "DeltaGenerator.radio": { + "name": "radio", + "signature": "element.radio(self, label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ngenre = st.radio(\n    "What\\'s your favorite movie genre",\n    ('Comedy', 'Drama', 'Documentary'))\n\nif genre == 'Comedy':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn\\'t select comedy.")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a radio button widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this radio group is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the radio options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of radio options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe radio.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the radio.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this radio's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the radio button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "horizontal", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", + "default": "false" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/radio.py#L75" + }, + "DeltaGenerator.select_slider": { + "name": "select_slider", + "signature": "element.select_slider(self, label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\nimport streamlit as st\n\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nimport streamlit as st\n\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n \n (view standalone Streamlit app)\n \n ", + "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the slider options. All options will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", + "default": "." + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to first option.

\n", + "default": "first" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels from the options.\nargument. It receives the option as an argument and its output\nwill be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the select slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this select_slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the select slider if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any value or tuple of any value", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/select_slider.py#L106" + }, + "DeltaGenerator.selectbox": { + "name": "selectbox", + "signature": "element.selectbox(self, label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a select widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels. It receives the option\nas an argument and its output will be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the selectbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this selectbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the selectbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/selectbox.py#L71" + }, + "DeltaGenerator.slider": { + "name": "slider", + "signature": "element.slider(self, label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nimport streamlit as st\n\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nimport streamlit as st\nfrom datetime import time\n\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nimport streamlit as st\nfrom datetime import datetime\n\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The minimum permitted value.\nDefaults to 0 if the value is an int, 0.0 if a float,\nvalue - timedelta(days=14) if a date/datetime, time.min if a time

\n", + "default": "0" + }, + { + "name": "max_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The maximum permitted value.\nDefaults to 100 if the value is an int, 1.0 if a float,\nvalue + timedelta(days=14) if a date/datetime, time.max if a time

\n", + "default": "100" + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to min_value.

\n", + "default": "min_value." + }, + { + "name": "step", + "type_name": "int/float/timedelta or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. This does not impact the return value.\nFormatter for int/float supports: %d %e %f %g %i\nFormatter for date/time/datetime uses Moment.js notation:\nhttps://momentjs.com/docs/#/displaying/format/

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the slider if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int/float/date/time/datetime or tuple of int/float/date/time/datetime", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/slider.py#L171" + }, + "DeltaGenerator.snow": { + "name": "snow", + "signature": "element.snow(self)", + "example": "
\n
\nimport streamlit as st\n\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", + "description": "Draw celebratory snowfall.", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/snow.py#L25" + }, + "DeltaGenerator.subheader": { + "name": "subheader", + "signature": "element.subheader(self, body, anchor=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.subheader('This is a subheader')\nst.subheader('A subheader with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "Display text in subheader formatting.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/heading.py#L76" + }, + "DeltaGenerator.success": { + "name": "success", + "signature": "element.success(self, body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", + "description": "Display a success message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The success text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/alert.py#L136" + }, + "DeltaGenerator.table": { + "name": "table", + "signature": "element.table(self, data=None)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/dataframe_selector.py#L122" + }, + "DeltaGenerator.tabs": { + "name": "tabs", + "signature": "element.tabs(self, tabs)", + "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\nimport streamlit as st\n\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n \n (view standalone Streamlit app)\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", + "args": [ + { + "name": "tabs", + "type_name": "list of strings", + "is_optional": false, + "description": "

Creates a tab for each string in the list. The first tab is selected by default.\nThe string is used as the name of the tab and can optionally contain Markdown,\nsupporting the following elements: Bold, Italics, Strikethroughs, Inline Code,\nEmojis, and Links.

\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n", + "default": "." + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/layouts.py#L208" + }, + "DeltaGenerator.text": { + "name": "text", + "signature": "element.text(self, body)", + "example": "
\n
\nimport streamlit as st\n\nst.text('This is some text.')\n
\n
\n", + "description": "Write fixed-width and preformatted text.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/text.py#L27" + }, + "DeltaGenerator.text_area": { + "name": "text_area", + "signature": "element.text_area(self, label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", + "description": "Display a multi-line text input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Maximum number of characters allowed in text area.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the textarea.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_area's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text area is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text area if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/text_widgets.py#L272" + }, + "DeltaGenerator.text_input": { + "name": "text_input", + "signature": "element.text_input(self, label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a single-line text input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Max number of characters allowed in text input.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str", + "is_optional": false, + "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "autocomplete", + "type_name": "str", + "is_optional": false, + "description": "

An optional value that will be passed to the <input> element's\nautocomplete property. If unspecified, this value will be set to\n"new-password" for "password" inputs, and the empty string for\n"default" inputs. For more details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text input is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/text_widgets.py#L69" + }, + "DeltaGenerator.time_input": { + "name": "time_input", + "signature": "element.time_input(self, label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "Display a time input widget.", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this time input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are not displayed. Display unsupported elements\nas literal characters by backslash-escaping them. E.g.\n1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.time/datetime.datetime", + "is_optional": false, + "description": "

The value of this widget when it first renders. This will be\ncast to str internally. Defaults to the current time.

\n", + "default": "the" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this time_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the time input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.time", + "is_generator": false, + "description": "

The current value of the time input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/time_widgets.py#L212" + }, + "DeltaGenerator.title": { + "name": "title", + "signature": "element.title(self, body, anchor=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.title('This is a title')\nst.title('A title with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/heading.py#L122" + }, + "DeltaGenerator.vega_lite_chart": { + "name": "vega_lite_chart", + "signature": "element.vega_lite_chart(self, data=None, spec=None, use_container_width=False, theme=\"streamlit\", **kwargs)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(chart_data, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n \n (view standalone Streamlit app)\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", + "description": "Display a chart using the Vega-Lite library.", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "spec", + "type_name": "dict or None", + "is_optional": false, + "description": "

The Vega-Lite spec for the chart. If the spec was already passed in\nthe previous argument, this must be set to None. See\nhttps://vega.github.io/vega-lite/docs/ for more info.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Same as spec, but as keywords.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/dataframe_selector.py#L475" + }, + "DeltaGenerator.video": { + "name": "video", + "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)", + "example": "
\n
\nimport streamlit as st\n\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", + "description": "Display a video player.", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "default": null + }, + { + "name": "format", + "type_name": "str", + "is_opctional": false, + "description": "

The mime type for the video file. Defaults to 'video/mp4'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/media.py#L117" + }, + "DeltaGenerator.warning": { + "name": "warning", + "signature": "element.warning(self, body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", + "description": "Display warning message.", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The warning text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/alert.py#L71" + }, + "DeltaGenerator.write": { + "name": "write", + "signature": "element.write(self, *args, unsafe_allow_html=False, **kwargs)", + "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nimport streamlit as st\n\nst.write('Hello, *World!* :sunglasses:')\n
\n\n \n \n (view standalone Streamlit app)\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nimport streamlit as st\nimport pandas as pd\n\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n \n (view standalone Streamlit app)\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nimport streamlit as st\n\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n \n (view standalone Streamlit app)\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", + "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression, emoji shortcodes, and colored text.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.20.0/lib/streamlit/elements/write.py#L47" + } + }, + "1.21.0": { + "streamlit.altair_chart": { + "name": "altair_chart", + "signature": "st.altair_chart(altair_chart, use_container_width=False, theme=\"streamlit\")", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(chart_data).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n
\n", + "description": "

Display a chart using the Altair library.

\n", + "args": [ + { + "name": "altair_chart", + "type_name": "altair.vegalite.v2.api.Chart", + "is_optional": false, + "description": "

The Altair chart object to display.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/dataframe_selector.py#L422" + }, + "streamlit.area_chart": { + "name": "area_chart", + "signature": "st.area_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n
\n", + "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/dataframe_selector.py#L247" + }, + "streamlit.audio": { + "name": "audio", + "signature": "st.audio(data, format=\"audio/wav\", start_time=0, *, sample_rate=None)", + "example": "
\n
\nimport streamlit as st\nimport numpy as np\n\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n\nsample_rate = 44100  # 44100 samples per second\nseconds = 2  # Note duration of 2 seconds\nfrequency_la = 440  # Our played note will be 440 Hz\n# Generate array with seconds*sample_rate steps, ranging between 0 and seconds\nt = np.linspace(0, seconds, seconds * sample_rate, False)\n# Generate a 440 Hz sine wave\nnote_la = np.sin(frequency_la * t * 2 * np.pi)\n\nst.audio(note_la, sample_rate=sample_rate)\n
\n\n \n
\n", + "description": "

Display an audio player.

\n", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw audio data, filename, or a URL pointing to the file to load.\nRaw data formats must include all necessary file headers to match the file\nformat specified via format.\nIf data is a numpy array, it must either be a 1D array of the waveform\nor a 2D array of shape (num_channels, num_samples) with waveforms\nfor all channels. See the default channel order at\nhttp://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx

\n", + "default": "channel" + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + }, + { + "name": "sample_rate", + "type_name": "int or None", + "is_optional": false, + "description": "

The sample rate of the audio data in samples per second. Only required if\ndata is a numpy array.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/media.py#L43" + }, + "streamlit.balloons": { + "name": "balloons", + "signature": "st.balloons()", + "example": "
\n
\nimport streamlit as st\n\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", + "description": "

Draw celebratory balloons.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/balloons.py#L25" + }, + "streamlit.bar_chart": { + "name": "bar_chart", + "signature": "st.bar_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n
\n", + "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/dataframe_selector.py#L334" + }, + "streamlit.beta_columns": { + "name": "beta_columns", + "signature": "st.beta_columns(spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/layouts.py#L77" + }, + "streamlit.beta_container": { + "name": "beta_container", + "signature": "st.beta_container()", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/layouts.py#L29" + }, + "streamlit.beta_expander": { + "name": "beta_expander", + "signature": "st.beta_expander(label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/layouts.py#L320" + }, + "streamlit.bokeh_chart": { + "name": "bokeh_chart", + "signature": "st.bokeh_chart(figure, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n
\n", + "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", + "args": [ + { + "name": "figure", + "type_name": "bokeh.plotting.figure.Figure", + "is_optional": false, + "description": "

A Bokeh figure to plot.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Bokeh's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/bokeh_chart.py#L36" + }, + "streamlit.button": { + "name": "button", + "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\n\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n
\n", + "description": "

Display a button widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/button.py#L61" + }, + "streamlit.cache": { + "name": "cache", + "signature": "st.cache(func=None, persist=False, allow_output_mutation=False, show_spinner=True, suppress_st_warning=False, hash_funcs=None, max_entries=None, ttl=None)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\n@st.cache(persist=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To disable hashing return values, set the allow_output_mutation parameter to True:

\n
\n@st.cache(allow_output_mutation=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. MongoClient) to a hash function (id) like this:

\n
\n@st.cache(hash_funcs={MongoClient: id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "pymongo.mongo_client.MongoClient") to the hash function instead:

\n
\n@st.cache(hash_funcs={"pymongo.mongo_client.MongoClient": id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n
\n", + "description": "

Function decorator to memoize function executions.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to cache. Streamlit hashes the function and dependent code.

\n", + "default": null + }, + { + "name": "persist", + "type_name": "boolean", + "is_optional": false, + "description": "

Whether to persist the cache on disk.

\n", + "default": null + }, + { + "name": "allow_output_mutation", + "type_name": "boolean", + "is_optional": false, + "description": "

Streamlit shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.

\n

If you know what you're doing and would like to override this warning, set this to True.

\n", + "default": null + }, + { + "name": "show_spinner", + "type_name": "boolean", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na cache miss.

\n", + "default": "True" + }, + { + "name": "suppress_st_warning", + "type_name": "boolean", + "is_optional": false, + "description": "

Suppress warnings about calling Streamlit commands from within\nthe cached function.

\n", + "default": null + }, + { + "name": "hash_funcs", + "type_name": "dict or None", + "is_optional": false, + "description": "

Mapping of types or fully qualified names to hash functions. This is used to override\nthe behavior of the hasher inside Streamlit's caching mechanism: when the hasher\nencounters an object, it will first check to see if its type matches a key in this\ndict and, if so, will use the provided function to generate a hash for it. See below\nfor an example of how this can be used.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." + }, + { + "name": "ttl", + "type_name": "float or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.

\n", + "default": "None." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/runtime/legacy_caching/caching.py#L486" + }, + "streamlit.cache_data": { + "name": "cache_data", + "signature": "st.cache_data(func=None, *, ttl, max_entries, show_spinner, persist, experimental_allow_widgets)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\nimport streamlit as st\n\n@st.cache_data(persist="disk")\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

By default, all parameters to a cached function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nconnection = make_database_connection()\nd1 = fetch_and_clean_data(connection, num_rows=10)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nanother_connection = make_database_connection()\nd2 = fetch_and_clean_data(another_connection, num_rows=10)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _database_connection parameter was different\n# in both calls.\n
\n

A cached function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nfetch_and_clean_data.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Decorator to cache functions that return data (e.g. dataframe transforms, database queries, ML inference).

\n

Cached objects are stored in "pickled" form, which means that the return\nvalue of a cached function must be pickleable. Each caller of the cached\nfunction gets its own copy of the cached data.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_data.clear().

\n

To cache global resources, use st.cache_resource instead. Learn more\nabout caching at https://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to cache. Streamlit hashes the function's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float or timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.\nNote that ttl is incompatible with persist="disk" - ttl will be\nignored if persist is specified.

\n", + "default": "None." + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached data is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "persist", + "type_name": "str or boolean or None", + "is_optional": false, + "description": "

Optional location to persist cached data to. Passing "disk" (or True)\nwill persist the cached data to the local disk. None (or False) will disable\npersistence. The default is None.

\n", + "default": "None." + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/runtime/caching/cache_data_api.py#L378" + }, + "streamlit.cache_resource": { + "name": "cache_resource", + "signature": "st.cache_resource(func, *, ttl, max_entries, show_spinner, validate, experimental_allow_widgets)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(url):\n    # Create a database session object that points to the URL.\n    return session\n\ns1 = get_database_session(SESSION_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(SESSION_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the connection object in s1 is the same as in s2.\n\ns3 = get_database_session(SESSION_URL_2)\n# This is a different URL, so the function executes.\n
\n

By default, all parameters to a cache_resource function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\ns1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _sessionmaker parameter was different\n# in both calls.\n
\n

A cache_resource function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\nget_database_session.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Decorator to cache functions that return global resources (e.g. database connections, ML models).

\n

Cached objects are shared across all users, sessions, and reruns. They\nmust be thread-safe because they can be accessed from multiple threads\nconcurrently. If thread safety is an issue, consider using st.session_state\nto store resources per session instead.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_resource.clear().

\n

To cache data, use st.cache_data instead. Learn more about caching at\nhttps://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function that creates the cached resource. Streamlit hashes the\nfunction's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float or timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.

\n", + "default": "None." + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached resource is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "validate", + "type_name": "callable or None", + "is_optional": false, + "description": "

An optional validation function for cached data. validate is called\neach time the cached value is accessed. It receives the cached value as\nits only parameter and it must return a boolean. If validate returns\nFalse, the current cached value is discarded, and the decorated function\nis called to compute a new value. This is useful e.g. to check the\nhealth of database connections.

\n", + "default": null + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/runtime/caching/cache_resource_api.py#L258" + }, + "streamlit.camera_input": { + "name": "camera_input", + "signature": "st.camera_input(label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", + "description": "

Display a widget that returns pictures from the user's webcam.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this widget is used for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the camera input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this camera_input's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile", + "is_generator": false, + "description": "

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/camera_input.py#L109" + }, + "streamlit.caption": { + "name": "caption", + "signature": "st.caption(body, unsafe_allow_html=False, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.caption('This is a string that explains something above.')\nst.caption('A caption with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the caption.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/markdown.py#L132" + }, + "streamlit.checkbox": { + "name": "checkbox", + "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n
\n", + "description": "

Display a checkbox widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this checkbox is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "value", + "type_name": "bool", + "is_optional": false, + "description": "

Preselect the checkbox when it first renders. This will be\ncast to bool internally.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the checkbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this checkbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

Whether or not the checkbox is checked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/checkbox.py#L52" + }, + "streamlit.code": { + "name": "code", + "signature": "st.code(body, language=\"python\", line_numbers=False)", + "example": "
\n
\nimport streamlit as st\n\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", + "description": "

Display a code block with optional syntax highlighting.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as code.

\n", + "default": null + }, + { + "name": "language", + "type_name": "str or None", + "is_optional": false, + "description": "

The language that the code is written in, for syntax highlighting.\nIf None, the code will be unstyled. Defaults to "python".

\n

For a list of available language values, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", + "default": "s" + }, + { + "name": "line_numbers", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean indicating whether to show line numbers to the\nleft of the code block. Defaults to False.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/code.py#L27" + }, + "streamlit.color_picker": { + "name": "color_picker", + "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n
\n", + "description": "

Display a color picker widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "str", + "is_optional": false, + "description": "

The hex value of this widget when it first renders. If None,\ndefaults to black.

\n", + "default": "black." + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the color picker.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this color_picker's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The selected color as a hex string.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/color_picker.py#L52" + }, + "streamlit.columns": { + "name": "columns", + "signature": "st.columns(spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/layouts.py#L77" + }, + "streamlit.container": { + "name": "container", + "signature": "st.container()", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/layouts.py#L29" + }, + "streamlit.dataframe": { + "name": "dataframe", + "signature": "st.dataframe(data=None, width=None, height=None, *, use_container_width=False)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n
\nst.dataframe(df, 200, 100)\n
\n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n
\n", + "description": "

Display a dataframe as an interactive table.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. (It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.)\nStyler support is experimental!\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the dataframe expressed in pixels. If None, the width\nwill be automatically calculated based on the column content.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the dataframe expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the dataframe width to the width of the parent container.\nThis takes precedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/dataframe_selector.py#L40" + }, + "streamlit.date_input": { + "name": "date_input", + "signature": "st.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nd = st.date_input(\n    "When\\'s your birthday",\n    datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n
\n", + "description": "

Display a date input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this date input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", + "is_optional": false, + "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", + "default": "today" + }, + { + "name": "min_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", + "default": "value" + }, + { + "name": "max_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", + "default": "value" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this date_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.date or a tuple with 0-2 dates", + "is_generator": false, + "description": "

The current value of the date input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/time_widgets.py#L399" + }, + "streamlit.divider": { + "name": "divider", + "signature": "st.divider()", + "example": "
\n
\nimport streamlit as st\n\nst.divider()\n
\n
\n", + "description": "

Display a horizontal rule.

\n
\n

Note

\n

You can achieve the same effect with st.write("---") or\neven just "---" in your script (via magic).

\n
\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/markdown.py#L244" + }, + "streamlit.download_button": { + "name": "download_button", + "signature": "st.download_button(label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False, use_container_width=False)", + "examples": "
\n

Download a large DataFrame as a CSV:

\n
\nimport streamlit as st\n\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\nimport streamlit as st\n\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nimport streamlit as st\n\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nimport streamlit as st\n\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n
\n", + "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "data", + "type_name": "str or bytes or file", + "is_optional": false, + "description": "

The contents of the file to be downloaded. See example below for\ncaching techniques to avoid recomputing this data unnecessarily.

\n", + "default": null + }, + { + "name": "file_name", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the name of the file to be downloaded,\nsuch as 'my_file.csv'. If not specified, the name will be\nautomatically generated.

\n", + "default": null + }, + { + "name": "mime", + "type_name": "str or None", + "is_optional": false, + "description": "

The MIME type of the data. If None, defaults to "text/plain"\n(if data is of type str or is a textual file) or\n"application/octet-stream" (if data is of type bytes or is a\nbinary file).

\n", + "default": "s" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/button.py#L169" + }, + "streamlit.echo": { + "name": "echo", + "signature": "st.echo(code_location=\"above\")", + "example": "
\n
\nimport streamlit as st\n\nwith st.echo():\n    st.write('This code will be printed')\n
\n
\n", + "description": "

Use in a with block to draw some code on the app, then execute it.

\n", + "args": [ + { + "name": "code_location", + "type_name": "\"above\" or \"below\"", + "is_optional": false, + "description": "

Whether to show the echoed code before or after the results of the\nexecuted code block.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/echo.py#L27" + }, + "streamlit.empty": { + "name": "empty", + "signature": "st.empty()", + "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport streamlit as st\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nimport streamlit as st\n\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", + "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/empty.py#L24" + }, + "streamlit.error": { + "name": "error", + "signature": "st.error(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", + "description": "

Display error message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The error text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/alert.py#L39" + }, + "streamlit.exception": { + "name": "exception", + "signature": "st.exception(exception)", + "example": "
\n
\nimport streamlit as st\n\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", + "description": "

Display an exception.

\n", + "args": [ + { + "name": "exception", + "type_name": "Exception", + "is_optional": false, + "description": "

The exception to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/exception.py#L50" + }, + "streamlit.expander": { + "name": "expander", + "signature": "st.expander(label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/layouts.py#L320" + }, + "streamlit.experimental_data_editor": { + "name": "experimental_data_editor", + "signature": "st.experimental_data_editor(data, *, width=None, height=None, use_container_width=False, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.experimental_data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.experimental_data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n
\n", + "description": "

Display a data editor widget.

\n

Display a data editor widget that allows you to edit DataFrames and\nmany other data structures in a table-like UI.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None", + "is_optional": false, + "description": "

The data to edit in the data editor.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the data editor expressed in pixels. If None, the width will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the data editor expressed in pixels. If None, the height will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the data editor width to the width of the parent container.\nThis takes precedence over the width argument. Defaults to False.

\n", + "default": "False." + }, + { + "name": "num_rows", + "type_name": "\"fixed\" or \"dynamic\"", + "is_optional": false, + "description": "

Specifies if the user can add and delete rows in the data editor.\nIf "fixed", the user cannot add or delete rows. If "dynamic", the user can\nadd and delete rows in the data editor, but column sorting is disabled.\nDefaults to "fixed".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean which, if True, disables the data editor and prevents\nany edits. Defaults to False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the unique key for this widget. If this\nis omitted, a key will be generated for the widget based on its\ncontent. Multiple widgets of the same type may not share the same\nkey.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this data_editor's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "pd.DataFrame, pd.Styler, pyarrow.Table, np.ndarray, list, set, tuple, or dict.", + "is_generator": false, + "description": "

The edited data. The edited data is returned in its original data type if\nit corresponds to any of the supported return types. All other data types\nare returned as a pd.DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/data_editor.py#L448" + }, + "streamlit.experimental_get_query_params": { + "name": "experimental_get_query_params", + "signature": "st.experimental_get_query_params()", + "example": "
\n

Let's say the user's web browser is at\nhttp://localhost:8501/?show_map=True&selected=asia&selected=america.\nThen, you can get the query parameters using the following:

\n
\nimport streamlit as st\n\nst.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\n

Note that the values in the returned dict are always lists. This is\nbecause we internally use Python's urllib.parse.parse_qs(), which behaves\nthis way. And this behavior makes sense when you consider that every item\nin a query string is potentially a 1-element array.

\n
\n", + "description": "

Return the query parameters that is currently showing in the browser's URL bar.

\n", + "args": [], + "returns": [ + { + "type_name": "dict", + "is_generator": false, + "description": "

The current query parameters as a dict. "Query parameters" are the part of the URL that comes\nafter the first "?".

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/commands/query_params.py#L29" + }, + "streamlit.experimental_memo": { + "name": "experimental_memo", + "signature": "st.experimental_memo(func=None, *, ttl, max_entries, show_spinner, persist, experimental_allow_widgets)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\nimport streamlit as st\n\n@st.cache_data(persist="disk")\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

By default, all parameters to a cached function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nconnection = make_database_connection()\nd1 = fetch_and_clean_data(connection, num_rows=10)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nanother_connection = make_database_connection()\nd2 = fetch_and_clean_data(another_connection, num_rows=10)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _database_connection parameter was different\n# in both calls.\n
\n

A cached function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nfetch_and_clean_data.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Decorator to cache functions that return data (e.g. dataframe transforms, database queries, ML inference).

\n

Cached objects are stored in "pickled" form, which means that the return\nvalue of a cached function must be pickleable. Each caller of the cached\nfunction gets its own copy of the cached data.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_data.clear().

\n

To cache global resources, use st.cache_resource instead. Learn more\nabout caching at https://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to cache. Streamlit hashes the function's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float or timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.\nNote that ttl is incompatible with persist="disk" - ttl will be\nignored if persist is specified.

\n", + "default": "None." + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached data is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "persist", + "type_name": "str or boolean or None", + "is_optional": false, + "description": "

Optional location to persist cached data to. Passing "disk" (or True)\nwill persist the cached data to the local disk. None (or False) will disable\npersistence. The default is None.

\n", + "default": "None." + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/runtime/caching/cache_data_api.py#L378" + }, + "streamlit.experimental_rerun": { + "name": "experimental_rerun", + "signature": "st.experimental_rerun()", + "description": "

Rerun the script immediately.

\n

When st.experimental_rerun() is called, the script is halted - no\nmore statements will be run, and the script will be queued to re-run\nfrom the top.

\n

If this function is called outside of Streamlit, it will raise an\nException.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/commands/execution_control.py#L46" + }, + "streamlit.experimental_set_query_params": { + "name": "experimental_set_query_params", + "signature": "st.experimental_set_query_params(**query_params)", + "example": "
\n

To point the user's web browser to something like\n"http://localhost:8501/?show_map=True&selected=asia&selected=america",\nyou would do the following:

\n
\nimport streamlit as st\n\nst.experimental_set_query_params(\n    show_map=True,\n    selected=["asia", "america"],\n)\n
\n
\n", + "description": "

Set the query parameters that are shown in the browser's URL bar.

\n
\n

Warning

\n

Query param embed cannot be set using this method.

\n
\n", + "args": [ + { + "name": "**query_params", + "type_name": "dict", + "is_optional": false, + "description": "

The query parameters to set, as key-value pairs.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/commands/query_params.py#L65" + }, + "streamlit.experimental_show": { + "name": "experimental_show", + "signature": "st.experimental_show(*args)", + "notes": "
\n

This is an experimental feature with usage limitations:

\n
    \n
  • The method must be called with the name show.
  • \n
  • Must be called in one line of code, and only once per line.
  • \n
  • \n
    When passing multiple arguments the inclusion of , or ) in a string
    \n
    argument may cause an error.
    \n
    \n
  • \n
\n
\n", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndataframe = pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n})\nst.experimental_show(dataframe)\n
\n
\n", + "description": "

Write arguments and argument names to your app for debugging purposes.

\n

Show() has similar properties to write():

\n
\n
    \n
  1. You can pass in multiple arguments, all of which will be debugged.
  2. \n
  3. It returns None, so it's "slot" in the app cannot be reused.
  4. \n
\n
\n

Note: This is an experimental feature. See\nhttps://docs.streamlit.io/library/advanced-features/prerelease#experimental for more information.

\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to debug in the App.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/show.py#L23" + }, + "streamlit.experimental_singleton": { + "name": "experimental_singleton", + "signature": "st.experimental_singleton(func, *, ttl, max_entries, show_spinner, validate, experimental_allow_widgets)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(url):\n    # Create a database session object that points to the URL.\n    return session\n\ns1 = get_database_session(SESSION_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(SESSION_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the connection object in s1 is the same as in s2.\n\ns3 = get_database_session(SESSION_URL_2)\n# This is a different URL, so the function executes.\n
\n

By default, all parameters to a cache_resource function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\ns1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _sessionmaker parameter was different\n# in both calls.\n
\n

A cache_resource function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\nget_database_session.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Decorator to cache functions that return global resources (e.g. database connections, ML models).

\n

Cached objects are shared across all users, sessions, and reruns. They\nmust be thread-safe because they can be accessed from multiple threads\nconcurrently. If thread safety is an issue, consider using st.session_state\nto store resources per session instead.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_resource.clear().

\n

To cache data, use st.cache_data instead. Learn more about caching at\nhttps://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function that creates the cached resource. Streamlit hashes the\nfunction's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float or timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.

\n", + "default": "None." + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached resource is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "validate", + "type_name": "callable or None", + "is_optional": false, + "description": "

An optional validation function for cached data. validate is called\neach time the cached value is accessed. It receives the cached value as\nits only parameter and it must return a boolean. If validate returns\nFalse, the current cached value is discarded, and the decorated function\nis called to compute a new value. This is useful e.g. to check the\nhealth of database connections.

\n", + "default": null + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/runtime/caching/cache_resource_api.py#L258" + }, + "streamlit.file_uploader": { + "name": "file_uploader", + "signature": "st.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nimport streamlit as st\nimport pandas as pd\nfrom io import StringIO\n\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nimport streamlit as st\n\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n
\n", + "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this file uploader is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str or list of str or None", + "is_optional": false, + "description": "

Array of allowed extensions. ['png', 'jpg']\nThe default is None, which means all extensions are allowed.

\n", + "default": "None" + }, + { + "name": "accept_multiple_files", + "type_name": "bool", + "is_optional": false, + "description": "

If True, allows the user to upload multiple files at the same time,\nin which case the return value will be a list of files.\nDefault: False

\n", + "default": "False" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the file uploader.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this file_uploader's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the file uploader if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile or list of UploadedFile", + "is_generator": false, + "description": "
    \n
  • If accept_multiple_files is False, returns either None or\nan UploadedFile object.
  • \n
  • If accept_multiple_files is True, returns a list with the\nuploaded files as UploadedFile objects. If no files were\nuploaded, returns an empty list.
  • \n
\n

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/file_uploader.py#L205" + }, + "streamlit.form": { + "name": "form", + "signature": "st.form(key, clear_on_submit=False)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n

Inserting elements out of order:

\n
\nimport streamlit as st\n\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n
\n", + "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

A string that identifies the form. Each form must have its own\nkey. (This key is not displayed to the user in the interface.)

\n", + "default": null + }, + { + "name": "clear_on_submit", + "type_name": "bool", + "is_optional": false, + "description": "

If True, all widgets inside the form will be reset to their default\nvalues after the user presses the Submit button. Defaults to False.\n(Note that Custom Components are unaffected by this flag, and\nwill not be reset to their defaults on form submission.)

\n", + "default": "values" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/form.py#L118" + }, + "streamlit.form_submit_button": { + "name": "form_submit_button", + "signature": "st.form_submit_button(label=\"Submit\", help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nDefaults to "Submit".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

A tooltip that gets displayed when the button is hovered over.\nDefaults to None.

\n", + "default": "None." + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/form.py#L211" + }, + "streamlit.get_option": { + "name": "get_option", + "signature": "st.get_option(key)", + "description": "

Return the current value of a given Streamlit config option.

\n

Run streamlit config show in the terminal to see all available options.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

The config option key of the form "section.optionName". To see all\navailable options, run streamlit config show on a terminal.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/config.py#L128" + }, + "streamlit.graphviz_chart": { + "name": "graphviz_chart", + "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nimport graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n
\n", + "description": "

Display a graph using the dagre-d3 library.

\n", + "args": [ + { + "name": "figure_or_dot", + "type_name": "graphviz.dot.Graph, graphviz.dot.Digraph, str", + "is_optional": false, + "description": "

The Graphlib graph object or dot string to display

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/graphviz_chart.py#L39" + }, + "streamlit.header": { + "name": "header", + "signature": "st.header(body, anchor=None, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.header('This is a header')\nst.header('A header with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in header formatting.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str or False", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the header.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/heading.py#L40" + }, + "streamlit.help": { + "name": "help", + "signature": "st.help(obj=)", + "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nimport streamlit as st\nimport pandas\n\nst.help(pandas.DataFrame)\n
\n\n \n

Want to quickly check what data type is output by a certain function?\nTry:

\n
\nimport streamlit as st\n\nx = my_poorly_documented_function()\nst.help(x)\n
\n

Want to quickly inspect an object? No sweat:

\n
\nclass Dog:\n  '''A typical dog.'''\n\n  def __init__(self, breed, color):\n    self.breed = breed\n    self.color = color\n\n  def bark(self):\n    return 'Woof!'\n\n\nfido = Dog('poodle', 'white')\n\nst.help(fido)\n
\n\n \n

And if you're using Magic, you can get help for functions, classes,\nand modules without even typing st.help:

\n
\nimport streamlit as st\nimport pandas\n\n# Get help for Pandas read_csv:\npandas.read_csv\n\n# Get help for Streamlit itself:\nst\n
\n\n \n
\n", + "description": "

Display help and other information for a given object.

\n

Depending on the type of object that is passed in, this displays the\nobject's name, type, value, signature, docstring, and member variables,\nmethods \u2014 as well as the values/docstring of members and methods.

\n", + "args": [ + { + "name": "obj", + "type_name": "any", + "is_optional": false, + "description": "

The object whose information should be displayed. If left\nunspecified, this call will display help for Streamlit itself.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/doc_string.py#L49" + }, + "streamlit.image": { + "name": "image", + "signature": "st.image(image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", + "example": "
\n
\nimport streamlit as st\nfrom PIL import Image\n\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n
\n", + "description": "

Display an image or list of images.

\n", + "args": [ + { + "name": "image", + "type_name": "numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]", + "is_optional": false, + "description": "

Monochrome image of shape (w,h) or (w,h,1)\nOR a color image of shape (w,h,3)\nOR an RGBA image of shape (w,h,4)\nOR a URL to fetch the image from\nOR a path of a local image file\nOR an SVG XML string like <svg xmlns=...</svg>\nOR a list of one of the above, to display multiple images.

\n", + "default": null + }, + { + "name": "caption", + "type_name": "str or list of str", + "is_optional": false, + "description": "

Image caption. If displaying multiple images, caption should be a\nlist of captions (one for each image).

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Image width. None means use the image width,\nbut do not exceed the width of the column.\nShould be set for SVG images, as they have no default image width.

\n", + "default": "image" + }, + { + "name": "use_column_width", + "type_name": "'auto' or 'always' or 'never' or bool", + "is_optional": false, + "description": "

If 'auto', set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf 'always' or True, set the image's width to the column width.\nIf 'never' or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", + "default": null + }, + { + "name": "clamp", + "type_name": "bool", + "is_optional": false, + "description": "

Clamp image pixel values to a valid range ([0-255] per channel).\nThis is only meaningful for byte array images; the parameter is\nignored for image URLs. If this is not set, and an image has an\nout-of-range value, an error will be thrown.

\n", + "default": null + }, + { + "name": "channels", + "type_name": "'RGB' or 'BGR'", + "is_optional": false, + "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to 'RGB', meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to 'BGR', instead.

\n", + "default": "s" + }, + { + "name": "output_format", + "type_name": "'JPEG', 'PNG', or 'auto'", + "is_optional": false, + "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to 'auto' which identifies the compression type based\non the type and format of the image argument.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/image.py#L88" + }, + "streamlit.info": { + "name": "info", + "signature": "st.info(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", + "description": "

Display an informational message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The info text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/alert.py#L103" + }, + "streamlit.json": { + "name": "json", + "signature": "st.json(body, *, expanded=True)", + "example": "
\n
\nimport streamlit as st\n\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n
\n", + "description": "

Display object or string as a pretty-printed JSON string.

\n", + "args": [ + { + "name": "body", + "type_name": "object or str", + "is_optional": false, + "description": "

The object to print as JSON. All referenced objects should be\nserializable to JSON as well. If object is a string, we assume it\ncontains serialized JSON.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean that allows the user to set whether the initial\nstate of this json element should be expanded. Defaults to True.\nThis argument can only be supplied by keyword.

\n", + "default": "True." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/json.py#L35" + }, + "streamlit.latex": { + "name": "latex", + "signature": "st.latex(body, *, help=None)", + "example": "
\n
\nimport streamlit as st\n\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", + "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", + "args": [ + { + "name": "body", + "type_name": "str or SymPy expression", + "is_optional": false, + "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the LaTeX expression.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/markdown.py#L196" + }, + "streamlit.line_chart": { + "name": "line_chart", + "signature": "st.line_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\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 \n
\n", + "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict or None", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/dataframe_selector.py#L160" + }, + "streamlit.map": { + "name": "map", + "signature": "st.map(data=None, zoom=None, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n
\n", + "description": "

Display a map with points on it.

\n

This is a wrapper around st.pydeck_chart to quickly create\nscatterplot charts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to be plotted. Must have two columns:

\n
    \n
  • latitude called 'lat', 'latitude', 'LAT', 'LATITUDE'
  • \n
  • longitude called 'lon', 'longitude', 'LON', 'LONGITUDE'.
  • \n
\n", + "default": null + }, + { + "name": "zoom", + "type_name": "int", + "is_optional": false, + "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/map.py#L76" + }, + "streamlit.markdown": { + "name": "markdown", + "signature": "st.markdown(body, unsafe_allow_html=False, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.markdown('Streamlit is **_really_ cool**.')\nst.markdown(\u201dThis text is :red[colored red], and this is **:blue[colored]** and bold.\u201d)\nst.markdown(":green[$\\sqrt{x^2+y^2}=1$] is a Pythagorean identity. :pencil:")\n
\n
\n", + "description": "

Display string formatted as Markdown.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the Markdown.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/markdown.py#L31" + }, + "streamlit.metric": { + "name": "metric", + "signature": "st.metric(label, value, delta=None, delta_color=\"normal\", help=None, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n

st.metric looks especially nice in combination with st.columns:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n

The delta indicator color can also be inverted or turned off:

\n
\nimport streamlit as st\n\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n
\n", + "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

The header or title for the metric. The label can optionally contain\nMarkdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Value of the metric. None is rendered as a long dash.

\n", + "default": null + }, + { + "name": "delta", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Indicator of how the metric changed, rendered with an arrow below\nthe metric. If delta is negative (int/float) or starts with a minus\nsign (str), the arrow points down and the text is red; else the\narrow points up and the text is green. If None (default), no delta\nindicator is shown.

\n", + "default": null + }, + { + "name": "delta_color", + "type_name": "str", + "is_optional": false, + "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the metric label.

\n", + "default": null + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/metric.py#L46" + }, + "streamlit.multiselect": { + "name": "multiselect", + "signature": "st.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", max_selections=None)", + "example": "
\n
\nimport streamlit as st\n\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n
\n", + "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence[V], numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "default", + "type_name": "[V], V, or None", + "is_optional": false, + "description": "

List of default values. Can also be a single value.

\n", + "default": "values." + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of selectbox options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe multiselect.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the multiselect.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this multiselect's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the multiselect widget if set\nto True. The default is False. This argument can only be supplied\nby keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "max_selections", + "type_name": "int", + "is_optional": false, + "description": "

The max selections that can be selected at a time.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list", + "is_generator": false, + "description": "

A list with the selected options

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/multiselect.py#L145" + }, + "streamlit.number_input": { + "name": "number_input", + "signature": "st.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n
\n", + "description": "

Display a numeric input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. Output must be purely numeric. This does not impact\nthe return value. Valid formatters: %d %e %f %g %i %u

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this number_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the number input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int or float", + "is_generator": false, + "description": "

The current value of the numeric input widget. The return type\nwill match the data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/number_input.py#L66" + }, + "streamlit.plotly_chart": { + "name": "plotly_chart", + "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", theme=\"streamlit\", **kwargs)", + "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport numpy as np\nimport plotly.figure_factory as ff\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n        hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n
\n", + "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", + "args": [ + { + "name": "figure_or_data", + "type_name": "plotly.graph_objs.Figure, plotly.graph_objs.Data,", + "is_optional": false, + "description": "

dict/list of plotly.graph_objs.Figure/Data

\n

See https://plot.ly/python/ for examples of graph descriptions.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + }, + { + "name": "sharing", + "type_name": "{'streamlit', 'private', 'secret', 'public'}", + "is_optional": false, + "description": "

Use 'streamlit' to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": null, + "is_optional": null, + "description": "

Any argument accepted by Plotly's plot() function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/plotly_chart.py#L81" + }, + "streamlit.progress": { + "name": "progress", + "signature": "st.progress(value, text=None)", + "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport streamlit as st\nimport time\n\nprogress_text = "Operation in progress. Please wait."\nmy_bar = st.progress(0, text=progress_text)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1, text=progress_text)\n
\n
\n", + "description": "

Display a progress bar.

\n", + "args": [ + { + "name": "value", + "type_name": "int or float", + "is_optional": false, + "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", + "default": null + }, + { + "name": "text", + "type_name": "str or None", + "is_optional": false, + "description": "

A message to display above the progress bar. The text can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/progress.py#L66" + }, + "streamlit.pydeck_chart": { + "name": "pydeck_chart", + "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)", + "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport pydeck as pdk\n\nchart_data = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=chart_data,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=chart_data,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", + "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "args": [ + { + "name": "pydeck_obj", + "type_name": "pydeck.Deck or None", + "is_optional": false, + "description": "

Object specifying the PyDeck chart to draw.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/deck_gl_json_chart.py#L36" + }, + "streamlit.pyplot": { + "name": "pyplot", + "signature": "st.pyplot(fig=None, clear_figure=None, use_container_width=True, **kwargs)", + "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", + "example": "
\n
\nimport streamlit as st\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n
\n", + "description": "

Display a matplotlib.pyplot figure.

\n", + "args": [ + { + "name": "fig", + "type_name": "Matplotlib Figure", + "is_optional": false, + "description": "

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

\n", + "default": null + }, + { + "name": "clear_figure", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", + "default": "based" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n", + "default": "s" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Arguments to pass to Matplotlib's savefig function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/pyplot.py#L38" + }, + "streamlit.radio": { + "name": "radio", + "signature": "st.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ngenre = st.radio(\n    "What\\'s your favorite movie genre",\n    ('Comedy', 'Drama', 'Documentary'))\n\nif genre == 'Comedy':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn\\'t select comedy.")\n
\n\n \n
\n", + "description": "

Display a radio button widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this radio group is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the radio options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of radio options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe radio.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the radio.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this radio's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the radio button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "horizontal", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", + "default": "false" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/radio.py#L75" + }, + "streamlit.select_slider": { + "name": "select_slider", + "signature": "st.select_slider(label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\nimport streamlit as st\n\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nimport streamlit as st\n\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n ", + "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the slider options. All options will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", + "default": "." + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to first option.

\n", + "default": "first" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels from the options.\nargument. It receives the option as an argument and its output\nwill be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the select slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this select_slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the select slider if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any value or tuple of any value", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/select_slider.py#L106" + }, + "streamlit.selectbox": { + "name": "selectbox", + "signature": "st.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n
\n", + "description": "

Display a select widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels. It receives the option\nas an argument and its output will be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the selectbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this selectbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the selectbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/selectbox.py#L71" + }, + "streamlit.set_option": { + "name": "set_option", + "signature": "st.set_option(key, value)", + "description": "

Set config option.

\n
\n
Currently, only the following config options can be set within the script itself:
\n
    \n
  • client.caching
  • \n
  • client.displayEnabled
  • \n
  • deprecation.*
  • \n
\n
\n
\n

Calling with any other options will raise StreamlitAPIException.

\n

Run streamlit config show in the terminal to see all available options.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

The config option key of the form "section.optionName". To see all\navailable options, run streamlit config show on a terminal.

\n", + "default": null + }, + { + "name": "value", + "type_name": null, + "is_optional": null, + "description": "

The new value to assign to this config option.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/config.py#L89" + }, + "streamlit.set_page_config": { + "name": "set_page_config", + "signature": "st.set_page_config(page_title=None, page_icon=None, layout=\"centered\", initial_sidebar_state=\"auto\", menu_items=None)", + "example": "
\nimport streamlit as st\n\nst.set_page_config(\n    page_title="Ex-stream-ly Cool App",\n    page_icon="\ud83e\uddca",\n    layout="wide",\n    initial_sidebar_state="expanded",\n    menu_items={\n        'Get Help': 'https://www.extremelycoolapp.com/help',\n        'Report a bug': "https://www.extremelycoolapp.com/bug",\n        'About': "# This is a header. This is an *extremely* cool app!"\n    }\n)\n
\n", + "description": "

Configures the default settings of the page.

\n
\n

Note

\n

This must be the first Streamlit command used in your app, and must only\nbe set once.

\n
\n", + "args": [ + { + "name": "page_title", + "type_name": "str or None", + "is_optional": false, + "description": "

The page title, shown in the browser tab. If None, defaults to the\nfilename of the script ("app.py" would show "app \u2022 Streamlit").

\n", + "default": "the" + }, + { + "name": "page_icon", + "type_name": "Anything supported by st.image or str or None", + "is_optional": false, + "description": "

The page favicon.\nBesides the types supported by st.image (like URLs or numpy arrays),\nyou can pass in an emoji as a string ("\ud83e\udd88") or a shortcode (":shark:").\nIf you're feeling lucky, try "random" for a random emoji!\nEmoji icons are courtesy of Twemoji and loaded from MaxCDN.

\n", + "default": null + }, + { + "name": "layout", + "type_name": "\"centered\" or \"wide\"", + "is_optional": false, + "description": "

How the page content should be laid out. Defaults to "centered",\nwhich constrains the elements into a centered column of fixed width;\n"wide" uses the entire screen.

\n", + "default": "s" + }, + { + "name": "initial_sidebar_state", + "type_name": "\"auto\" or \"expanded\" or \"collapsed\"", + "is_optional": false, + "description": "

How the sidebar should start out. Defaults to "auto",\nwhich hides the sidebar on mobile-sized devices, and shows it otherwise.\n"expanded" shows the sidebar initially; "collapsed" hides it.

\n", + "default": "s" + }, + { + "name": "menu_items", + "type_name": "dict", + "is_optional": false, + "description": "

Configure the menu that appears on the top-right side of this app.\nThe keys in this dict denote the menu item you'd like to configure:

\n
    \n
  • \n
    "Get help": str or None
    \n
    The URL this menu item should point to.\nIf None, hides this menu item.
    \n
    \n
  • \n
  • \n
    "Report a Bug": str or None
    \n
    The URL this menu item should point to.\nIf None, hides this menu item.
    \n
    \n
  • \n
  • \n
    "About": str or None
    \n
    A markdown string to show in the About dialog.\nIf None, only shows Streamlit's default About text.
    \n
    \n
  • \n
\n

The URL may also refer to an email address e.g. mailto:john@example.com.

\n", + "default": "About" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/commands/page_config.py#L114" + }, + "streamlit.slider": { + "name": "slider", + "signature": "st.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nimport streamlit as st\n\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nimport streamlit as st\nfrom datetime import time\n\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nimport streamlit as st\nfrom datetime import datetime\n\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n
\n", + "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The minimum permitted value.\nDefaults to 0 if the value is an int, 0.0 if a float,\nvalue - timedelta(days=14) if a date/datetime, time.min if a time

\n", + "default": "0" + }, + { + "name": "max_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The maximum permitted value.\nDefaults to 100 if the value is an int, 1.0 if a float,\nvalue + timedelta(days=14) if a date/datetime, time.max if a time

\n", + "default": "100" + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to min_value.

\n", + "default": "min_value." + }, + { + "name": "step", + "type_name": "int/float/timedelta or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. This does not impact the return value.\nFormatter for int/float supports: %d %e %f %g %i\nFormatter for date/time/datetime uses Moment.js notation:\nhttps://momentjs.com/docs/#/displaying/format/

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the slider if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int/float/date/time/datetime or tuple of int/float/date/time/datetime", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/slider.py#L171" + }, + "streamlit.snow": { + "name": "snow", + "signature": "st.snow()", + "example": "
\n
\nimport streamlit as st\n\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", + "description": "

Draw celebratory snowfall.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/snow.py#L25" + }, + "streamlit.spinner": { + "name": "spinner", + "signature": "st.spinner(text=\"In progress...\")", + "example": "
\n
\nimport time\nimport streamlit as st\n\nwith st.spinner('Wait for it...'):\n    time.sleep(5)\nst.success('Done!')\n
\n
\n", + "description": "

Temporarily displays a message while executing a block of code.

\n", + "args": [ + { + "name": "text", + "type_name": "str", + "is_optional": false, + "description": "

A message to display while executing that block

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/spinner.py#L23" + }, + "streamlit.stop": { + "name": "stop", + "signature": "st.stop()", + "example": "
\n
\nimport streamlit as st\n\nname = st.text_input('Name')\nif not name:\n  st.warning('Please input a name.')\n  st.stop()\nst.success('Thank you for inputting a name.')\n
\n
\n", + "description": "

Stops execution immediately.

\n

Streamlit will not run any statements after st.stop().\nWe recommend rendering a message to explain why the script has stopped.\nWhen run outside of Streamlit, this will raise an Exception.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/commands/execution_control.py#L25" + }, + "streamlit.subheader": { + "name": "subheader", + "signature": "st.subheader(body, anchor=None, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.subheader('This is a subheader')\nst.subheader('A subheader with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in subheader formatting.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str or False", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the subheader.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/heading.py#L93" + }, + "streamlit.success": { + "name": "success", + "signature": "st.success(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", + "description": "

Display a success message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The success text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/alert.py#L136" + }, + "streamlit.table": { + "name": "table", + "signature": "st.table(data=None)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n
\n", + "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/dataframe_selector.py#L122" + }, + "streamlit.tabs": { + "name": "tabs", + "signature": "st.tabs(tabs)", + "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\nimport streamlit as st\n\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n
\n", + "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", + "args": [ + { + "name": "tabs", + "type_name": "list of strings", + "is_optional": false, + "description": "

Creates a tab for each string in the list. The first tab is selected by default.\nThe string is used as the name of the tab and can optionally contain Markdown,\nsupporting the following elements: Bold, Italics, Strikethroughs, Inline Code,\nEmojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": "." + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/layouts.py#L208" + }, + "streamlit.text": { + "name": "text", + "signature": "st.text(body, *, help=None)", + "example": "
\n
\nimport streamlit as st\n\nst.text('This is some text.')\n
\n
\n", + "description": "

Write fixed-width and preformatted text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the text.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/text.py#L27" + }, + "streamlit.text_area": { + "name": "text_area", + "signature": "st.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", + "description": "

Display a multi-line text input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Maximum number of characters allowed in text area.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the textarea.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_area's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text area is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text area if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/text_widgets.py#L274" + }, + "streamlit.text_input": { + "name": "text_input", + "signature": "st.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n
\n", + "description": "

Display a single-line text input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Max number of characters allowed in text input.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"default\" or \"password\"", + "is_optional": false, + "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "autocomplete", + "type_name": "str", + "is_optional": false, + "description": "

An optional value that will be passed to the <input> element's\nautocomplete property. If unspecified, this value will be set to\n"new-password" for "password" inputs, and the empty string for\n"default" inputs. For more details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text input is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/text_widgets.py#L71" + }, + "streamlit.time_input": { + "name": "time_input", + "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", step=0:15:00)", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n
\n", + "description": "

Display a time input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this time input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.time/datetime.datetime", + "is_optional": false, + "description": "

The value of this widget when it first renders. This will be\ncast to str internally. Defaults to the current time.

\n", + "default": "the" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this time_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the time input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "step", + "type_name": "int or timedelta", + "is_optional": false, + "description": "

The stepping interval in seconds. Defaults to 900, i.e. 15 minutes.\nYou can also pass a datetime.timedelta object.

\n", + "default": "900" + } + ], + "returns": [ + { + "type_name": "datetime.time", + "is_generator": false, + "description": "

The current value of the time input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/time_widgets.py#L214" + }, + "streamlit.title": { + "name": "title", + "signature": "st.title(body, anchor=None, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.title('This is a title')\nst.title('A title with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str or False", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the title.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/heading.py#L146" + }, + "streamlit.vega_lite_chart": { + "name": "vega_lite_chart", + "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, theme=\"streamlit\", **kwargs)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(chart_data, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", + "description": "

Display a chart using the Vega-Lite library.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "spec", + "type_name": "dict or None", + "is_optional": false, + "description": "

The Vega-Lite spec for the chart. If the spec was already passed in\nthe previous argument, this must be set to None. See\nhttps://vega.github.io/vega-lite/docs/ for more info.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Same as spec, but as keywords.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/dataframe_selector.py#L475" + }, + "streamlit.video": { + "name": "video", + "signature": "st.video(data, format=\"video/mp4\", start_time=0)", + "example": "
\n
\nimport streamlit as st\n\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", + "description": "

Display a video player.

\n", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "default": null + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the video file. Defaults to 'video/mp4'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/media.py#L117" + }, + "streamlit.warning": { + "name": "warning", + "signature": "st.warning(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", + "description": "

Display warning message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The warning text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/alert.py#L71" + }, + "streamlit.write": { + "name": "write", + "signature": "st.write(*args, unsafe_allow_html=False, **kwargs)", + "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nimport streamlit as st\n\nst.write('Hello, *World!* :sunglasses:')\n
\n\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nimport streamlit as st\nimport pandas as pd\n\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nimport streamlit as st\n\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n
\n", + "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression, emoji shortcodes, and colored text.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(class) : Displays information about a class.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/write.py#L48" + }, + "streamlit.experimental_memo.clear": { + "name": "experimental_memo.clear", + "signature": "st.experimental_memo.clear()", + "description": "

Clear all in-memory and on-disk data caches.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/runtime/caching/cache_data_api.py#L541" + }, + "streamlit.cache_data.clear": { + "name": "cache_data.clear", + "signature": "st.cache_data.clear()", + "description": "

Clear all in-memory and on-disk data caches.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/runtime/caching/cache_data_api.py#L541" + }, + "streamlit.experimental_singleton.clear": { + "name": "experimental_singleton.clear", + "signature": "st.experimental_singleton.clear()", + "description": "

Clear all cache_resource caches.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/runtime/caching/cache_resource_api.py#L396" + }, + "streamlit.cache_resource.clear": { + "name": "cache_resource.clear", + "signature": "st.cache_resource.clear()", + "description": "

Clear all cache_resource caches.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/runtime/caching/cache_resource_api.py#L396" + }, + "streamlit.components.v1.declare_component": { + "name": "declare_component", + "signature": "st.components.v1.declare_component(name, path=None, url=None)", + "description": "

Create and register a custom component.

\n", + "args": [ + { + "name": "name", + "type_name": "str", + "is_optional": false, + "description": "

A short, descriptive name for the component. Like, "slider".

\n", + "default": null + }, + { + "name": "path", + "type_name": "str or None", + "is_optional": false, + "description": "

The path to serve the component's frontend files from. Either\npath or url must be specified, but not both.

\n", + "default": null + }, + { + "name": "url", + "type_name": "str or None", + "is_optional": false, + "description": "

The URL that the component is served from. Either path or url\nmust be specified, but not both.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "CustomComponent", + "is_generator": false, + "description": "

A CustomComponent that can be called like a function.\nCalling the component will create a new instance of the component\nin the Streamlit app.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/components/v1/components.py#L246" + }, + "streamlit.components.v1.html": { + "name": "html", + "signature": "st.components.v1.html(html, width=None, height=None, scrolling=False)", + "description": "

Display an HTML string in an iframe.

\n", + "args": [ + { + "name": "html", + "type_name": "str", + "is_optional": false, + "description": "

The HTML string to embed in the iframe.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", + "default": "the" + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", + "default": "150." + }, + { + "name": "scrolling", + "type_name": "bool", + "is_optional": false, + "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/iframe.py#L59" + }, + "streamlit.components.v1.iframe": { + "name": "iframe", + "signature": "st.components.v1.iframe(src, width=None, height=None, scrolling=False)", + "description": "

Load a remote URL in an iframe.

\n", + "args": [ + { + "name": "src", + "type_name": "str", + "is_optional": false, + "description": "

The URL of the page to embed.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", + "default": "the" + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", + "default": "150." + }, + { + "name": "scrolling", + "type_name": "bool", + "is_optional": false, + "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/iframe.py#L25" + }, + "DeltaGenerator.add_rows": { + "name": "add_rows", + "signature": "element.add_rows(data=None, **kwargs)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf1 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table = st.table(df1)\n\ndf2 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table.add_rows(df2)\n# Now the table shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

You can do the same thing with plots. For example, if you want to add\nmore data to a line chart:

\n
\n# Assuming df1 and df2 from the example above still exist...\nmy_chart = st.line_chart(df1)\nmy_chart.add_rows(df2)\n# Now the chart shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

And for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:

\n
\nmy_chart = st.vega_lite_chart({\n    'mark': 'line',\n    'encoding': {'x': 'a', 'y': 'b'},\n    'datasets': {\n      'some_fancy_name': df1,  # <-- named dataset\n     },\n    'data': {'name': 'some_fancy_name'},\n}),\nmy_chart.add_rows(some_fancy_name=df2)  # <-- name used as keyword\n
\n
\n", + "description": "

Concatenate a dataframe to the bottom of the current one.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, Iterable, dict, or None", + "is_optional": false, + "description": "

Table to concat. Optional.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "**kwargs", + "type_name": "pandas.DataFrame, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

The named dataset to concat. Optional. You can only pass in 1\ndataset (including the one in the data parameter).

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/dataframe_selector.py#L550" + }, + "DeltaGenerator.altair_chart": { + "name": "altair_chart", + "signature": "element.altair_chart(altair_chart, use_container_width=False, theme=\"streamlit\")", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(chart_data).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n
\n", + "description": "

Display a chart using the Altair library.

\n", + "args": [ + { + "name": "altair_chart", + "type_name": "altair.vegalite.v2.api.Chart", + "is_optional": false, + "description": "

The Altair chart object to display.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/dataframe_selector.py#L422" + }, + "DeltaGenerator.area_chart": { + "name": "area_chart", + "signature": "element.area_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n
\n", + "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/dataframe_selector.py#L247" + }, + "DeltaGenerator.audio": { + "name": "audio", + "signature": "element.audio(data, format=\"audio/wav\", start_time=0, *, sample_rate=None)", + "example": "
\n
\nimport streamlit as st\nimport numpy as np\n\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n\nsample_rate = 44100  # 44100 samples per second\nseconds = 2  # Note duration of 2 seconds\nfrequency_la = 440  # Our played note will be 440 Hz\n# Generate array with seconds*sample_rate steps, ranging between 0 and seconds\nt = np.linspace(0, seconds, seconds * sample_rate, False)\n# Generate a 440 Hz sine wave\nnote_la = np.sin(frequency_la * t * 2 * np.pi)\n\nst.audio(note_la, sample_rate=sample_rate)\n
\n\n \n
\n", + "description": "

Display an audio player.

\n", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw audio data, filename, or a URL pointing to the file to load.\nRaw data formats must include all necessary file headers to match the file\nformat specified via format.\nIf data is a numpy array, it must either be a 1D array of the waveform\nor a 2D array of shape (num_channels, num_samples) with waveforms\nfor all channels. See the default channel order at\nhttp://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx

\n", + "default": "channel" + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + }, + { + "name": "sample_rate", + "type_name": "int or None", + "is_optional": false, + "description": "

The sample rate of the audio data in samples per second. Only required if\ndata is a numpy array.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/media.py#L43" + }, + "DeltaGenerator.balloons": { + "name": "balloons", + "signature": "element.balloons()", + "example": "
\n
\nimport streamlit as st\n\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", + "description": "

Draw celebratory balloons.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/balloons.py#L25" + }, + "DeltaGenerator.bar_chart": { + "name": "bar_chart", + "signature": "element.bar_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n
\n", + "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/dataframe_selector.py#L334" + }, + "DeltaGenerator.beta_columns": { + "name": "beta_columns", + "signature": "element.beta_columns(spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/layouts.py#L77" + }, + "DeltaGenerator.beta_container": { + "name": "beta_container", + "signature": "element.beta_container()", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/layouts.py#L29" + }, + "DeltaGenerator.beta_expander": { + "name": "beta_expander", + "signature": "element.beta_expander(label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/layouts.py#L320" + }, + "DeltaGenerator.bokeh_chart": { + "name": "bokeh_chart", + "signature": "element.bokeh_chart(figure, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n
\n", + "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", + "args": [ + { + "name": "figure", + "type_name": "bokeh.plotting.figure.Figure", + "is_optional": false, + "description": "

A Bokeh figure to plot.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Bokeh's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/bokeh_chart.py#L36" + }, + "DeltaGenerator.button": { + "name": "button", + "signature": "element.button(label, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\n\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n
\n", + "description": "

Display a button widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/button.py#L61" + }, + "DeltaGenerator.camera_input": { + "name": "camera_input", + "signature": "element.camera_input(label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", + "description": "

Display a widget that returns pictures from the user's webcam.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this widget is used for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the camera input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this camera_input's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile", + "is_generator": false, + "description": "

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/camera_input.py#L109" + }, + "DeltaGenerator.caption": { + "name": "caption", + "signature": "element.caption(body, unsafe_allow_html=False, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.caption('This is a string that explains something above.')\nst.caption('A caption with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the caption.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/markdown.py#L132" + }, + "DeltaGenerator.checkbox": { + "name": "checkbox", + "signature": "element.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n
\n", + "description": "

Display a checkbox widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this checkbox is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "value", + "type_name": "bool", + "is_optional": false, + "description": "

Preselect the checkbox when it first renders. This will be\ncast to bool internally.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the checkbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this checkbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

Whether or not the checkbox is checked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/checkbox.py#L52" + }, + "DeltaGenerator.code": { + "name": "code", + "signature": "element.code(body, language=\"python\", line_numbers=False)", + "example": "
\n
\nimport streamlit as st\n\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", + "description": "

Display a code block with optional syntax highlighting.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as code.

\n", + "default": null + }, + { + "name": "language", + "type_name": "str or None", + "is_optional": false, + "description": "

The language that the code is written in, for syntax highlighting.\nIf None, the code will be unstyled. Defaults to "python".

\n

For a list of available language values, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", + "default": "s" + }, + { + "name": "line_numbers", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean indicating whether to show line numbers to the\nleft of the code block. Defaults to False.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/code.py#L27" + }, + "DeltaGenerator.color_picker": { + "name": "color_picker", + "signature": "element.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n
\n", + "description": "

Display a color picker widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "str", + "is_optional": false, + "description": "

The hex value of this widget when it first renders. If None,\ndefaults to black.

\n", + "default": "black." + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the color picker.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this color_picker's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The selected color as a hex string.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/color_picker.py#L52" + }, + "DeltaGenerator.columns": { + "name": "columns", + "signature": "element.columns(spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/layouts.py#L77" + }, + "DeltaGenerator.container": { + "name": "container", + "signature": "element.container()", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/layouts.py#L29" + }, + "DeltaGenerator.dataframe": { + "name": "dataframe", + "signature": "element.dataframe(data=None, width=None, height=None, *, use_container_width=False)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n
\nst.dataframe(df, 200, 100)\n
\n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n
\n", + "description": "

Display a dataframe as an interactive table.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. (It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.)\nStyler support is experimental!\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the dataframe expressed in pixels. If None, the width\nwill be automatically calculated based on the column content.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the dataframe expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the dataframe width to the width of the parent container.\nThis takes precedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/dataframe_selector.py#L40" + }, + "DeltaGenerator.date_input": { + "name": "date_input", + "signature": "element.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nd = st.date_input(\n    "When\\'s your birthday",\n    datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n
\n", + "description": "

Display a date input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this date input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", + "is_optional": false, + "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", + "default": "today" + }, + { + "name": "min_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", + "default": "value" + }, + { + "name": "max_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", + "default": "value" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this date_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.date or a tuple with 0-2 dates", + "is_generator": false, + "description": "

The current value of the date input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/time_widgets.py#L399" + }, + "DeltaGenerator.dg": { + "name": "dg", + "signature": "element.dg", + "description": "

Get our DeltaGenerator.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/alert.py#L168" + }, + "DeltaGenerator.divider": { + "name": "divider", + "signature": "element.divider()", + "example": "
\n
\nimport streamlit as st\n\nst.divider()\n
\n
\n", + "description": "

Display a horizontal rule.

\n
\n

Note

\n

You can achieve the same effect with st.write("---") or\neven just "---" in your script (via magic).

\n
\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/markdown.py#L244" + }, + "DeltaGenerator.download_button": { + "name": "download_button", + "signature": "element.download_button(label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False, use_container_width=False)", + "examples": "
\n

Download a large DataFrame as a CSV:

\n
\nimport streamlit as st\n\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\nimport streamlit as st\n\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nimport streamlit as st\n\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nimport streamlit as st\n\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n
\n", + "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "data", + "type_name": "str or bytes or file", + "is_optional": false, + "description": "

The contents of the file to be downloaded. See example below for\ncaching techniques to avoid recomputing this data unnecessarily.

\n", + "default": null + }, + { + "name": "file_name", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the name of the file to be downloaded,\nsuch as 'my_file.csv'. If not specified, the name will be\nautomatically generated.

\n", + "default": null + }, + { + "name": "mime", + "type_name": "str or None", + "is_optional": false, + "description": "

The MIME type of the data. If None, defaults to "text/plain"\n(if data is of type str or is a textual file) or\n"application/octet-stream" (if data is of type bytes or is a\nbinary file).

\n", + "default": "s" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/button.py#L169" + }, + "DeltaGenerator.empty": { + "name": "empty", + "signature": "element.empty()", + "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport streamlit as st\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nimport streamlit as st\n\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", + "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/empty.py#L24" + }, + "DeltaGenerator.error": { + "name": "error", + "signature": "element.error(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", + "description": "

Display error message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The error text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/alert.py#L39" + }, + "DeltaGenerator.exception": { + "name": "exception", + "signature": "element.exception(exception)", + "example": "
\n
\nimport streamlit as st\n\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", + "description": "

Display an exception.

\n", + "args": [ + { + "name": "exception", + "type_name": "Exception", + "is_optional": false, + "description": "

The exception to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/exception.py#L50" + }, + "DeltaGenerator.expander": { + "name": "expander", + "signature": "element.expander(label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/layouts.py#L320" + }, + "DeltaGenerator.experimental_data_editor": { + "name": "experimental_data_editor", + "signature": "element.experimental_data_editor(data, *, width=None, height=None, use_container_width=False, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.experimental_data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.experimental_data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n
\n", + "description": "

Display a data editor widget.

\n

Display a data editor widget that allows you to edit DataFrames and\nmany other data structures in a table-like UI.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None", + "is_optional": false, + "description": "

The data to edit in the data editor.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the data editor expressed in pixels. If None, the width will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the data editor expressed in pixels. If None, the height will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the data editor width to the width of the parent container.\nThis takes precedence over the width argument. Defaults to False.

\n", + "default": "False." + }, + { + "name": "num_rows", + "type_name": "\"fixed\" or \"dynamic\"", + "is_optional": false, + "description": "

Specifies if the user can add and delete rows in the data editor.\nIf "fixed", the user cannot add or delete rows. If "dynamic", the user can\nadd and delete rows in the data editor, but column sorting is disabled.\nDefaults to "fixed".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean which, if True, disables the data editor and prevents\nany edits. Defaults to False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the unique key for this widget. If this\nis omitted, a key will be generated for the widget based on its\ncontent. Multiple widgets of the same type may not share the same\nkey.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this data_editor's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "pd.DataFrame, pd.Styler, pyarrow.Table, np.ndarray, list, set, tuple, or dict.", + "is_generator": false, + "description": "

The edited data. The edited data is returned in its original data type if\nit corresponds to any of the supported return types. All other data types\nare returned as a pd.DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/data_editor.py#L448" + }, + "DeltaGenerator.file_uploader": { + "name": "file_uploader", + "signature": "element.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nimport streamlit as st\nimport pandas as pd\nfrom io import StringIO\n\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nimport streamlit as st\n\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n
\n", + "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this file uploader is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str or list of str or None", + "is_optional": false, + "description": "

Array of allowed extensions. ['png', 'jpg']\nThe default is None, which means all extensions are allowed.

\n", + "default": "None" + }, + { + "name": "accept_multiple_files", + "type_name": "bool", + "is_optional": false, + "description": "

If True, allows the user to upload multiple files at the same time,\nin which case the return value will be a list of files.\nDefault: False

\n", + "default": "False" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the file uploader.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this file_uploader's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the file uploader if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile or list of UploadedFile", + "is_generator": false, + "description": "
    \n
  • If accept_multiple_files is False, returns either None or\nan UploadedFile object.
  • \n
  • If accept_multiple_files is True, returns a list with the\nuploaded files as UploadedFile objects. If no files were\nuploaded, returns an empty list.
  • \n
\n

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/file_uploader.py#L205" + }, + "DeltaGenerator.form": { + "name": "form", + "signature": "element.form(key, clear_on_submit=False)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n

Inserting elements out of order:

\n
\nimport streamlit as st\n\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n
\n", + "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

A string that identifies the form. Each form must have its own\nkey. (This key is not displayed to the user in the interface.)

\n", + "default": null + }, + { + "name": "clear_on_submit", + "type_name": "bool", + "is_optional": false, + "description": "

If True, all widgets inside the form will be reset to their default\nvalues after the user presses the Submit button. Defaults to False.\n(Note that Custom Components are unaffected by this flag, and\nwill not be reset to their defaults on form submission.)

\n", + "default": "values" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/form.py#L118" + }, + "DeltaGenerator.form_submit_button": { + "name": "form_submit_button", + "signature": "element.form_submit_button(label=\"Submit\", help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nDefaults to "Submit".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

A tooltip that gets displayed when the button is hovered over.\nDefaults to None.

\n", + "default": "None." + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/form.py#L211" + }, + "DeltaGenerator.graphviz_chart": { + "name": "graphviz_chart", + "signature": "element.graphviz_chart(figure_or_dot, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nimport graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n
\n", + "description": "

Display a graph using the dagre-d3 library.

\n", + "args": [ + { + "name": "figure_or_dot", + "type_name": "graphviz.dot.Graph, graphviz.dot.Digraph, str", + "is_optional": false, + "description": "

The Graphlib graph object or dot string to display

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/graphviz_chart.py#L39" + }, + "DeltaGenerator.header": { + "name": "header", + "signature": "element.header(body, anchor=None, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.header('This is a header')\nst.header('A header with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in header formatting.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str or False", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the header.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/heading.py#L40" + }, + "DeltaGenerator.help": { + "name": "help", + "signature": "element.help(obj=)", + "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nimport streamlit as st\nimport pandas\n\nst.help(pandas.DataFrame)\n
\n\n \n

Want to quickly check what data type is output by a certain function?\nTry:

\n
\nimport streamlit as st\n\nx = my_poorly_documented_function()\nst.help(x)\n
\n

Want to quickly inspect an object? No sweat:

\n
\nclass Dog:\n  '''A typical dog.'''\n\n  def __init__(self, breed, color):\n    self.breed = breed\n    self.color = color\n\n  def bark(self):\n    return 'Woof!'\n\n\nfido = Dog('poodle', 'white')\n\nst.help(fido)\n
\n\n \n

And if you're using Magic, you can get help for functions, classes,\nand modules without even typing st.help:

\n
\nimport streamlit as st\nimport pandas\n\n# Get help for Pandas read_csv:\npandas.read_csv\n\n# Get help for Streamlit itself:\nst\n
\n\n \n
\n", + "description": "

Display help and other information for a given object.

\n

Depending on the type of object that is passed in, this displays the\nobject's name, type, value, signature, docstring, and member variables,\nmethods \u2014 as well as the values/docstring of members and methods.

\n", + "args": [ + { + "name": "obj", + "type_name": "any", + "is_optional": false, + "description": "

The object whose information should be displayed. If left\nunspecified, this call will display help for Streamlit itself.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/doc_string.py#L49" + }, + "DeltaGenerator.id": { + "name": "id", + "signature": "element.id" + }, + "DeltaGenerator.image": { + "name": "image", + "signature": "element.image(image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", + "example": "
\n
\nimport streamlit as st\nfrom PIL import Image\n\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n
\n", + "description": "

Display an image or list of images.

\n", + "args": [ + { + "name": "image", + "type_name": "numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]", + "is_optional": false, + "description": "

Monochrome image of shape (w,h) or (w,h,1)\nOR a color image of shape (w,h,3)\nOR an RGBA image of shape (w,h,4)\nOR a URL to fetch the image from\nOR a path of a local image file\nOR an SVG XML string like <svg xmlns=...</svg>\nOR a list of one of the above, to display multiple images.

\n", + "default": null + }, + { + "name": "caption", + "type_name": "str or list of str", + "is_optional": false, + "description": "

Image caption. If displaying multiple images, caption should be a\nlist of captions (one for each image).

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Image width. None means use the image width,\nbut do not exceed the width of the column.\nShould be set for SVG images, as they have no default image width.

\n", + "default": "image" + }, + { + "name": "use_column_width", + "type_name": "'auto' or 'always' or 'never' or bool", + "is_optional": false, + "description": "

If 'auto', set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf 'always' or True, set the image's width to the column width.\nIf 'never' or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", + "default": null + }, + { + "name": "clamp", + "type_name": "bool", + "is_optional": false, + "description": "

Clamp image pixel values to a valid range ([0-255] per channel).\nThis is only meaningful for byte array images; the parameter is\nignored for image URLs. If this is not set, and an image has an\nout-of-range value, an error will be thrown.

\n", + "default": null + }, + { + "name": "channels", + "type_name": "'RGB' or 'BGR'", + "is_optional": false, + "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to 'RGB', meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to 'BGR', instead.

\n", + "default": "s" + }, + { + "name": "output_format", + "type_name": "'JPEG', 'PNG', or 'auto'", + "is_optional": false, + "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to 'auto' which identifies the compression type based\non the type and format of the image argument.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/image.py#L88" + }, + "DeltaGenerator.info": { + "name": "info", + "signature": "element.info(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", + "description": "

Display an informational message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The info text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/alert.py#L103" + }, + "DeltaGenerator.json": { + "name": "json", + "signature": "element.json(body, *, expanded=True)", + "example": "
\n
\nimport streamlit as st\n\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n
\n", + "description": "

Display object or string as a pretty-printed JSON string.

\n", + "args": [ + { + "name": "body", + "type_name": "object or str", + "is_optional": false, + "description": "

The object to print as JSON. All referenced objects should be\nserializable to JSON as well. If object is a string, we assume it\ncontains serialized JSON.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean that allows the user to set whether the initial\nstate of this json element should be expanded. Defaults to True.\nThis argument can only be supplied by keyword.

\n", + "default": "True." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/json.py#L35" + }, + "DeltaGenerator.latex": { + "name": "latex", + "signature": "element.latex(body, *, help=None)", + "example": "
\n
\nimport streamlit as st\n\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", + "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", + "args": [ + { + "name": "body", + "type_name": "str or SymPy expression", + "is_optional": false, + "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the LaTeX expression.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/markdown.py#L196" + }, + "DeltaGenerator.line_chart": { + "name": "line_chart", + "signature": "element.line_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\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 \n
\n", + "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict or None", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/dataframe_selector.py#L160" + }, + "DeltaGenerator.map": { + "name": "map", + "signature": "element.map(data=None, zoom=None, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n
\n", + "description": "

Display a map with points on it.

\n

This is a wrapper around st.pydeck_chart to quickly create\nscatterplot charts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to be plotted. Must have two columns:

\n
    \n
  • latitude called 'lat', 'latitude', 'LAT', 'LATITUDE'
  • \n
  • longitude called 'lon', 'longitude', 'LON', 'LONGITUDE'.
  • \n
\n", + "default": null + }, + { + "name": "zoom", + "type_name": "int", + "is_optional": false, + "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/map.py#L76" + }, + "DeltaGenerator.markdown": { + "name": "markdown", + "signature": "element.markdown(body, unsafe_allow_html=False, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.markdown('Streamlit is **_really_ cool**.')\nst.markdown(\u201dThis text is :red[colored red], and this is **:blue[colored]** and bold.\u201d)\nst.markdown(":green[$\\sqrt{x^2+y^2}=1$] is a Pythagorean identity. :pencil:")\n
\n
\n", + "description": "

Display string formatted as Markdown.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the Markdown.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/markdown.py#L31" + }, + "DeltaGenerator.metric": { + "name": "metric", + "signature": "element.metric(label, value, delta=None, delta_color=\"normal\", help=None, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n

st.metric looks especially nice in combination with st.columns:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n

The delta indicator color can also be inverted or turned off:

\n
\nimport streamlit as st\n\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n
\n", + "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

The header or title for the metric. The label can optionally contain\nMarkdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Value of the metric. None is rendered as a long dash.

\n", + "default": null + }, + { + "name": "delta", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Indicator of how the metric changed, rendered with an arrow below\nthe metric. If delta is negative (int/float) or starts with a minus\nsign (str), the arrow points down and the text is red; else the\narrow points up and the text is green. If None (default), no delta\nindicator is shown.

\n", + "default": null + }, + { + "name": "delta_color", + "type_name": "str", + "is_optional": false, + "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the metric label.

\n", + "default": null + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/metric.py#L46" + }, + "DeltaGenerator.multiselect": { + "name": "multiselect", + "signature": "element.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", max_selections=None)", + "example": "
\n
\nimport streamlit as st\n\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n
\n", + "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence[V], numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "default", + "type_name": "[V], V, or None", + "is_optional": false, + "description": "

List of default values. Can also be a single value.

\n", + "default": "values." + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of selectbox options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe multiselect.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the multiselect.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this multiselect's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the multiselect widget if set\nto True. The default is False. This argument can only be supplied\nby keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "max_selections", + "type_name": "int", + "is_optional": false, + "description": "

The max selections that can be selected at a time.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list", + "is_generator": false, + "description": "

A list with the selected options

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/multiselect.py#L145" + }, + "DeltaGenerator.number_input": { + "name": "number_input", + "signature": "element.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n
\n", + "description": "

Display a numeric input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. Output must be purely numeric. This does not impact\nthe return value. Valid formatters: %d %e %f %g %i %u

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this number_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the number input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int or float", + "is_generator": false, + "description": "

The current value of the numeric input widget. The return type\nwill match the data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/number_input.py#L66" + }, + "DeltaGenerator.plotly_chart": { + "name": "plotly_chart", + "signature": "element.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", theme=\"streamlit\", **kwargs)", + "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport numpy as np\nimport plotly.figure_factory as ff\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n        hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n
\n", + "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", + "args": [ + { + "name": "figure_or_data", + "type_name": "plotly.graph_objs.Figure, plotly.graph_objs.Data,", + "is_optional": false, + "description": "

dict/list of plotly.graph_objs.Figure/Data

\n

See https://plot.ly/python/ for examples of graph descriptions.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + }, + { + "name": "sharing", + "type_name": "{'streamlit', 'private', 'secret', 'public'}", + "is_optional": false, + "description": "

Use 'streamlit' to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": null, + "is_optional": null, + "description": "

Any argument accepted by Plotly's plot() function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/plotly_chart.py#L81" + }, + "DeltaGenerator.progress": { + "name": "progress", + "signature": "element.progress(value, text=None)", + "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport streamlit as st\nimport time\n\nprogress_text = "Operation in progress. Please wait."\nmy_bar = st.progress(0, text=progress_text)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1, text=progress_text)\n
\n
\n", + "description": "

Display a progress bar.

\n", + "args": [ + { + "name": "value", + "type_name": "int or float", + "is_optional": false, + "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", + "default": null + }, + { + "name": "text", + "type_name": "str or None", + "is_optional": false, + "description": "

A message to display above the progress bar. The text can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/progress.py#L66" + }, + "DeltaGenerator.pydeck_chart": { + "name": "pydeck_chart", + "signature": "element.pydeck_chart(pydeck_obj=None, use_container_width=False)", + "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport pydeck as pdk\n\nchart_data = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=chart_data,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=chart_data,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", + "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "args": [ + { + "name": "pydeck_obj", + "type_name": "pydeck.Deck or None", + "is_optional": false, + "description": "

Object specifying the PyDeck chart to draw.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/deck_gl_json_chart.py#L36" + }, + "DeltaGenerator.pyplot": { + "name": "pyplot", + "signature": "element.pyplot(fig=None, clear_figure=None, use_container_width=True, **kwargs)", + "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", + "example": "
\n
\nimport streamlit as st\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n
\n", + "description": "

Display a matplotlib.pyplot figure.

\n", + "args": [ + { + "name": "fig", + "type_name": "Matplotlib Figure", + "is_optional": false, + "description": "

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

\n", + "default": null + }, + { + "name": "clear_figure", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", + "default": "based" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n", + "default": "s" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Arguments to pass to Matplotlib's savefig function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/pyplot.py#L38" + }, + "DeltaGenerator.radio": { + "name": "radio", + "signature": "element.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ngenre = st.radio(\n    "What\\'s your favorite movie genre",\n    ('Comedy', 'Drama', 'Documentary'))\n\nif genre == 'Comedy':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn\\'t select comedy.")\n
\n\n \n
\n", + "description": "

Display a radio button widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this radio group is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the radio options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of radio options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe radio.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the radio.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this radio's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the radio button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "horizontal", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", + "default": "false" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/radio.py#L75" + }, + "DeltaGenerator.select_slider": { + "name": "select_slider", + "signature": "element.select_slider(label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\nimport streamlit as st\n\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nimport streamlit as st\n\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n ", + "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the slider options. All options will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", + "default": "." + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to first option.

\n", + "default": "first" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels from the options.\nargument. It receives the option as an argument and its output\nwill be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the select slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this select_slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the select slider if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any value or tuple of any value", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/select_slider.py#L106" + }, + "DeltaGenerator.selectbox": { + "name": "selectbox", + "signature": "element.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n
\n", + "description": "

Display a select widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels. It receives the option\nas an argument and its output will be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the selectbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this selectbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the selectbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/selectbox.py#L71" + }, + "DeltaGenerator.slider": { + "name": "slider", + "signature": "element.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nimport streamlit as st\n\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nimport streamlit as st\nfrom datetime import time\n\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nimport streamlit as st\nfrom datetime import datetime\n\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n
\n", + "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The minimum permitted value.\nDefaults to 0 if the value is an int, 0.0 if a float,\nvalue - timedelta(days=14) if a date/datetime, time.min if a time

\n", + "default": "0" + }, + { + "name": "max_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The maximum permitted value.\nDefaults to 100 if the value is an int, 1.0 if a float,\nvalue + timedelta(days=14) if a date/datetime, time.max if a time

\n", + "default": "100" + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to min_value.

\n", + "default": "min_value." + }, + { + "name": "step", + "type_name": "int/float/timedelta or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. This does not impact the return value.\nFormatter for int/float supports: %d %e %f %g %i\nFormatter for date/time/datetime uses Moment.js notation:\nhttps://momentjs.com/docs/#/displaying/format/

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the slider if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int/float/date/time/datetime or tuple of int/float/date/time/datetime", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/slider.py#L171" + }, + "DeltaGenerator.snow": { + "name": "snow", + "signature": "element.snow()", + "example": "
\n
\nimport streamlit as st\n\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", + "description": "

Draw celebratory snowfall.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/snow.py#L25" + }, + "DeltaGenerator.subheader": { + "name": "subheader", + "signature": "element.subheader(body, anchor=None, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.subheader('This is a subheader')\nst.subheader('A subheader with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in subheader formatting.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str or False", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the subheader.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/heading.py#L93" + }, + "DeltaGenerator.success": { + "name": "success", + "signature": "element.success(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", + "description": "

Display a success message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The success text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/alert.py#L136" + }, + "DeltaGenerator.table": { + "name": "table", + "signature": "element.table(data=None)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n
\n", + "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/dataframe_selector.py#L122" + }, + "DeltaGenerator.tabs": { + "name": "tabs", + "signature": "element.tabs(tabs)", + "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\nimport streamlit as st\n\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n
\n", + "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", + "args": [ + { + "name": "tabs", + "type_name": "list of strings", + "is_optional": false, + "description": "

Creates a tab for each string in the list. The first tab is selected by default.\nThe string is used as the name of the tab and can optionally contain Markdown,\nsupporting the following elements: Bold, Italics, Strikethroughs, Inline Code,\nEmojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": "." + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/layouts.py#L208" + }, + "DeltaGenerator.text": { + "name": "text", + "signature": "element.text(body, *, help=None)", + "example": "
\n
\nimport streamlit as st\n\nst.text('This is some text.')\n
\n
\n", + "description": "

Write fixed-width and preformatted text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the text.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/text.py#L27" + }, + "DeltaGenerator.text_area": { + "name": "text_area", + "signature": "element.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", + "description": "

Display a multi-line text input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Maximum number of characters allowed in text area.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the textarea.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_area's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text area is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text area if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/text_widgets.py#L274" + }, + "DeltaGenerator.text_input": { + "name": "text_input", + "signature": "element.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n
\n", + "description": "

Display a single-line text input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Max number of characters allowed in text input.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"default\" or \"password\"", + "is_optional": false, + "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "autocomplete", + "type_name": "str", + "is_optional": false, + "description": "

An optional value that will be passed to the <input> element's\nautocomplete property. If unspecified, this value will be set to\n"new-password" for "password" inputs, and the empty string for\n"default" inputs. For more details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text input is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/text_widgets.py#L71" + }, + "DeltaGenerator.time_input": { + "name": "time_input", + "signature": "element.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", step=0:15:00)", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n
\n", + "description": "

Display a time input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this time input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.time/datetime.datetime", + "is_optional": false, + "description": "

The value of this widget when it first renders. This will be\ncast to str internally. Defaults to the current time.

\n", + "default": "the" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this time_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the time input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "step", + "type_name": "int or timedelta", + "is_optional": false, + "description": "

The stepping interval in seconds. Defaults to 900, i.e. 15 minutes.\nYou can also pass a datetime.timedelta object.

\n", + "default": "900" + } + ], + "returns": [ + { + "type_name": "datetime.time", + "is_generator": false, + "description": "

The current value of the time input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/time_widgets.py#L214" + }, + "DeltaGenerator.title": { + "name": "title", + "signature": "element.title(body, anchor=None, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.title('This is a title')\nst.title('A title with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str or False", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the title.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/heading.py#L146" + }, + "DeltaGenerator.vega_lite_chart": { + "name": "vega_lite_chart", + "signature": "element.vega_lite_chart(data=None, spec=None, use_container_width=False, theme=\"streamlit\", **kwargs)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(chart_data, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", + "description": "

Display a chart using the Vega-Lite library.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "spec", + "type_name": "dict or None", + "is_optional": false, + "description": "

The Vega-Lite spec for the chart. If the spec was already passed in\nthe previous argument, this must be set to None. See\nhttps://vega.github.io/vega-lite/docs/ for more info.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Same as spec, but as keywords.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/dataframe_selector.py#L475" + }, + "DeltaGenerator.video": { + "name": "video", + "signature": "element.video(data, format=\"video/mp4\", start_time=0)", + "example": "
\n
\nimport streamlit as st\n\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", + "description": "

Display a video player.

\n", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "default": null + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the video file. Defaults to 'video/mp4'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/media.py#L117" + }, + "DeltaGenerator.warning": { + "name": "warning", + "signature": "element.warning(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", + "description": "

Display warning message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The warning text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/alert.py#L71" + }, + "DeltaGenerator.write": { + "name": "write", + "signature": "element.write(*args, unsafe_allow_html=False, **kwargs)", + "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nimport streamlit as st\n\nst.write('Hello, *World!* :sunglasses:')\n
\n\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nimport streamlit as st\nimport pandas as pd\n\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nimport streamlit as st\n\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n
\n", + "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression, emoji shortcodes, and colored text.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(class) : Displays information about a class.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.21.0/lib/streamlit/elements/write.py#L48" + } + }, + "1.22.0": { + "streamlit.altair_chart": { + "name": "altair_chart", + "signature": "st.altair_chart(altair_chart, use_container_width=False, theme=\"streamlit\")", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(chart_data).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n
\n", + "description": "

Display a chart using the Altair library.

\n", + "args": [ + { + "name": "altair_chart", + "type_name": "altair.vegalite.v2.api.Chart", + "is_optional": false, + "description": "

The Altair chart object to display.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/dataframe_selector.py#L422" + }, + "streamlit.area_chart": { + "name": "area_chart", + "signature": "st.area_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n
\n", + "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/dataframe_selector.py#L247" + }, + "streamlit.audio": { + "name": "audio", + "signature": "st.audio(data, format=\"audio/wav\", start_time=0, *, sample_rate=None)", + "example": "
\n
\nimport streamlit as st\nimport numpy as np\n\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n\nsample_rate = 44100  # 44100 samples per second\nseconds = 2  # Note duration of 2 seconds\nfrequency_la = 440  # Our played note will be 440 Hz\n# Generate array with seconds*sample_rate steps, ranging between 0 and seconds\nt = np.linspace(0, seconds, seconds * sample_rate, False)\n# Generate a 440 Hz sine wave\nnote_la = np.sin(frequency_la * t * 2 * np.pi)\n\nst.audio(note_la, sample_rate=sample_rate)\n
\n\n \n
\n", + "description": "

Display an audio player.

\n", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw audio data, filename, or a URL pointing to the file to load.\nRaw data formats must include all necessary file headers to match the file\nformat specified via format.\nIf data is a numpy array, it must either be a 1D array of the waveform\nor a 2D array of shape (num_channels, num_samples) with waveforms\nfor all channels. See the default channel order at\nhttp://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx

\n", + "default": "channel" + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + }, + { + "name": "sample_rate", + "type_name": "int or None", + "is_optional": false, + "description": "

The sample rate of the audio data in samples per second. Only required if\ndata is a numpy array.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/media.py#L43" + }, + "streamlit.balloons": { + "name": "balloons", + "signature": "st.balloons()", + "example": "
\n
\nimport streamlit as st\n\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", + "description": "

Draw celebratory balloons.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/balloons.py#L25" + }, + "streamlit.bar_chart": { + "name": "bar_chart", + "signature": "st.bar_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n
\n", + "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/dataframe_selector.py#L334" + }, + "streamlit.beta_columns": { + "name": "beta_columns", + "signature": "st.beta_columns(spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/layouts.py#L77" + }, + "streamlit.beta_container": { + "name": "beta_container", + "signature": "st.beta_container()", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/layouts.py#L29" + }, + "streamlit.beta_expander": { + "name": "beta_expander", + "signature": "st.beta_expander(label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/layouts.py#L320" + }, + "streamlit.bokeh_chart": { + "name": "bokeh_chart", + "signature": "st.bokeh_chart(figure, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n
\n", + "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", + "args": [ + { + "name": "figure", + "type_name": "bokeh.plotting.figure.Figure", + "is_optional": false, + "description": "

A Bokeh figure to plot.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Bokeh's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/bokeh_chart.py#L36" + }, + "streamlit.button": { + "name": "button", + "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\n\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n
\n", + "description": "

Display a button widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/button.py#L61" + }, + "streamlit.cache": { + "name": "cache", + "signature": "st.cache(func=None, persist=False, allow_output_mutation=False, show_spinner=True, suppress_st_warning=False, hash_funcs=None, max_entries=None, ttl=None)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\n@st.cache(persist=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To disable hashing return values, set the allow_output_mutation parameter to True:

\n
\n@st.cache(allow_output_mutation=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. MongoClient) to a hash function (id) like this:

\n
\n@st.cache(hash_funcs={MongoClient: id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "pymongo.mongo_client.MongoClient") to the hash function instead:

\n
\n@st.cache(hash_funcs={"pymongo.mongo_client.MongoClient": id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n
\n", + "description": "

Function decorator to memoize function executions.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to cache. Streamlit hashes the function and dependent code.

\n", + "default": null + }, + { + "name": "persist", + "type_name": "boolean", + "is_optional": false, + "description": "

Whether to persist the cache on disk.

\n", + "default": null + }, + { + "name": "allow_output_mutation", + "type_name": "boolean", + "is_optional": false, + "description": "

Streamlit shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.

\n

If you know what you're doing and would like to override this warning, set this to True.

\n", + "default": null + }, + { + "name": "show_spinner", + "type_name": "boolean", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na cache miss.

\n", + "default": "True" + }, + { + "name": "suppress_st_warning", + "type_name": "boolean", + "is_optional": false, + "description": "

Suppress warnings about calling Streamlit commands from within\nthe cached function.

\n", + "default": null + }, + { + "name": "hash_funcs", + "type_name": "dict or None", + "is_optional": false, + "description": "

Mapping of types or fully qualified names to hash functions. This is used to override\nthe behavior of the hasher inside Streamlit's caching mechanism: when the hasher\nencounters an object, it will first check to see if its type matches a key in this\ndict and, if so, will use the provided function to generate a hash for it. See below\nfor an example of how this can be used.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." + }, + { + "name": "ttl", + "type_name": "float or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.

\n", + "default": "None." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/runtime/legacy_caching/caching.py#L486" + }, + "streamlit.cache_data": { + "name": "cache_data", + "signature": "st.cache_data(func=None, *, ttl, max_entries, show_spinner, persist, experimental_allow_widgets)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\nimport streamlit as st\n\n@st.cache_data(persist="disk")\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

By default, all parameters to a cached function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nconnection = make_database_connection()\nd1 = fetch_and_clean_data(connection, num_rows=10)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nanother_connection = make_database_connection()\nd2 = fetch_and_clean_data(another_connection, num_rows=10)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _database_connection parameter was different\n# in both calls.\n
\n

A cached function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nfetch_and_clean_data.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Decorator to cache functions that return data (e.g. dataframe transforms, database queries, ML inference).

\n

Cached objects are stored in "pickled" form, which means that the return\nvalue of a cached function must be pickleable. Each caller of the cached\nfunction gets its own copy of the cached data.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_data.clear().

\n

To cache global resources, use st.cache_resource instead. Learn more\nabout caching at https://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to cache. Streamlit hashes the function's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float or timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.\nNote that ttl is incompatible with persist="disk" - ttl will be\nignored if persist is specified.

\n", + "default": "None." + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached data is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "persist", + "type_name": "str or boolean or None", + "is_optional": false, + "description": "

Optional location to persist cached data to. Passing "disk" (or True)\nwill persist the cached data to the local disk. None (or False) will disable\npersistence. The default is None.

\n", + "default": "None." + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/runtime/caching/cache_data_api.py#L378" + }, + "streamlit.cache_resource": { + "name": "cache_resource", + "signature": "st.cache_resource(func, *, ttl, max_entries, show_spinner, validate, experimental_allow_widgets)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(url):\n    # Create a database session object that points to the URL.\n    return session\n\ns1 = get_database_session(SESSION_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(SESSION_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the connection object in s1 is the same as in s2.\n\ns3 = get_database_session(SESSION_URL_2)\n# This is a different URL, so the function executes.\n
\n

By default, all parameters to a cache_resource function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\ns1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _sessionmaker parameter was different\n# in both calls.\n
\n

A cache_resource function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\nget_database_session.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Decorator to cache functions that return global resources (e.g. database connections, ML models).

\n

Cached objects are shared across all users, sessions, and reruns. They\nmust be thread-safe because they can be accessed from multiple threads\nconcurrently. If thread safety is an issue, consider using st.session_state\nto store resources per session instead.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_resource.clear().

\n

To cache data, use st.cache_data instead. Learn more about caching at\nhttps://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function that creates the cached resource. Streamlit hashes the\nfunction's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float or timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.

\n", + "default": "None." + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached resource is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "validate", + "type_name": "callable or None", + "is_optional": false, + "description": "

An optional validation function for cached data. validate is called\neach time the cached value is accessed. It receives the cached value as\nits only parameter and it must return a boolean. If validate returns\nFalse, the current cached value is discarded, and the decorated function\nis called to compute a new value. This is useful e.g. to check the\nhealth of database connections.

\n", + "default": null + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/runtime/caching/cache_resource_api.py#L258" + }, + "streamlit.camera_input": { + "name": "camera_input", + "signature": "st.camera_input(label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", + "description": "

Display a widget that returns pictures from the user's webcam.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this widget is used for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the camera input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this camera_input's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile", + "is_generator": false, + "description": "

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/camera_input.py#L109" + }, + "streamlit.caption": { + "name": "caption", + "signature": "st.caption(body, unsafe_allow_html=False, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.caption('This is a string that explains something above.')\nst.caption('A caption with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the caption.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/markdown.py#L132" + }, + "streamlit.checkbox": { + "name": "checkbox", + "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n
\n", + "description": "

Display a checkbox widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this checkbox is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "value", + "type_name": "bool", + "is_optional": false, + "description": "

Preselect the checkbox when it first renders. This will be\ncast to bool internally.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the checkbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this checkbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

Whether or not the checkbox is checked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/checkbox.py#L52" + }, + "streamlit.code": { + "name": "code", + "signature": "st.code(body, language=\"python\", line_numbers=False)", + "example": "
\n
\nimport streamlit as st\n\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", + "description": "

Display a code block with optional syntax highlighting.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as code.

\n", + "default": null + }, + { + "name": "language", + "type_name": "str or None", + "is_optional": false, + "description": "

The language that the code is written in, for syntax highlighting.\nIf None, the code will be unstyled. Defaults to "python".

\n

For a list of available language values, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", + "default": "s" + }, + { + "name": "line_numbers", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean indicating whether to show line numbers to the\nleft of the code block. Defaults to False.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/code.py#L27" + }, + "streamlit.color_picker": { + "name": "color_picker", + "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n
\n", + "description": "

Display a color picker widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "str", + "is_optional": false, + "description": "

The hex value of this widget when it first renders. If None,\ndefaults to black.

\n", + "default": "black." + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the color picker.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this color_picker's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The selected color as a hex string.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/color_picker.py#L52" + }, + "streamlit.columns": { + "name": "columns", + "signature": "st.columns(spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/layouts.py#L77" + }, + "streamlit.container": { + "name": "container", + "signature": "st.container()", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/layouts.py#L29" + }, + "streamlit.dataframe": { + "name": "dataframe", + "signature": "st.dataframe(data=None, width=None, height=None, *, use_container_width=False)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n
\nst.dataframe(df, 200, 100)\n
\n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n
\n", + "description": "

Display a dataframe as an interactive table.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. (It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.)\nStyler support is experimental!\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the dataframe expressed in pixels. If None, the width\nwill be automatically calculated based on the column content.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the dataframe expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the dataframe width to the width of the parent container.\nThis takes precedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/dataframe_selector.py#L40" + }, + "streamlit.date_input": { + "name": "date_input", + "signature": "st.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nd = st.date_input(\n    "When\\'s your birthday",\n    datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n
\n", + "description": "

Display a date input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this date input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", + "is_optional": false, + "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", + "default": "today" + }, + { + "name": "min_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", + "default": "value" + }, + { + "name": "max_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", + "default": "value" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this date_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.date or a tuple with 0-2 dates", + "is_generator": false, + "description": "

The current value of the date input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/time_widgets.py#L399" + }, + "streamlit.divider": { + "name": "divider", + "signature": "st.divider()", + "example": "
\n
\nimport streamlit as st\n\nst.divider()\n
\n
\n", + "description": "

Display a horizontal rule.

\n
\n

Note

\n

You can achieve the same effect with st.write("---") or\neven just "---" in your script (via magic).

\n
\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/markdown.py#L244" + }, + "streamlit.download_button": { + "name": "download_button", + "signature": "st.download_button(label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False, use_container_width=False)", + "examples": "
\n

Download a large DataFrame as a CSV:

\n
\nimport streamlit as st\n\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\nimport streamlit as st\n\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nimport streamlit as st\n\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nimport streamlit as st\n\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n
\n", + "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "data", + "type_name": "str or bytes or file", + "is_optional": false, + "description": "

The contents of the file to be downloaded. See example below for\ncaching techniques to avoid recomputing this data unnecessarily.

\n", + "default": null + }, + { + "name": "file_name", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the name of the file to be downloaded,\nsuch as 'my_file.csv'. If not specified, the name will be\nautomatically generated.

\n", + "default": null + }, + { + "name": "mime", + "type_name": "str or None", + "is_optional": false, + "description": "

The MIME type of the data. If None, defaults to "text/plain"\n(if data is of type str or is a textual file) or\n"application/octet-stream" (if data is of type bytes or is a\nbinary file).

\n", + "default": "s" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/button.py#L169" + }, + "streamlit.echo": { + "name": "echo", + "signature": "st.echo(code_location=\"above\")", + "example": "
\n
\nimport streamlit as st\n\nwith st.echo():\n    st.write('This code will be printed')\n
\n
\n", + "description": "

Use in a with block to draw some code on the app, then execute it.

\n", + "args": [ + { + "name": "code_location", + "type_name": "\"above\" or \"below\"", + "is_optional": false, + "description": "

Whether to show the echoed code before or after the results of the\nexecuted code block.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/echo.py#L27" + }, + "streamlit.empty": { + "name": "empty", + "signature": "st.empty()", + "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport streamlit as st\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nimport streamlit as st\n\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", + "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/empty.py#L24" + }, + "streamlit.error": { + "name": "error", + "signature": "st.error(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", + "description": "

Display error message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The error text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/alert.py#L39" + }, + "streamlit.exception": { + "name": "exception", + "signature": "st.exception(exception)", + "example": "
\n
\nimport streamlit as st\n\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", + "description": "

Display an exception.

\n", + "args": [ + { + "name": "exception", + "type_name": "Exception", + "is_optional": false, + "description": "

The exception to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/exception.py#L50" + }, + "streamlit.expander": { + "name": "expander", + "signature": "st.expander(label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/layouts.py#L320" + }, + "streamlit.experimental_connection": { + "name": "experimental_connection", + "signature": "st.experimental_connection(name, type=None, max_entries=None, ttl=None, **kwargs)", + "examples": "
\n

The easiest way to create a first-party (SQL or Snowpark) connection is to use their\ndefault names and define corresponding sections in your secrets.toml file.

\n
\nimport streamlit as st\nconn = st.experimental_connection("sql") # Config section defined in [connections.sql] in secrets.toml.\n
\n

Creating a SQLConnection with a custom name requires you to explicitly specify the\ntype. If type is not passed as a kwarg, it must be set in the appropriate section of\nsecrets.toml.

\n
\nimport streamlit as st\nconn1 = st.experimental_connection("my_sql_connection", type="sql") # Config section defined in [connections.my_sql_connection].\nconn2 = st.experimental_connection("my_other_sql_connection") # type must be set in [connections.my_other_sql_connection].\n
\n

Passing the full module path to the connection class that you want to use can be\nuseful, especially when working with a custom connection:

\n
\nimport streamlit as st\nconn = st.experimental_connection("my_sql_connection", type="streamlit.connections.SQLConnection")\n
\n

Finally, you can pass the connection class to use directly to this function. Doing\nso allows static type checking tools such as mypy to infer the exact return\ntype of st.experimental_connection.

\n
\nimport streamlit as st\nfrom streamlit.connections import SQLConnection\nconn = st.experimental_connection("my_sql_connection", type=SQLConnection)\n
\n
\n", + "description": "

Create a new connection to a data store or API, or return an existing one.

\n

Config options, credentials, secrets, etc. for connections are taken from various\nsources:

\n
    \n
  • Any connection-specific configuration files.
  • \n
  • An app's secrets.toml files.
  • \n
  • The kwargs passed to this function.
  • \n
\n", + "args": [ + { + "name": "name", + "type_name": "str", + "is_optional": false, + "description": "

The connection name used for secrets lookup in [connections.<name>].\nType will be inferred from passing "sql" or "snowpark".

\n", + "default": null + }, + { + "name": "type", + "type_name": "str or connection class or None", + "is_optional": false, + "description": "

The type of connection to create. It can be a keyword ("sql" or "snowpark"),\na path to an importable class, or an imported class reference. All classes\nmust extend st.connections.ExperimentalBaseConnection and implement the\n_connect() method. If the type kwarg is None, a type field must be set\nin the connection's section in secrets.toml.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of connections to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." + }, + { + "name": "ttl", + "type_name": "float or timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep results in the cache, or\nNone if cached results should not expire. The default is None.

\n", + "default": "None." + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Additional connection specific kwargs that are passed to the Connection's\n_connect() method. Learn more from the specific Connection's documentation.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "Connection object", + "is_generator": false, + "description": "

An initialized Connection object of the specified type.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/runtime/connection_factory.py#L170" + }, + "streamlit.experimental_data_editor": { + "name": "experimental_data_editor", + "signature": "st.experimental_data_editor(data, *, width=None, height=None, use_container_width=False, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.experimental_data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.experimental_data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n
\n", + "description": "

Display a data editor widget.

\n

Display a data editor widget that allows you to edit DataFrames and\nmany other data structures in a table-like UI.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None", + "is_optional": false, + "description": "

The data to edit in the data editor.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the data editor expressed in pixels. If None, the width will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the data editor expressed in pixels. If None, the height will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the data editor width to the width of the parent container.\nThis takes precedence over the width argument. Defaults to False.

\n", + "default": "False." + }, + { + "name": "num_rows", + "type_name": "\"fixed\" or \"dynamic\"", + "is_optional": false, + "description": "

Specifies if the user can add and delete rows in the data editor.\nIf "fixed", the user cannot add or delete rows. If "dynamic", the user can\nadd and delete rows in the data editor, but column sorting is disabled.\nDefaults to "fixed".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean which, if True, disables the data editor and prevents\nany edits. Defaults to False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the unique key for this widget. If this\nis omitted, a key will be generated for the widget based on its\ncontent. Multiple widgets of the same type may not share the same\nkey.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this data_editor's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "pd.DataFrame, pd.Styler, pyarrow.Table, np.ndarray, list, set, tuple, or dict.", + "is_generator": false, + "description": "

The edited data. The edited data is returned in its original data type if\nit corresponds to any of the supported return types. All other data types\nare returned as a pd.DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/data_editor.py#L448" + }, + "streamlit.experimental_get_query_params": { + "name": "experimental_get_query_params", + "signature": "st.experimental_get_query_params()", + "example": "
\n

Let's say the user's web browser is at\nhttp://localhost:8501/?show_map=True&selected=asia&selected=america.\nThen, you can get the query parameters using the following:

\n
\nimport streamlit as st\n\nst.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\n

Note that the values in the returned dict are always lists. This is\nbecause we internally use Python's urllib.parse.parse_qs(), which behaves\nthis way. And this behavior makes sense when you consider that every item\nin a query string is potentially a 1-element array.

\n
\n", + "description": "

Return the query parameters that is currently showing in the browser's URL bar.

\n", + "args": [], + "returns": [ + { + "type_name": "dict", + "is_generator": false, + "description": "

The current query parameters as a dict. "Query parameters" are the part of the URL that comes\nafter the first "?".

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/commands/query_params.py#L29" + }, + "streamlit.experimental_memo": { + "name": "experimental_memo", + "signature": "st.experimental_memo(func=None, *, ttl, max_entries, show_spinner, persist, experimental_allow_widgets)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\nimport streamlit as st\n\n@st.cache_data(persist="disk")\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

By default, all parameters to a cached function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nconnection = make_database_connection()\nd1 = fetch_and_clean_data(connection, num_rows=10)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nanother_connection = make_database_connection()\nd2 = fetch_and_clean_data(another_connection, num_rows=10)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _database_connection parameter was different\n# in both calls.\n
\n

A cached function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nfetch_and_clean_data.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Decorator to cache functions that return data (e.g. dataframe transforms, database queries, ML inference).

\n

Cached objects are stored in "pickled" form, which means that the return\nvalue of a cached function must be pickleable. Each caller of the cached\nfunction gets its own copy of the cached data.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_data.clear().

\n

To cache global resources, use st.cache_resource instead. Learn more\nabout caching at https://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to cache. Streamlit hashes the function's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float or timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.\nNote that ttl is incompatible with persist="disk" - ttl will be\nignored if persist is specified.

\n", + "default": "None." + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached data is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "persist", + "type_name": "str or boolean or None", + "is_optional": false, + "description": "

Optional location to persist cached data to. Passing "disk" (or True)\nwill persist the cached data to the local disk. None (or False) will disable\npersistence. The default is None.

\n", + "default": "None." + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/runtime/caching/cache_data_api.py#L378" + }, + "streamlit.experimental_rerun": { + "name": "experimental_rerun", + "signature": "st.experimental_rerun()", + "description": "

Rerun the script immediately.

\n

When st.experimental_rerun() is called, the script is halted - no\nmore statements will be run, and the script will be queued to re-run\nfrom the top.

\n

If this function is called outside of Streamlit, it will raise an\nException.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/commands/execution_control.py#L46" + }, + "streamlit.experimental_set_query_params": { + "name": "experimental_set_query_params", + "signature": "st.experimental_set_query_params(**query_params)", + "example": "
\n

To point the user's web browser to something like\n"http://localhost:8501/?show_map=True&selected=asia&selected=america",\nyou would do the following:

\n
\nimport streamlit as st\n\nst.experimental_set_query_params(\n    show_map=True,\n    selected=["asia", "america"],\n)\n
\n
\n", + "description": "

Set the query parameters that are shown in the browser's URL bar.

\n
\n

Warning

\n

Query param embed cannot be set using this method.

\n
\n", + "args": [ + { + "name": "**query_params", + "type_name": "dict", + "is_optional": false, + "description": "

The query parameters to set, as key-value pairs.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/commands/query_params.py#L65" + }, + "streamlit.experimental_show": { + "name": "experimental_show", + "signature": "st.experimental_show(*args)", + "notes": "
\n

This is an experimental feature with usage limitations:

\n
    \n
  • The method must be called with the name show.
  • \n
  • Must be called in one line of code, and only once per line.
  • \n
  • \n
    When passing multiple arguments the inclusion of , or ) in a string
    \n
    argument may cause an error.
    \n
    \n
  • \n
\n
\n", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndataframe = pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n})\nst.experimental_show(dataframe)\n
\n
\n", + "description": "

Write arguments and argument names to your app for debugging purposes.

\n

Show() has similar properties to write():

\n
\n
    \n
  1. You can pass in multiple arguments, all of which will be debugged.
  2. \n
  3. It returns None, so it's "slot" in the app cannot be reused.
  4. \n
\n
\n

Note: This is an experimental feature. See\nhttps://docs.streamlit.io/library/advanced-features/prerelease#experimental for more information.

\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to debug in the App.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/show.py#L23" + }, + "streamlit.experimental_singleton": { + "name": "experimental_singleton", + "signature": "st.experimental_singleton(func, *, ttl, max_entries, show_spinner, validate, experimental_allow_widgets)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(url):\n    # Create a database session object that points to the URL.\n    return session\n\ns1 = get_database_session(SESSION_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(SESSION_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the connection object in s1 is the same as in s2.\n\ns3 = get_database_session(SESSION_URL_2)\n# This is a different URL, so the function executes.\n
\n

By default, all parameters to a cache_resource function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\ns1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _sessionmaker parameter was different\n# in both calls.\n
\n

A cache_resource function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\nget_database_session.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Decorator to cache functions that return global resources (e.g. database connections, ML models).

\n

Cached objects are shared across all users, sessions, and reruns. They\nmust be thread-safe because they can be accessed from multiple threads\nconcurrently. If thread safety is an issue, consider using st.session_state\nto store resources per session instead.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_resource.clear().

\n

To cache data, use st.cache_data instead. Learn more about caching at\nhttps://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function that creates the cached resource. Streamlit hashes the\nfunction's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float or timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.

\n", + "default": "None." + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached resource is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "validate", + "type_name": "callable or None", + "is_optional": false, + "description": "

An optional validation function for cached data. validate is called\neach time the cached value is accessed. It receives the cached value as\nits only parameter and it must return a boolean. If validate returns\nFalse, the current cached value is discarded, and the decorated function\nis called to compute a new value. This is useful e.g. to check the\nhealth of database connections.

\n", + "default": null + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/runtime/caching/cache_resource_api.py#L258" + }, + "streamlit.file_uploader": { + "name": "file_uploader", + "signature": "st.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nimport streamlit as st\nimport pandas as pd\nfrom io import StringIO\n\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nimport streamlit as st\n\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n
\n", + "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this file uploader is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str or list of str or None", + "is_optional": false, + "description": "

Array of allowed extensions. ['png', 'jpg']\nThe default is None, which means all extensions are allowed.

\n", + "default": "None" + }, + { + "name": "accept_multiple_files", + "type_name": "bool", + "is_optional": false, + "description": "

If True, allows the user to upload multiple files at the same time,\nin which case the return value will be a list of files.\nDefault: False

\n", + "default": "False" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the file uploader.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this file_uploader's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the file uploader if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile or list of UploadedFile", + "is_generator": false, + "description": "
    \n
  • If accept_multiple_files is False, returns either None or\nan UploadedFile object.
  • \n
  • If accept_multiple_files is True, returns a list with the\nuploaded files as UploadedFile objects. If no files were\nuploaded, returns an empty list.
  • \n
\n

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/file_uploader.py#L205" + }, + "streamlit.form": { + "name": "form", + "signature": "st.form(key, clear_on_submit=False)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n

Inserting elements out of order:

\n
\nimport streamlit as st\n\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n
\n", + "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

A string that identifies the form. Each form must have its own\nkey. (This key is not displayed to the user in the interface.)

\n", + "default": null + }, + { + "name": "clear_on_submit", + "type_name": "bool", + "is_optional": false, + "description": "

If True, all widgets inside the form will be reset to their default\nvalues after the user presses the Submit button. Defaults to False.\n(Note that Custom Components are unaffected by this flag, and\nwill not be reset to their defaults on form submission.)

\n", + "default": "values" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/form.py#L118" + }, + "streamlit.form_submit_button": { + "name": "form_submit_button", + "signature": "st.form_submit_button(label=\"Submit\", help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nDefaults to "Submit".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

A tooltip that gets displayed when the button is hovered over.\nDefaults to None.

\n", + "default": "None." + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/form.py#L211" + }, + "streamlit.get_option": { + "name": "get_option", + "signature": "st.get_option(key)", + "description": "

Return the current value of a given Streamlit config option.

\n

Run streamlit config show in the terminal to see all available options.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

The config option key of the form "section.optionName". To see all\navailable options, run streamlit config show on a terminal.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/config.py#L131" + }, + "streamlit.graphviz_chart": { + "name": "graphviz_chart", + "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nimport graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n
\n", + "description": "

Display a graph using the dagre-d3 library.

\n", + "args": [ + { + "name": "figure_or_dot", + "type_name": "graphviz.dot.Graph, graphviz.dot.Digraph, str", + "is_optional": false, + "description": "

The Graphlib graph object or dot string to display

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/graphviz_chart.py#L39" + }, + "streamlit.header": { + "name": "header", + "signature": "st.header(body, anchor=None, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.header('This is a header')\nst.header('A header with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in header formatting.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str or False", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the header.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/heading.py#L40" + }, + "streamlit.help": { + "name": "help", + "signature": "st.help(obj=)", + "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nimport streamlit as st\nimport pandas\n\nst.help(pandas.DataFrame)\n
\n\n \n

Want to quickly check what data type is output by a certain function?\nTry:

\n
\nimport streamlit as st\n\nx = my_poorly_documented_function()\nst.help(x)\n
\n

Want to quickly inspect an object? No sweat:

\n
\nclass Dog:\n  '''A typical dog.'''\n\n  def __init__(self, breed, color):\n    self.breed = breed\n    self.color = color\n\n  def bark(self):\n    return 'Woof!'\n\n\nfido = Dog('poodle', 'white')\n\nst.help(fido)\n
\n\n \n

And if you're using Magic, you can get help for functions, classes,\nand modules without even typing st.help:

\n
\nimport streamlit as st\nimport pandas\n\n# Get help for Pandas read_csv:\npandas.read_csv\n\n# Get help for Streamlit itself:\nst\n
\n\n \n
\n", + "description": "

Display help and other information for a given object.

\n

Depending on the type of object that is passed in, this displays the\nobject's name, type, value, signature, docstring, and member variables,\nmethods \u2014 as well as the values/docstring of members and methods.

\n", + "args": [ + { + "name": "obj", + "type_name": "any", + "is_optional": false, + "description": "

The object whose information should be displayed. If left\nunspecified, this call will display help for Streamlit itself.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/doc_string.py#L49" + }, + "streamlit.image": { + "name": "image", + "signature": "st.image(image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", + "example": "
\n
\nimport streamlit as st\nfrom PIL import Image\n\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n
\n", + "description": "

Display an image or list of images.

\n", + "args": [ + { + "name": "image", + "type_name": "numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]", + "is_optional": false, + "description": "

Monochrome image of shape (w,h) or (w,h,1)\nOR a color image of shape (w,h,3)\nOR an RGBA image of shape (w,h,4)\nOR a URL to fetch the image from\nOR a path of a local image file\nOR an SVG XML string like <svg xmlns=...</svg>\nOR a list of one of the above, to display multiple images.

\n", + "default": null + }, + { + "name": "caption", + "type_name": "str or list of str", + "is_optional": false, + "description": "

Image caption. If displaying multiple images, caption should be a\nlist of captions (one for each image).

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Image width. None means use the image width,\nbut do not exceed the width of the column.\nShould be set for SVG images, as they have no default image width.

\n", + "default": "image" + }, + { + "name": "use_column_width", + "type_name": "'auto' or 'always' or 'never' or bool", + "is_optional": false, + "description": "

If 'auto', set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf 'always' or True, set the image's width to the column width.\nIf 'never' or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", + "default": null + }, + { + "name": "clamp", + "type_name": "bool", + "is_optional": false, + "description": "

Clamp image pixel values to a valid range ([0-255] per channel).\nThis is only meaningful for byte array images; the parameter is\nignored for image URLs. If this is not set, and an image has an\nout-of-range value, an error will be thrown.

\n", + "default": null + }, + { + "name": "channels", + "type_name": "'RGB' or 'BGR'", + "is_optional": false, + "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to 'RGB', meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to 'BGR', instead.

\n", + "default": "s" + }, + { + "name": "output_format", + "type_name": "'JPEG', 'PNG', or 'auto'", + "is_optional": false, + "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to 'auto' which identifies the compression type based\non the type and format of the image argument.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/image.py#L88" + }, + "streamlit.info": { + "name": "info", + "signature": "st.info(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", + "description": "

Display an informational message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The info text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/alert.py#L103" + }, + "streamlit.json": { + "name": "json", + "signature": "st.json(body, *, expanded=True)", + "example": "
\n
\nimport streamlit as st\n\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n
\n", + "description": "

Display object or string as a pretty-printed JSON string.

\n", + "args": [ + { + "name": "body", + "type_name": "object or str", + "is_optional": false, + "description": "

The object to print as JSON. All referenced objects should be\nserializable to JSON as well. If object is a string, we assume it\ncontains serialized JSON.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean that allows the user to set whether the initial\nstate of this json element should be expanded. Defaults to True.\nThis argument can only be supplied by keyword.

\n", + "default": "True." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/json.py#L35" + }, + "streamlit.latex": { + "name": "latex", + "signature": "st.latex(body, *, help=None)", + "example": "
\n
\nimport streamlit as st\n\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", + "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", + "args": [ + { + "name": "body", + "type_name": "str or SymPy expression", + "is_optional": false, + "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the LaTeX expression.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/markdown.py#L196" + }, + "streamlit.line_chart": { + "name": "line_chart", + "signature": "st.line_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\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 \n
\n", + "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict or None", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/dataframe_selector.py#L160" + }, + "streamlit.map": { + "name": "map", + "signature": "st.map(data=None, zoom=None, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n
\n", + "description": "

Display a map with points on it.

\n

This is a wrapper around st.pydeck_chart to quickly create\nscatterplot charts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to be plotted. Must have two columns:

\n
    \n
  • latitude called 'lat', 'latitude', 'LAT', 'LATITUDE'
  • \n
  • longitude called 'lon', 'longitude', 'LON', 'LONGITUDE'.
  • \n
\n", + "default": null + }, + { + "name": "zoom", + "type_name": "int", + "is_optional": false, + "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/map.py#L76" + }, + "streamlit.markdown": { + "name": "markdown", + "signature": "st.markdown(body, unsafe_allow_html=False, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.markdown('Streamlit is **_really_ cool**.')\nst.markdown(\u201dThis text is :red[colored red], and this is **:blue[colored]** and bold.\u201d)\nst.markdown(":green[$\\sqrt{x^2+y^2}=1$] is a Pythagorean identity. :pencil:")\n
\n
\n", + "description": "

Display string formatted as Markdown.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the Markdown.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/markdown.py#L31" + }, + "streamlit.metric": { + "name": "metric", + "signature": "st.metric(label, value, delta=None, delta_color=\"normal\", help=None, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n

st.metric looks especially nice in combination with st.columns:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n

The delta indicator color can also be inverted or turned off:

\n
\nimport streamlit as st\n\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n
\n", + "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

The header or title for the metric. The label can optionally contain\nMarkdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Value of the metric. None is rendered as a long dash.

\n", + "default": null + }, + { + "name": "delta", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Indicator of how the metric changed, rendered with an arrow below\nthe metric. If delta is negative (int/float) or starts with a minus\nsign (str), the arrow points down and the text is red; else the\narrow points up and the text is green. If None (default), no delta\nindicator is shown.

\n", + "default": null + }, + { + "name": "delta_color", + "type_name": "str", + "is_optional": false, + "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the metric label.

\n", + "default": null + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/metric.py#L46" + }, + "streamlit.multiselect": { + "name": "multiselect", + "signature": "st.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", max_selections=None)", + "example": "
\n
\nimport streamlit as st\n\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n
\n", + "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence[V], numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "default", + "type_name": "[V], V, or None", + "is_optional": false, + "description": "

List of default values. Can also be a single value.

\n", + "default": "values." + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of selectbox options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe multiselect.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the multiselect.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this multiselect's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the multiselect widget if set\nto True. The default is False. This argument can only be supplied\nby keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "max_selections", + "type_name": "int", + "is_optional": false, + "description": "

The max selections that can be selected at a time.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list", + "is_generator": false, + "description": "

A list with the selected options

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/multiselect.py#L145" + }, + "streamlit.number_input": { + "name": "number_input", + "signature": "st.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n
\n", + "description": "

Display a numeric input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. Output must be purely numeric. This does not impact\nthe return value. Valid formatters: %d %e %f %g %i %u

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this number_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the number input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int or float", + "is_generator": false, + "description": "

The current value of the numeric input widget. The return type\nwill match the data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/number_input.py#L66" + }, + "streamlit.plotly_chart": { + "name": "plotly_chart", + "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", theme=\"streamlit\", **kwargs)", + "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport numpy as np\nimport plotly.figure_factory as ff\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n        hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n
\n", + "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", + "args": [ + { + "name": "figure_or_data", + "type_name": "plotly.graph_objs.Figure, plotly.graph_objs.Data,", + "is_optional": false, + "description": "

dict/list of plotly.graph_objs.Figure/Data

\n

See https://plot.ly/python/ for examples of graph descriptions.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + }, + { + "name": "sharing", + "type_name": "{'streamlit', 'private', 'secret', 'public'}", + "is_optional": false, + "description": "

Use 'streamlit' to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": null, + "is_optional": null, + "description": "

Any argument accepted by Plotly's plot() function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/plotly_chart.py#L81" + }, + "streamlit.progress": { + "name": "progress", + "signature": "st.progress(value, text=None)", + "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport streamlit as st\nimport time\n\nprogress_text = "Operation in progress. Please wait."\nmy_bar = st.progress(0, text=progress_text)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1, text=progress_text)\n
\n
\n", + "description": "

Display a progress bar.

\n", + "args": [ + { + "name": "value", + "type_name": "int or float", + "is_optional": false, + "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", + "default": null + }, + { + "name": "text", + "type_name": "str or None", + "is_optional": false, + "description": "

A message to display above the progress bar. The text can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/progress.py#L66" + }, + "streamlit.pydeck_chart": { + "name": "pydeck_chart", + "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)", + "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport pydeck as pdk\n\nchart_data = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=chart_data,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=chart_data,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", + "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "args": [ + { + "name": "pydeck_obj", + "type_name": "pydeck.Deck or None", + "is_optional": false, + "description": "

Object specifying the PyDeck chart to draw.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/deck_gl_json_chart.py#L36" + }, + "streamlit.pyplot": { + "name": "pyplot", + "signature": "st.pyplot(fig=None, clear_figure=None, use_container_width=True, **kwargs)", + "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", + "example": "
\n
\nimport streamlit as st\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n
\n", + "description": "

Display a matplotlib.pyplot figure.

\n", + "args": [ + { + "name": "fig", + "type_name": "Matplotlib Figure", + "is_optional": false, + "description": "

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

\n", + "default": null + }, + { + "name": "clear_figure", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", + "default": "based" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n", + "default": "s" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Arguments to pass to Matplotlib's savefig function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/pyplot.py#L38" + }, + "streamlit.radio": { + "name": "radio", + "signature": "st.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ngenre = st.radio(\n    "What\\'s your favorite movie genre",\n    ('Comedy', 'Drama', 'Documentary'))\n\nif genre == 'Comedy':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn\\'t select comedy.")\n
\n\n \n
\n", + "description": "

Display a radio button widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this radio group is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the radio options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of radio options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe radio.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the radio.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this radio's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the radio button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "horizontal", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", + "default": "false" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/radio.py#L75" + }, + "streamlit.select_slider": { + "name": "select_slider", + "signature": "st.select_slider(label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\nimport streamlit as st\n\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nimport streamlit as st\n\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n ", + "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the slider options. All options will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", + "default": "." + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to first option.

\n", + "default": "first" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels from the options.\nargument. It receives the option as an argument and its output\nwill be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the select slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this select_slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the select slider if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any value or tuple of any value", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/select_slider.py#L106" + }, + "streamlit.selectbox": { + "name": "selectbox", + "signature": "st.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n
\n", + "description": "

Display a select widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels. It receives the option\nas an argument and its output will be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the selectbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this selectbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the selectbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/selectbox.py#L71" + }, + "streamlit.set_option": { + "name": "set_option", + "signature": "st.set_option(key, value)", + "description": "

Set config option.

\n
\n
Currently, only the following config options can be set within the script itself:
\n
    \n
  • client.caching
  • \n
  • client.displayEnabled
  • \n
  • deprecation.*
  • \n
\n
\n
\n

Calling with any other options will raise StreamlitAPIException.

\n

Run streamlit config show in the terminal to see all available options.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

The config option key of the form "section.optionName". To see all\navailable options, run streamlit config show on a terminal.

\n", + "default": null + }, + { + "name": "value", + "type_name": null, + "is_optional": null, + "description": "

The new value to assign to this config option.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/config.py#L92" + }, + "streamlit.set_page_config": { + "name": "set_page_config", + "signature": "st.set_page_config(page_title=None, page_icon=None, layout=\"centered\", initial_sidebar_state=\"auto\", menu_items=None)", + "example": "
\nimport streamlit as st\n\nst.set_page_config(\n    page_title="Ex-stream-ly Cool App",\n    page_icon="\ud83e\uddca",\n    layout="wide",\n    initial_sidebar_state="expanded",\n    menu_items={\n        'Get Help': 'https://www.extremelycoolapp.com/help',\n        'Report a bug': "https://www.extremelycoolapp.com/bug",\n        'About': "# This is a header. This is an *extremely* cool app!"\n    }\n)\n
\n", + "description": "

Configures the default settings of the page.

\n
\n

Note

\n

This must be the first Streamlit command used in your app, and must only\nbe set once.

\n
\n", + "args": [ + { + "name": "page_title", + "type_name": "str or None", + "is_optional": false, + "description": "

The page title, shown in the browser tab. If None, defaults to the\nfilename of the script ("app.py" would show "app \u2022 Streamlit").

\n", + "default": "the" + }, + { + "name": "page_icon", + "type_name": "Anything supported by st.image or str or None", + "is_optional": false, + "description": "

The page favicon.\nBesides the types supported by st.image (like URLs or numpy arrays),\nyou can pass in an emoji as a string ("\ud83e\udd88") or a shortcode (":shark:").\nIf you're feeling lucky, try "random" for a random emoji!\nEmoji icons are courtesy of Twemoji and loaded from MaxCDN.

\n", + "default": null + }, + { + "name": "layout", + "type_name": "\"centered\" or \"wide\"", + "is_optional": false, + "description": "

How the page content should be laid out. Defaults to "centered",\nwhich constrains the elements into a centered column of fixed width;\n"wide" uses the entire screen.

\n", + "default": "s" + }, + { + "name": "initial_sidebar_state", + "type_name": "\"auto\" or \"expanded\" or \"collapsed\"", + "is_optional": false, + "description": "

How the sidebar should start out. Defaults to "auto",\nwhich hides the sidebar on mobile-sized devices, and shows it otherwise.\n"expanded" shows the sidebar initially; "collapsed" hides it.

\n", + "default": "s" + }, + { + "name": "menu_items", + "type_name": "dict", + "is_optional": false, + "description": "

Configure the menu that appears on the top-right side of this app.\nThe keys in this dict denote the menu item you'd like to configure:

\n
    \n
  • \n
    "Get help": str or None
    \n
    The URL this menu item should point to.\nIf None, hides this menu item.
    \n
    \n
  • \n
  • \n
    "Report a Bug": str or None
    \n
    The URL this menu item should point to.\nIf None, hides this menu item.
    \n
    \n
  • \n
  • \n
    "About": str or None
    \n
    A markdown string to show in the About dialog.\nIf None, only shows Streamlit's default About text.
    \n
    \n
  • \n
\n

The URL may also refer to an email address e.g. mailto:john@example.com.

\n", + "default": "About" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/commands/page_config.py#L114" + }, + "streamlit.slider": { + "name": "slider", + "signature": "st.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nimport streamlit as st\n\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nimport streamlit as st\nfrom datetime import time\n\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nimport streamlit as st\nfrom datetime import datetime\n\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n
\n", + "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The minimum permitted value.\nDefaults to 0 if the value is an int, 0.0 if a float,\nvalue - timedelta(days=14) if a date/datetime, time.min if a time

\n", + "default": "0" + }, + { + "name": "max_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The maximum permitted value.\nDefaults to 100 if the value is an int, 1.0 if a float,\nvalue + timedelta(days=14) if a date/datetime, time.max if a time

\n", + "default": "100" + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to min_value.

\n", + "default": "min_value." + }, + { + "name": "step", + "type_name": "int/float/timedelta or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. This does not impact the return value.\nFormatter for int/float supports: %d %e %f %g %i\nFormatter for date/time/datetime uses Moment.js notation:\nhttps://momentjs.com/docs/#/displaying/format/

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the slider if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int/float/date/time/datetime or tuple of int/float/date/time/datetime", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/slider.py#L171" + }, + "streamlit.snow": { + "name": "snow", + "signature": "st.snow()", + "example": "
\n
\nimport streamlit as st\n\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", + "description": "

Draw celebratory snowfall.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/snow.py#L25" + }, + "streamlit.spinner": { + "name": "spinner", + "signature": "st.spinner(text=\"In progress...\")", + "example": "
\n
\nimport time\nimport streamlit as st\n\nwith st.spinner('Wait for it...'):\n    time.sleep(5)\nst.success('Done!')\n
\n
\n", + "description": "

Temporarily displays a message while executing a block of code.

\n", + "args": [ + { + "name": "text", + "type_name": "str", + "is_optional": false, + "description": "

A message to display while executing that block

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/spinner.py#L23" + }, + "streamlit.stop": { + "name": "stop", + "signature": "st.stop()", + "example": "
\n
\nimport streamlit as st\n\nname = st.text_input('Name')\nif not name:\n  st.warning('Please input a name.')\n  st.stop()\nst.success('Thank you for inputting a name.')\n
\n
\n", + "description": "

Stops execution immediately.

\n

Streamlit will not run any statements after st.stop().\nWe recommend rendering a message to explain why the script has stopped.\nWhen run outside of Streamlit, this will raise an Exception.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/commands/execution_control.py#L25" + }, + "streamlit.subheader": { + "name": "subheader", + "signature": "st.subheader(body, anchor=None, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.subheader('This is a subheader')\nst.subheader('A subheader with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in subheader formatting.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str or False", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the subheader.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/heading.py#L93" + }, + "streamlit.success": { + "name": "success", + "signature": "st.success(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", + "description": "

Display a success message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The success text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/alert.py#L136" + }, + "streamlit.table": { + "name": "table", + "signature": "st.table(data=None)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n
\n", + "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/dataframe_selector.py#L122" + }, + "streamlit.tabs": { + "name": "tabs", + "signature": "st.tabs(tabs)", + "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\nimport streamlit as st\n\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n
\n", + "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", + "args": [ + { + "name": "tabs", + "type_name": "list of strings", + "is_optional": false, + "description": "

Creates a tab for each string in the list. The first tab is selected by default.\nThe string is used as the name of the tab and can optionally contain Markdown,\nsupporting the following elements: Bold, Italics, Strikethroughs, Inline Code,\nEmojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": "." + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/layouts.py#L208" + }, + "streamlit.text": { + "name": "text", + "signature": "st.text(body, *, help=None)", + "example": "
\n
\nimport streamlit as st\n\nst.text('This is some text.')\n
\n
\n", + "description": "

Write fixed-width and preformatted text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the text.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/text.py#L27" + }, + "streamlit.text_area": { + "name": "text_area", + "signature": "st.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", + "description": "

Display a multi-line text input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Maximum number of characters allowed in text area.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the textarea.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_area's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text area is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text area if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/text_widgets.py#L274" + }, + "streamlit.text_input": { + "name": "text_input", + "signature": "st.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n
\n", + "description": "

Display a single-line text input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Max number of characters allowed in text input.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"default\" or \"password\"", + "is_optional": false, + "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "autocomplete", + "type_name": "str", + "is_optional": false, + "description": "

An optional value that will be passed to the <input> element's\nautocomplete property. If unspecified, this value will be set to\n"new-password" for "password" inputs, and the empty string for\n"default" inputs. For more details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text input is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/text_widgets.py#L71" + }, + "streamlit.time_input": { + "name": "time_input", + "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", step=0:15:00)", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n
\n", + "description": "

Display a time input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this time input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.time/datetime.datetime", + "is_optional": false, + "description": "

The value of this widget when it first renders. This will be\ncast to str internally. Defaults to the current time.

\n", + "default": "the" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this time_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the time input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "step", + "type_name": "int or timedelta", + "is_optional": false, + "description": "

The stepping interval in seconds. Defaults to 900, i.e. 15 minutes.\nYou can also pass a datetime.timedelta object.

\n", + "default": "900" + } + ], + "returns": [ + { + "type_name": "datetime.time", + "is_generator": false, + "description": "

The current value of the time input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/time_widgets.py#L214" + }, + "streamlit.title": { + "name": "title", + "signature": "st.title(body, anchor=None, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.title('This is a title')\nst.title('A title with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str or False", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the title.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/heading.py#L146" + }, + "streamlit.vega_lite_chart": { + "name": "vega_lite_chart", + "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, theme=\"streamlit\", **kwargs)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(chart_data, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", + "description": "

Display a chart using the Vega-Lite library.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "spec", + "type_name": "dict or None", + "is_optional": false, + "description": "

The Vega-Lite spec for the chart. If the spec was already passed in\nthe previous argument, this must be set to None. See\nhttps://vega.github.io/vega-lite/docs/ for more info.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Same as spec, but as keywords.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/dataframe_selector.py#L475" + }, + "streamlit.video": { + "name": "video", + "signature": "st.video(data, format=\"video/mp4\", start_time=0)", + "example": "
\n
\nimport streamlit as st\n\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", + "description": "

Display a video player.

\n", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "default": null + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the video file. Defaults to 'video/mp4'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/media.py#L117" + }, + "streamlit.warning": { + "name": "warning", + "signature": "st.warning(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", + "description": "

Display warning message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The warning text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/alert.py#L71" + }, + "streamlit.write": { + "name": "write", + "signature": "st.write(*args, unsafe_allow_html=False, **kwargs)", + "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nimport streamlit as st\n\nst.write('Hello, *World!* :sunglasses:')\n
\n\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nimport streamlit as st\nimport pandas as pd\n\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nimport streamlit as st\n\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n
\n", + "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression, emoji shortcodes, and colored text.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(class) : Displays information about a class.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/write.py#L48" + }, + "streamlit.experimental_memo.clear": { + "name": "experimental_memo.clear", + "signature": "st.experimental_memo.clear()", + "description": "

Clear all in-memory and on-disk data caches.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/runtime/caching/cache_data_api.py#L541" + }, + "streamlit.cache_data.clear": { + "name": "cache_data.clear", + "signature": "st.cache_data.clear()", + "description": "

Clear all in-memory and on-disk data caches.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/runtime/caching/cache_data_api.py#L541" + }, + "streamlit.experimental_singleton.clear": { + "name": "experimental_singleton.clear", + "signature": "st.experimental_singleton.clear()", + "description": "

Clear all cache_resource caches.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/runtime/caching/cache_resource_api.py#L396" + }, + "streamlit.cache_resource.clear": { + "name": "cache_resource.clear", + "signature": "st.cache_resource.clear()", + "description": "

Clear all cache_resource caches.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/runtime/caching/cache_resource_api.py#L396" + }, + "streamlit.connections.ExperimentalBaseConnection": { + "name": "ExperimentalBaseConnection", + "signature": "st.connections.ExperimentalBaseConnection(connection_name, **kwargs)", + "is_class": true, + "methods": [ + { + "name": "reset", + "signature": "st.connections.reset.reset()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", + "description": "

Reset this connection so that it gets reinitialized the next time it's used.

", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/connections/base_connection.py#L137" + } + ], + "properties": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/connections/base_connection.py#L25", + "description": "

The abstract base class that all Streamlit Connections must inherit from.

\n

This base class provides connection authors with a standardized way to hook into the\nst.experimental_connection() factory function: connection authors are required to\nprovide an implementation for the abstract method _connect in their subclasses.

\n

Additionally, it also provides a few methods/properties designed to make\nimplementation of connections more convenient. See the docstrings for each of the\nmethods of this class for more information

\n
\n

Note

\n

While providing an implementation of _connect is technically all that's\nrequired to define a valid connection, connections should also provide the user\nwith context-specific ways of interacting with the underlying connection object.\nFor example, the first-party SQLConnection provides a query() method for\nreads and a session property for more complex operations.

\n
\n", + "args": [], + "returns": [] + }, + "streamlit.connections.SQLConnection": { + "name": "SQLConnection", + "signature": "st.connections.SQLConnection(connection_name, **kwargs)", + "is_class": true, + "methods": [ + { + "name": "query", + "signature": "st.connections.query.query(sql, *, ttl=None, index_col=None, chunksize=None, params=None, **kwargs)", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("sql")\ndf = conn.query("select * from pet_owners where owner = :owner", ttl=3600, params={"owner":"barbara"})\nst.dataframe(df)\n
\n
\n", + "description": "

Run a read-only query.

", + "args": [ + { + "name": "sql", + "type_name": "str", + "is_optional": false, + "description": "

The read-only SQL query to execute.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float, int, timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep results in the cache, or\nNone if cached results should not expire. The default is None.

\n", + "default": "None." + }, + { + "name": "index_col", + "type_name": "str, list of str, or None", + "is_optional": false, + "description": "

Column(s) to set as index(MultiIndex). Default is None.

\n", + "default": "None." + }, + { + "name": "chunksize", + "type_name": "int or None", + "is_optional": false, + "description": "

If specified, return an iterator where chunksize is the number of\nrows to include in each chunk. Default is None.

\n", + "default": "None." + }, + { + "name": "params", + "type_name": "list, tuple, dict or None", + "is_optional": false, + "description": "

List of parameters to pass to the execute method. The syntax used to pass\nparameters is database driver dependent. Check your database driver\ndocumentation for which of the five syntax styles, described in PEP 249\nparamstyle, is supported.\nDefault is None.

\n", + "default": "None." + }, + { + "name": "**kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

Additional keyword arguments are passed to pd.read_sql.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "pd.DataFrame", + "is_generator": false, + "description": "

The result of running the query, formatted as a pandas DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/connections/sql_connection.py#L121" + }, + { + "name": "reset", + "signature": "st.connections.reset.reset()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", + "description": "

Reset this connection so that it gets reinitialized the next time it's used.

", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/connections/base_connection.py#L137" + } + ], + "properties": [ + { + "name": "session", + "signature": "st.connections.session.session", + "example": "
\n
\nimport streamlit as st\nconn = st.experimental_connection("sql")\nn = st.slider("Pick a number")\nif st.button("Add the number!"):\n    with conn.session as session:\n        session.execute("INSERT INTO numbers (val) VALUES (:n);", {"n": n})\n        session.commit()\n
\n
\n", + "description": "

Return a SQLAlchemy Session.

", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/connections/sql_connection.py#L226" + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/connections/sql_connection.py#L45", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("sql")\ndf = conn.query("select * from pet_owners")\nst.dataframe(df)\n
\n
\n", + "description": "

A connection to a SQL database using a SQLAlchemy Engine. Initialize using st.experimental_connection("<name>", type="sql").

\n

SQLConnection provides the query() convenience method, which can be used to\nrun simple read-only queries with both caching and simple error handling/retries.\nMore complex DB interactions can be performed by using the .session property\nto receive a regular SQLAlchemy Session.

\n

SQLConnections should always be created using st.experimental_connection(),\nnot initialized directly. Connection parameters for a SQLConnection can be\nspecified using either st.secrets or **kwargs. Some frequently used\nparameters include:

\n
    \n
  • url or arguments for sqlalchemy.engine.URL.create().\nMost commonly it includes a dialect, host, database, username and password.
  • \n
  • create_engine_kwargs can be passed via st.secrets, such as for\nsnowflake-sqlalchemy\nor Google BigQuery.\nThese can also be passed directly as **kwargs to experimental_connection().
  • \n
  • autocommit=True to run with isolation level AUTOCOMMIT. Default is False.
  • \n
\n", + "args": [], + "returns": [] + }, + "streamlit.connections.SnowparkConnection": { + "name": "SnowparkConnection", + "signature": "st.connections.SnowparkConnection(connection_name, **kwargs)", + "is_class": true, + "methods": [ + { + "name": "query", + "signature": "st.connections.query.query(sql, ttl=None)", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("snowpark")\ndf = conn.query("select * from pet_owners")\nst.dataframe(df)\n
\n
\n", + "description": "

Run a read-only SQL query.

", + "args": [ + { + "name": "sql", + "type_name": "str", + "is_optional": false, + "description": "

The read-only SQL query to execute.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float, int, timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep results in the cache, or\nNone if cached results should not expire. The default is None.

\n", + "default": "None." + } + ], + "returns": [ + { + "type_name": "pd.DataFrame", + "is_generator": false, + "description": "

The result of running the query, formatted as a pandas DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/connections/snowpark_connection.py#L123" + }, + { + "name": "reset", + "signature": "st.connections.reset.reset()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", + "description": "

Reset this connection so that it gets reinitialized the next time it's used.

", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/connections/base_connection.py#L137" + }, + { + "name": "safe_session", + "signature": "st.connections.safe_session.safe_session()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("snowpark")\nwith conn.safe_session() as session:\n    df = session.table("mytable").limit(10).to_pandas()\n\nst.dataframe(df)\n
\n
\n", + "description": "

Grab the underlying Snowpark session in a thread-safe manner.

", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/connections/snowpark_connection.py#L207" + } + ], + "properties": [ + { + "name": "session", + "signature": "st.connections.session.session", + "example": "
\n
\nimport streamlit as st\n\nsession = st.experimental_connection("snowpark").session\ndf = session.table("mytable").limit(10).to_pandas()\nst.dataframe(df)\n
\n
\n", + "description": "

Access the underlying Snowpark session.

", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/connections/snowpark_connection.py#L184" + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/connections/snowpark_connection.py#L70", + "description": "

A connection to Snowpark using snowflake.snowpark.session.Session. Initialize using

\n

st.experimental_connection("<name>", type="snowpark").

\n

In addition to accessing the Snowpark Session, SnowparkConnection supports direct SQL querying using\nquery("...") and thread safe access using with conn.safe_session():. See methods\nbelow for more information. SnowparkConnections should always be created using\nst.experimental_connection(), not initialized directly.

\n
\n

Note

\n

We don't expect this iteration of SnowparkConnection to be able to scale\nwell in apps with many concurrent users due to the lock contention that will occur\nover the single underlying Session object under high load.

\n
\n", + "args": [], + "returns": [] + }, + "streamlit.connections.SQLConnection.query": { + "name": "query", + "signature": "SQLConnection.query(sql, *, ttl=None, index_col=None, chunksize=None, params=None, **kwargs)", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("sql")\ndf = conn.query("select * from pet_owners where owner = :owner", ttl=3600, params={"owner":"barbara"})\nst.dataframe(df)\n
\n
\n", + "description": "

Run a read-only query.

\n

This method implements both query result caching (with caching behavior\nidentical to that of using @st.cache_data) as well as simple error handling/retries.

\n
\n

Note

\n

Queries that are run without a specified ttl are cached indefinitely.

\n
\n

Aside from the ttl kwarg, all kwargs passed to this function are passed down\nto pd.read_sql\nand have the behavior described in the pandas documentation.

\n", + "args": [ + { + "name": "sql", + "type_name": "str", + "is_optional": false, + "description": "

The read-only SQL query to execute.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float, int, timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep results in the cache, or\nNone if cached results should not expire. The default is None.

\n", + "default": "None." + }, + { + "name": "index_col", + "type_name": "str, list of str, or None", + "is_optional": false, + "description": "

Column(s) to set as index(MultiIndex). Default is None.

\n", + "default": "None." + }, + { + "name": "chunksize", + "type_name": "int or None", + "is_optional": false, + "description": "

If specified, return an iterator where chunksize is the number of\nrows to include in each chunk. Default is None.

\n", + "default": "None." + }, + { + "name": "params", + "type_name": "list, tuple, dict or None", + "is_optional": false, + "description": "

List of parameters to pass to the execute method. The syntax used to pass\nparameters is database driver dependent. Check your database driver\ndocumentation for which of the five syntax styles, described in PEP 249\nparamstyle, is supported.\nDefault is None.

\n", + "default": "None." + }, + { + "name": "**kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

Additional keyword arguments are passed to pd.read_sql.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "pd.DataFrame", + "is_generator": false, + "description": "

The result of running the query, formatted as a pandas DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/connections/sql_connection.py#L121" + }, + "streamlit.connections.SQLConnection.reset": { + "name": "reset", + "signature": "SQLConnection.reset()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", + "description": "

Reset this connection so that it gets reinitialized the next time it's used.

\n

This method can be useful when a connection has become stale, an auth token has\nexpired, or in similar scenarios where a broken connection might be fixed by\nreinitializing it. Note that some connection methods may already use reset()\nin their error handling code.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/connections/base_connection.py#L137" + }, + "streamlit.connections.SQLConnection.session": { + "name": "session", + "signature": "SQLConnection.session", + "example": "
\n
\nimport streamlit as st\nconn = st.experimental_connection("sql")\nn = st.slider("Pick a number")\nif st.button("Add the number!"):\n    with conn.session as session:\n        session.execute("INSERT INTO numbers (val) VALUES (:n);", {"n": n})\n        session.commit()\n
\n
\n", + "description": "

Return a SQLAlchemy Session.

\n

Users of this connection should use the contextmanager pattern for writes,\ntransactions, and anything more complex than simple read queries.

\n

See the usage example below, which assumes we have a table numbers with a\nsingle integer column val. The SQLAlchemy docs also contain\nmuch more information on the usage of sessions.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/connections/sql_connection.py#L226" + }, + "streamlit.connections.SnowparkConnection.query": { + "name": "query", + "signature": "SnowparkConnection.query(sql, ttl=None)", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("snowpark")\ndf = conn.query("select * from pet_owners")\nst.dataframe(df)\n
\n
\n", + "description": "

Run a read-only SQL query.

\n

This method implements both query result caching (with caching behavior\nidentical to that of using @st.cache_data) as well as simple error handling/retries.

\n
\n

Note

\n

Queries that are run without a specified ttl are cached indefinitely.

\n
\n", + "args": [ + { + "name": "sql", + "type_name": "str", + "is_optional": false, + "description": "

The read-only SQL query to execute.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float, int, timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep results in the cache, or\nNone if cached results should not expire. The default is None.

\n", + "default": "None." + } + ], + "returns": [ + { + "type_name": "pd.DataFrame", + "is_generator": false, + "description": "

The result of running the query, formatted as a pandas DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/connections/snowpark_connection.py#L123" + }, + "streamlit.connections.SnowparkConnection.reset": { + "name": "reset", + "signature": "SnowparkConnection.reset()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", + "description": "

Reset this connection so that it gets reinitialized the next time it's used.

\n

This method can be useful when a connection has become stale, an auth token has\nexpired, or in similar scenarios where a broken connection might be fixed by\nreinitializing it. Note that some connection methods may already use reset()\nin their error handling code.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/connections/base_connection.py#L137" + }, + "streamlit.connections.SnowparkConnection.safe_session": { + "name": "safe_session", + "signature": "SnowparkConnection.safe_session()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("snowpark")\nwith conn.safe_session() as session:\n    df = session.table("mytable").limit(10).to_pandas()\n\nst.dataframe(df)\n
\n
\n", + "description": "

Grab the underlying Snowpark session in a thread-safe manner.

\n

As operations on a Snowpark session are not thread safe, we need to take care\nwhen using a session in the context of a Streamlit app where each script run\noccurs in its own thread. Using the contextmanager pattern to do this ensures\nthat access on this connection's underlying Session is done in a thread-safe\nmanner.

\n

Information on how to use Snowpark sessions can be found in the Snowpark documentation.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/connections/snowpark_connection.py#L207" + }, + "streamlit.connections.SnowparkConnection.session": { + "name": "session", + "signature": "SnowparkConnection.session", + "example": "
\n
\nimport streamlit as st\n\nsession = st.experimental_connection("snowpark").session\ndf = session.table("mytable").limit(10).to_pandas()\nst.dataframe(df)\n
\n
\n", + "description": "

Access the underlying Snowpark session.

\n
\n

Note

\n

Snowpark sessions are not thread safe. Users of this method are\nresponsible for ensuring that access to the session returned by this method is\ndone in a thread-safe manner. For most users, we recommend using the thread-safe\nsafe_session() method and a with block.

\n
\n

Information on how to use Snowpark sessions can be found in the Snowpark documentation.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/connections/snowpark_connection.py#L184" + }, + "streamlit.connections.ExperimentalBaseConnection.reset": { + "name": "reset", + "signature": "ExperimentalBaseConnection.reset()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", + "description": "

Reset this connection so that it gets reinitialized the next time it's used.

\n

This method can be useful when a connection has become stale, an auth token has\nexpired, or in similar scenarios where a broken connection might be fixed by\nreinitializing it. Note that some connection methods may already use reset()\nin their error handling code.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/connections/base_connection.py#L137" + }, + "streamlit.components.v1.declare_component": { + "name": "declare_component", + "signature": "st.components.v1.declare_component(name, path=None, url=None)", + "description": "

Create and register a custom component.

\n", + "args": [ + { + "name": "name", + "type_name": "str", + "is_optional": false, + "description": "

A short, descriptive name for the component. Like, "slider".

\n", + "default": null + }, + { + "name": "path", + "type_name": "str or None", + "is_optional": false, + "description": "

The path to serve the component's frontend files from. Either\npath or url must be specified, but not both.

\n", + "default": null + }, + { + "name": "url", + "type_name": "str or None", + "is_optional": false, + "description": "

The URL that the component is served from. Either path or url\nmust be specified, but not both.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "CustomComponent", + "is_generator": false, + "description": "

A CustomComponent that can be called like a function.\nCalling the component will create a new instance of the component\nin the Streamlit app.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/components/v1/components.py#L246" + }, + "streamlit.components.v1.html": { + "name": "html", + "signature": "st.components.v1.html(html, width=None, height=None, scrolling=False)", + "description": "

Display an HTML string in an iframe.

\n", + "args": [ + { + "name": "html", + "type_name": "str", + "is_optional": false, + "description": "

The HTML string to embed in the iframe.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", + "default": "the" + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", + "default": "150." + }, + { + "name": "scrolling", + "type_name": "bool", + "is_optional": false, + "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/iframe.py#L59" + }, + "streamlit.components.v1.iframe": { + "name": "iframe", + "signature": "st.components.v1.iframe(src, width=None, height=None, scrolling=False)", + "description": "

Load a remote URL in an iframe.

\n", + "args": [ + { + "name": "src", + "type_name": "str", + "is_optional": false, + "description": "

The URL of the page to embed.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", + "default": "the" + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", + "default": "150." + }, + { + "name": "scrolling", + "type_name": "bool", + "is_optional": false, + "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/iframe.py#L25" + }, + "DeltaGenerator.add_rows": { + "name": "add_rows", + "signature": "element.add_rows(data=None, **kwargs)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf1 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table = st.table(df1)\n\ndf2 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table.add_rows(df2)\n# Now the table shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

You can do the same thing with plots. For example, if you want to add\nmore data to a line chart:

\n
\n# Assuming df1 and df2 from the example above still exist...\nmy_chart = st.line_chart(df1)\nmy_chart.add_rows(df2)\n# Now the chart shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

And for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:

\n
\nmy_chart = st.vega_lite_chart({\n    'mark': 'line',\n    'encoding': {'x': 'a', 'y': 'b'},\n    'datasets': {\n      'some_fancy_name': df1,  # <-- named dataset\n     },\n    'data': {'name': 'some_fancy_name'},\n}),\nmy_chart.add_rows(some_fancy_name=df2)  # <-- name used as keyword\n
\n
\n", + "description": "

Concatenate a dataframe to the bottom of the current one.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, Iterable, dict, or None", + "is_optional": false, + "description": "

Table to concat. Optional.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "**kwargs", + "type_name": "pandas.DataFrame, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

The named dataset to concat. Optional. You can only pass in 1\ndataset (including the one in the data parameter).

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/dataframe_selector.py#L550" + }, + "DeltaGenerator.altair_chart": { + "name": "altair_chart", + "signature": "element.altair_chart(altair_chart, use_container_width=False, theme=\"streamlit\")", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(chart_data).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n
\n", + "description": "

Display a chart using the Altair library.

\n", + "args": [ + { + "name": "altair_chart", + "type_name": "altair.vegalite.v2.api.Chart", + "is_optional": false, + "description": "

The Altair chart object to display.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/dataframe_selector.py#L422" + }, + "DeltaGenerator.area_chart": { + "name": "area_chart", + "signature": "element.area_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n
\n", + "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/dataframe_selector.py#L247" + }, + "DeltaGenerator.audio": { + "name": "audio", + "signature": "element.audio(data, format=\"audio/wav\", start_time=0, *, sample_rate=None)", + "example": "
\n
\nimport streamlit as st\nimport numpy as np\n\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n\nsample_rate = 44100  # 44100 samples per second\nseconds = 2  # Note duration of 2 seconds\nfrequency_la = 440  # Our played note will be 440 Hz\n# Generate array with seconds*sample_rate steps, ranging between 0 and seconds\nt = np.linspace(0, seconds, seconds * sample_rate, False)\n# Generate a 440 Hz sine wave\nnote_la = np.sin(frequency_la * t * 2 * np.pi)\n\nst.audio(note_la, sample_rate=sample_rate)\n
\n\n \n
\n", + "description": "

Display an audio player.

\n", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw audio data, filename, or a URL pointing to the file to load.\nRaw data formats must include all necessary file headers to match the file\nformat specified via format.\nIf data is a numpy array, it must either be a 1D array of the waveform\nor a 2D array of shape (num_channels, num_samples) with waveforms\nfor all channels. See the default channel order at\nhttp://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx

\n", + "default": "channel" + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + }, + { + "name": "sample_rate", + "type_name": "int or None", + "is_optional": false, + "description": "

The sample rate of the audio data in samples per second. Only required if\ndata is a numpy array.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/media.py#L43" + }, + "DeltaGenerator.balloons": { + "name": "balloons", + "signature": "element.balloons()", + "example": "
\n
\nimport streamlit as st\n\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", + "description": "

Draw celebratory balloons.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/balloons.py#L25" + }, + "DeltaGenerator.bar_chart": { + "name": "bar_chart", + "signature": "element.bar_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n
\n", + "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/dataframe_selector.py#L334" + }, + "DeltaGenerator.beta_columns": { + "name": "beta_columns", + "signature": "element.beta_columns(spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/layouts.py#L77" + }, + "DeltaGenerator.beta_container": { + "name": "beta_container", + "signature": "element.beta_container()", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/layouts.py#L29" + }, + "DeltaGenerator.beta_expander": { + "name": "beta_expander", + "signature": "element.beta_expander(label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/layouts.py#L320" + }, + "DeltaGenerator.bokeh_chart": { + "name": "bokeh_chart", + "signature": "element.bokeh_chart(figure, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n
\n", + "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", + "args": [ + { + "name": "figure", + "type_name": "bokeh.plotting.figure.Figure", + "is_optional": false, + "description": "

A Bokeh figure to plot.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Bokeh's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/bokeh_chart.py#L36" + }, + "DeltaGenerator.button": { + "name": "button", + "signature": "element.button(label, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\n\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n
\n", + "description": "

Display a button widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/button.py#L61" + }, + "DeltaGenerator.camera_input": { + "name": "camera_input", + "signature": "element.camera_input(label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", + "description": "

Display a widget that returns pictures from the user's webcam.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this widget is used for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the camera input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this camera_input's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile", + "is_generator": false, + "description": "

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/camera_input.py#L109" + }, + "DeltaGenerator.caption": { + "name": "caption", + "signature": "element.caption(body, unsafe_allow_html=False, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.caption('This is a string that explains something above.')\nst.caption('A caption with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the caption.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/markdown.py#L132" + }, + "DeltaGenerator.checkbox": { + "name": "checkbox", + "signature": "element.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n
\n", + "description": "

Display a checkbox widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this checkbox is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "value", + "type_name": "bool", + "is_optional": false, + "description": "

Preselect the checkbox when it first renders. This will be\ncast to bool internally.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the checkbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this checkbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

Whether or not the checkbox is checked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/checkbox.py#L52" + }, + "DeltaGenerator.code": { + "name": "code", + "signature": "element.code(body, language=\"python\", line_numbers=False)", + "example": "
\n
\nimport streamlit as st\n\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", + "description": "

Display a code block with optional syntax highlighting.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as code.

\n", + "default": null + }, + { + "name": "language", + "type_name": "str or None", + "is_optional": false, + "description": "

The language that the code is written in, for syntax highlighting.\nIf None, the code will be unstyled. Defaults to "python".

\n

For a list of available language values, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", + "default": "s" + }, + { + "name": "line_numbers", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean indicating whether to show line numbers to the\nleft of the code block. Defaults to False.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/code.py#L27" + }, + "DeltaGenerator.color_picker": { + "name": "color_picker", + "signature": "element.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n
\n", + "description": "

Display a color picker widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "str", + "is_optional": false, + "description": "

The hex value of this widget when it first renders. If None,\ndefaults to black.

\n", + "default": "black." + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the color picker.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this color_picker's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The selected color as a hex string.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/color_picker.py#L52" + }, + "DeltaGenerator.columns": { + "name": "columns", + "signature": "element.columns(spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or list of numbers", + "is_optional": false, + "description": "
\n
If an int
\n
Specifies the number of columns to insert, and all columns\nhave equal width.
\n
If a list of numbers
\n

Creates a column for each number, and each\ncolumn's width is proportional to the number provided. Numbers can\nbe ints or floats, but they must be positive.

\n

For example, st.columns([3, 1, 2]) creates 3 columns where\nthe first column is 3 times the width of the second, and the last\ncolumn is 2 times that width.

\n
\n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "string (\"small\", \"medium\", or \"large\")", + "is_optional": false, + "description": "

An optional string, which indicates the size of the gap between each column.\nThe default is a small gap between columns. This argument can only be supplied by\nkeyword.

\n", + "default": "a" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/layouts.py#L77" + }, + "DeltaGenerator.container": { + "name": "container", + "signature": "element.container()", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/layouts.py#L29" + }, + "DeltaGenerator.dataframe": { + "name": "dataframe", + "signature": "element.dataframe(data=None, width=None, height=None, *, use_container_width=False)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n
\nst.dataframe(df, 200, 100)\n
\n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n
\n", + "description": "

Display a dataframe as an interactive table.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. (It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.)\nStyler support is experimental!\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the dataframe expressed in pixels. If None, the width\nwill be automatically calculated based on the column content.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the dataframe expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the dataframe width to the width of the parent container.\nThis takes precedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/dataframe_selector.py#L40" + }, + "DeltaGenerator.date_input": { + "name": "date_input", + "signature": "element.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nd = st.date_input(\n    "When\\'s your birthday",\n    datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n
\n", + "description": "

Display a date input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this date input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", + "is_optional": false, + "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", + "default": "today" + }, + { + "name": "min_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", + "default": "value" + }, + { + "name": "max_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", + "default": "value" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this date_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.date or a tuple with 0-2 dates", + "is_generator": false, + "description": "

The current value of the date input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/time_widgets.py#L399" + }, + "DeltaGenerator.dg": { + "name": "dg", + "signature": "element.dg", + "description": "

Get our DeltaGenerator.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/alert.py#L168" + }, + "DeltaGenerator.divider": { + "name": "divider", + "signature": "element.divider()", + "example": "
\n
\nimport streamlit as st\n\nst.divider()\n
\n
\n", + "description": "

Display a horizontal rule.

\n
\n

Note

\n

You can achieve the same effect with st.write("---") or\neven just "---" in your script (via magic).

\n
\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/markdown.py#L244" + }, + "DeltaGenerator.download_button": { + "name": "download_button", + "signature": "element.download_button(label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False, use_container_width=False)", + "examples": "
\n

Download a large DataFrame as a CSV:

\n
\nimport streamlit as st\n\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\nimport streamlit as st\n\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nimport streamlit as st\n\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nimport streamlit as st\n\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n
\n", + "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "data", + "type_name": "str or bytes or file", + "is_optional": false, + "description": "

The contents of the file to be downloaded. See example below for\ncaching techniques to avoid recomputing this data unnecessarily.

\n", + "default": null + }, + { + "name": "file_name", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the name of the file to be downloaded,\nsuch as 'my_file.csv'. If not specified, the name will be\nautomatically generated.

\n", + "default": null + }, + { + "name": "mime", + "type_name": "str or None", + "is_optional": false, + "description": "

The MIME type of the data. If None, defaults to "text/plain"\n(if data is of type str or is a textual file) or\n"application/octet-stream" (if data is of type bytes or is a\nbinary file).

\n", + "default": "s" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/button.py#L169" + }, + "DeltaGenerator.empty": { + "name": "empty", + "signature": "element.empty()", + "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport streamlit as st\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nimport streamlit as st\n\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", + "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/empty.py#L24" + }, + "DeltaGenerator.error": { + "name": "error", + "signature": "element.error(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", + "description": "

Display error message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The error text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/alert.py#L39" + }, + "DeltaGenerator.exception": { + "name": "exception", + "signature": "element.exception(exception)", + "example": "
\n
\nimport streamlit as st\n\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", + "description": "

Display an exception.

\n", + "args": [ + { + "name": "exception", + "type_name": "Exception", + "is_optional": false, + "description": "

The exception to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/exception.py#L50" + }, + "DeltaGenerator.expander": { + "name": "expander", + "signature": "element.expander(label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/layouts.py#L320" + }, + "DeltaGenerator.experimental_data_editor": { + "name": "experimental_data_editor", + "signature": "element.experimental_data_editor(data, *, width=None, height=None, use_container_width=False, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.experimental_data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.experimental_data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n
\n", + "description": "

Display a data editor widget.

\n

Display a data editor widget that allows you to edit DataFrames and\nmany other data structures in a table-like UI.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None", + "is_optional": false, + "description": "

The data to edit in the data editor.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the data editor expressed in pixels. If None, the width will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the data editor expressed in pixels. If None, the height will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the data editor width to the width of the parent container.\nThis takes precedence over the width argument. Defaults to False.

\n", + "default": "False." + }, + { + "name": "num_rows", + "type_name": "\"fixed\" or \"dynamic\"", + "is_optional": false, + "description": "

Specifies if the user can add and delete rows in the data editor.\nIf "fixed", the user cannot add or delete rows. If "dynamic", the user can\nadd and delete rows in the data editor, but column sorting is disabled.\nDefaults to "fixed".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean which, if True, disables the data editor and prevents\nany edits. Defaults to False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the unique key for this widget. If this\nis omitted, a key will be generated for the widget based on its\ncontent. Multiple widgets of the same type may not share the same\nkey.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this data_editor's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "pd.DataFrame, pd.Styler, pyarrow.Table, np.ndarray, list, set, tuple, or dict.", + "is_generator": false, + "description": "

The edited data. The edited data is returned in its original data type if\nit corresponds to any of the supported return types. All other data types\nare returned as a pd.DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/data_editor.py#L448" + }, + "DeltaGenerator.file_uploader": { + "name": "file_uploader", + "signature": "element.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nimport streamlit as st\nimport pandas as pd\nfrom io import StringIO\n\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nimport streamlit as st\n\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n
\n", + "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this file uploader is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str or list of str or None", + "is_optional": false, + "description": "

Array of allowed extensions. ['png', 'jpg']\nThe default is None, which means all extensions are allowed.

\n", + "default": "None" + }, + { + "name": "accept_multiple_files", + "type_name": "bool", + "is_optional": false, + "description": "

If True, allows the user to upload multiple files at the same time,\nin which case the return value will be a list of files.\nDefault: False

\n", + "default": "False" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the file uploader.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this file_uploader's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the file uploader if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile or list of UploadedFile", + "is_generator": false, + "description": "
    \n
  • If accept_multiple_files is False, returns either None or\nan UploadedFile object.
  • \n
  • If accept_multiple_files is True, returns a list with the\nuploaded files as UploadedFile objects. If no files were\nuploaded, returns an empty list.
  • \n
\n

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/file_uploader.py#L205" + }, + "DeltaGenerator.form": { + "name": "form", + "signature": "element.form(key, clear_on_submit=False)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n

Inserting elements out of order:

\n
\nimport streamlit as st\n\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n
\n", + "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

A string that identifies the form. Each form must have its own\nkey. (This key is not displayed to the user in the interface.)

\n", + "default": null + }, + { + "name": "clear_on_submit", + "type_name": "bool", + "is_optional": false, + "description": "

If True, all widgets inside the form will be reset to their default\nvalues after the user presses the Submit button. Defaults to False.\n(Note that Custom Components are unaffected by this flag, and\nwill not be reset to their defaults on form submission.)

\n", + "default": "values" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/form.py#L118" + }, + "DeltaGenerator.form_submit_button": { + "name": "form_submit_button", + "signature": "element.form_submit_button(label=\"Submit\", help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nDefaults to "Submit".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

A tooltip that gets displayed when the button is hovered over.\nDefaults to None.

\n", + "default": "None." + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/form.py#L211" + }, + "DeltaGenerator.graphviz_chart": { + "name": "graphviz_chart", + "signature": "element.graphviz_chart(figure_or_dot, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nimport graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n
\n", + "description": "

Display a graph using the dagre-d3 library.

\n", + "args": [ + { + "name": "figure_or_dot", + "type_name": "graphviz.dot.Graph, graphviz.dot.Digraph, str", + "is_optional": false, + "description": "

The Graphlib graph object or dot string to display

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/graphviz_chart.py#L39" + }, + "DeltaGenerator.header": { + "name": "header", + "signature": "element.header(body, anchor=None, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.header('This is a header')\nst.header('A header with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in header formatting.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str or False", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the header.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/heading.py#L40" + }, + "DeltaGenerator.help": { + "name": "help", + "signature": "element.help(obj=)", + "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nimport streamlit as st\nimport pandas\n\nst.help(pandas.DataFrame)\n
\n\n \n

Want to quickly check what data type is output by a certain function?\nTry:

\n
\nimport streamlit as st\n\nx = my_poorly_documented_function()\nst.help(x)\n
\n

Want to quickly inspect an object? No sweat:

\n
\nclass Dog:\n  '''A typical dog.'''\n\n  def __init__(self, breed, color):\n    self.breed = breed\n    self.color = color\n\n  def bark(self):\n    return 'Woof!'\n\n\nfido = Dog('poodle', 'white')\n\nst.help(fido)\n
\n\n \n

And if you're using Magic, you can get help for functions, classes,\nand modules without even typing st.help:

\n
\nimport streamlit as st\nimport pandas\n\n# Get help for Pandas read_csv:\npandas.read_csv\n\n# Get help for Streamlit itself:\nst\n
\n\n \n
\n", + "description": "

Display help and other information for a given object.

\n

Depending on the type of object that is passed in, this displays the\nobject's name, type, value, signature, docstring, and member variables,\nmethods \u2014 as well as the values/docstring of members and methods.

\n", + "args": [ + { + "name": "obj", + "type_name": "any", + "is_optional": false, + "description": "

The object whose information should be displayed. If left\nunspecified, this call will display help for Streamlit itself.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/doc_string.py#L49" + }, + "DeltaGenerator.id": { + "name": "id", + "signature": "element.id" + }, + "DeltaGenerator.image": { + "name": "image", + "signature": "element.image(image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", + "example": "
\n
\nimport streamlit as st\nfrom PIL import Image\n\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n
\n", + "description": "

Display an image or list of images.

\n", + "args": [ + { + "name": "image", + "type_name": "numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]", + "is_optional": false, + "description": "

Monochrome image of shape (w,h) or (w,h,1)\nOR a color image of shape (w,h,3)\nOR an RGBA image of shape (w,h,4)\nOR a URL to fetch the image from\nOR a path of a local image file\nOR an SVG XML string like <svg xmlns=...</svg>\nOR a list of one of the above, to display multiple images.

\n", + "default": null + }, + { + "name": "caption", + "type_name": "str or list of str", + "is_optional": false, + "description": "

Image caption. If displaying multiple images, caption should be a\nlist of captions (one for each image).

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Image width. None means use the image width,\nbut do not exceed the width of the column.\nShould be set for SVG images, as they have no default image width.

\n", + "default": "image" + }, + { + "name": "use_column_width", + "type_name": "'auto' or 'always' or 'never' or bool", + "is_optional": false, + "description": "

If 'auto', set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf 'always' or True, set the image's width to the column width.\nIf 'never' or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", + "default": null + }, + { + "name": "clamp", + "type_name": "bool", + "is_optional": false, + "description": "

Clamp image pixel values to a valid range ([0-255] per channel).\nThis is only meaningful for byte array images; the parameter is\nignored for image URLs. If this is not set, and an image has an\nout-of-range value, an error will be thrown.

\n", + "default": null + }, + { + "name": "channels", + "type_name": "'RGB' or 'BGR'", + "is_optional": false, + "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to 'RGB', meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to 'BGR', instead.

\n", + "default": "s" + }, + { + "name": "output_format", + "type_name": "'JPEG', 'PNG', or 'auto'", + "is_optional": false, + "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to 'auto' which identifies the compression type based\non the type and format of the image argument.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/image.py#L88" + }, + "DeltaGenerator.info": { + "name": "info", + "signature": "element.info(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", + "description": "

Display an informational message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The info text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/alert.py#L103" + }, + "DeltaGenerator.json": { + "name": "json", + "signature": "element.json(body, *, expanded=True)", + "example": "
\n
\nimport streamlit as st\n\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n
\n", + "description": "

Display object or string as a pretty-printed JSON string.

\n", + "args": [ + { + "name": "body", + "type_name": "object or str", + "is_optional": false, + "description": "

The object to print as JSON. All referenced objects should be\nserializable to JSON as well. If object is a string, we assume it\ncontains serialized JSON.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean that allows the user to set whether the initial\nstate of this json element should be expanded. Defaults to True.\nThis argument can only be supplied by keyword.

\n", + "default": "True." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/json.py#L35" + }, + "DeltaGenerator.latex": { + "name": "latex", + "signature": "element.latex(body, *, help=None)", + "example": "
\n
\nimport streamlit as st\n\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", + "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", + "args": [ + { + "name": "body", + "type_name": "str or SymPy expression", + "is_optional": false, + "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the LaTeX expression.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/markdown.py#L196" + }, + "DeltaGenerator.line_chart": { + "name": "line_chart", + "signature": "element.line_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\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 \n
\n", + "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict or None", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/dataframe_selector.py#L160" + }, + "DeltaGenerator.map": { + "name": "map", + "signature": "element.map(data=None, zoom=None, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n
\n", + "description": "

Display a map with points on it.

\n

This is a wrapper around st.pydeck_chart to quickly create\nscatterplot charts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to be plotted. Must have two columns:

\n
    \n
  • latitude called 'lat', 'latitude', 'LAT', 'LATITUDE'
  • \n
  • longitude called 'lon', 'longitude', 'LON', 'LONGITUDE'.
  • \n
\n", + "default": null + }, + { + "name": "zoom", + "type_name": "int", + "is_optional": false, + "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/map.py#L76" + }, + "DeltaGenerator.markdown": { + "name": "markdown", + "signature": "element.markdown(body, unsafe_allow_html=False, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.markdown('Streamlit is **_really_ cool**.')\nst.markdown(\u201dThis text is :red[colored red], and this is **:blue[colored]** and bold.\u201d)\nst.markdown(":green[$\\sqrt{x^2+y^2}=1$] is a Pythagorean identity. :pencil:")\n
\n
\n", + "description": "

Display string formatted as Markdown.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the Markdown.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/markdown.py#L31" + }, + "DeltaGenerator.metric": { + "name": "metric", + "signature": "element.metric(label, value, delta=None, delta_color=\"normal\", help=None, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n

st.metric looks especially nice in combination with st.columns:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n

The delta indicator color can also be inverted or turned off:

\n
\nimport streamlit as st\n\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n
\n", + "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

The header or title for the metric. The label can optionally contain\nMarkdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Value of the metric. None is rendered as a long dash.

\n", + "default": null + }, + { + "name": "delta", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Indicator of how the metric changed, rendered with an arrow below\nthe metric. If delta is negative (int/float) or starts with a minus\nsign (str), the arrow points down and the text is red; else the\narrow points up and the text is green. If None (default), no delta\nindicator is shown.

\n", + "default": null + }, + { + "name": "delta_color", + "type_name": "str", + "is_optional": false, + "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the metric label.

\n", + "default": null + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/metric.py#L46" + }, + "DeltaGenerator.multiselect": { + "name": "multiselect", + "signature": "element.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", max_selections=None)", + "example": "
\n
\nimport streamlit as st\n\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n
\n", + "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence[V], numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "default", + "type_name": "[V], V, or None", + "is_optional": false, + "description": "

List of default values. Can also be a single value.

\n", + "default": "values." + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of selectbox options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe multiselect.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the multiselect.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this multiselect's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the multiselect widget if set\nto True. The default is False. This argument can only be supplied\nby keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "max_selections", + "type_name": "int", + "is_optional": false, + "description": "

The max selections that can be selected at a time.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list", + "is_generator": false, + "description": "

A list with the selected options

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/multiselect.py#L145" + }, + "DeltaGenerator.number_input": { + "name": "number_input", + "signature": "element.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n
\n", + "description": "

Display a numeric input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int or float or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. Output must be purely numeric. This does not impact\nthe return value. Valid formatters: %d %e %f %g %i %u

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this number_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the number input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int or float", + "is_generator": false, + "description": "

The current value of the numeric input widget. The return type\nwill match the data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/number_input.py#L66" + }, + "DeltaGenerator.plotly_chart": { + "name": "plotly_chart", + "signature": "element.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", theme=\"streamlit\", **kwargs)", + "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport numpy as np\nimport plotly.figure_factory as ff\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n        hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n
\n", + "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", + "args": [ + { + "name": "figure_or_data", + "type_name": "plotly.graph_objs.Figure, plotly.graph_objs.Data,", + "is_optional": false, + "description": "

dict/list of plotly.graph_objs.Figure/Data

\n

See https://plot.ly/python/ for examples of graph descriptions.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + }, + { + "name": "sharing", + "type_name": "{'streamlit', 'private', 'secret', 'public'}", + "is_optional": false, + "description": "

Use 'streamlit' to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": null, + "is_optional": null, + "description": "

Any argument accepted by Plotly's plot() function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/plotly_chart.py#L81" + }, + "DeltaGenerator.progress": { + "name": "progress", + "signature": "element.progress(value, text=None)", + "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport streamlit as st\nimport time\n\nprogress_text = "Operation in progress. Please wait."\nmy_bar = st.progress(0, text=progress_text)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1, text=progress_text)\n
\n
\n", + "description": "

Display a progress bar.

\n", + "args": [ + { + "name": "value", + "type_name": "int or float", + "is_optional": false, + "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", + "default": null + }, + { + "name": "text", + "type_name": "str or None", + "is_optional": false, + "description": "

A message to display above the progress bar. The text can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/progress.py#L66" + }, + "DeltaGenerator.pydeck_chart": { + "name": "pydeck_chart", + "signature": "element.pydeck_chart(pydeck_obj=None, use_container_width=False)", + "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport pydeck as pdk\n\nchart_data = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=chart_data,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=chart_data,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", + "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "args": [ + { + "name": "pydeck_obj", + "type_name": "pydeck.Deck or None", + "is_optional": false, + "description": "

Object specifying the PyDeck chart to draw.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/deck_gl_json_chart.py#L36" + }, + "DeltaGenerator.pyplot": { + "name": "pyplot", + "signature": "element.pyplot(fig=None, clear_figure=None, use_container_width=True, **kwargs)", + "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", + "example": "
\n
\nimport streamlit as st\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n
\n", + "description": "

Display a matplotlib.pyplot figure.

\n", + "args": [ + { + "name": "fig", + "type_name": "Matplotlib Figure", + "is_optional": false, + "description": "

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

\n", + "default": null + }, + { + "name": "clear_figure", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", + "default": "based" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n", + "default": "s" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Arguments to pass to Matplotlib's savefig function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/pyplot.py#L38" + }, + "DeltaGenerator.radio": { + "name": "radio", + "signature": "element.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ngenre = st.radio(\n    "What\\'s your favorite movie genre",\n    ('Comedy', 'Drama', 'Documentary'))\n\nif genre == 'Comedy':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn\\'t select comedy.")\n
\n\n \n
\n", + "description": "

Display a radio button widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this radio group is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the radio options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of radio options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe radio.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the radio.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this radio's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the radio button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "horizontal", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", + "default": "false" + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/radio.py#L75" + }, + "DeltaGenerator.select_slider": { + "name": "select_slider", + "signature": "element.select_slider(label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\nimport streamlit as st\n\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nimport streamlit as st\n\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n ", + "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the slider options. All options will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", + "default": "." + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to first option.

\n", + "default": "first" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels from the options.\nargument. It receives the option as an argument and its output\nwill be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the select slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this select_slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the select slider if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any value or tuple of any value", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/select_slider.py#L106" + }, + "DeltaGenerator.selectbox": { + "name": "selectbox", + "signature": "element.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n
\n", + "description": "

Display a select widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels. It receives the option\nas an argument and its output will be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the selectbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this selectbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the selectbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/selectbox.py#L71" + }, + "DeltaGenerator.slider": { + "name": "slider", + "signature": "element.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nimport streamlit as st\n\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nimport streamlit as st\nfrom datetime import time\n\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nimport streamlit as st\nfrom datetime import datetime\n\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n
\n", + "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The minimum permitted value.\nDefaults to 0 if the value is an int, 0.0 if a float,\nvalue - timedelta(days=14) if a date/datetime, time.min if a time

\n", + "default": "0" + }, + { + "name": "max_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The maximum permitted value.\nDefaults to 100 if the value is an int, 1.0 if a float,\nvalue + timedelta(days=14) if a date/datetime, time.max if a time

\n", + "default": "100" + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to min_value.

\n", + "default": "min_value." + }, + { + "name": "step", + "type_name": "int/float/timedelta or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. This does not impact the return value.\nFormatter for int/float supports: %d %e %f %g %i\nFormatter for date/time/datetime uses Moment.js notation:\nhttps://momentjs.com/docs/#/displaying/format/

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the slider if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int/float/date/time/datetime or tuple of int/float/date/time/datetime", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/slider.py#L171" + }, + "DeltaGenerator.snow": { + "name": "snow", + "signature": "element.snow()", + "example": "
\n
\nimport streamlit as st\n\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", + "description": "

Draw celebratory snowfall.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/snow.py#L25" + }, + "DeltaGenerator.subheader": { + "name": "subheader", + "signature": "element.subheader(body, anchor=None, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.subheader('This is a subheader')\nst.subheader('A subheader with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in subheader formatting.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str or False", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the subheader.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/heading.py#L93" + }, + "DeltaGenerator.success": { + "name": "success", + "signature": "element.success(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", + "description": "

Display a success message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The success text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/alert.py#L136" + }, + "DeltaGenerator.table": { + "name": "table", + "signature": "element.table(data=None)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n
\n", + "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/dataframe_selector.py#L122" + }, + "DeltaGenerator.tabs": { + "name": "tabs", + "signature": "element.tabs(tabs)", + "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\nimport streamlit as st\n\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n
\n", + "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", + "args": [ + { + "name": "tabs", + "type_name": "list of strings", + "is_optional": false, + "description": "

Creates a tab for each string in the list. The first tab is selected by default.\nThe string is used as the name of the tab and can optionally contain Markdown,\nsupporting the following elements: Bold, Italics, Strikethroughs, Inline Code,\nEmojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": "." + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/layouts.py#L208" + }, + "DeltaGenerator.text": { + "name": "text", + "signature": "element.text(body, *, help=None)", + "example": "
\n
\nimport streamlit as st\n\nst.text('This is some text.')\n
\n
\n", + "description": "

Write fixed-width and preformatted text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the text.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/text.py#L27" + }, + "DeltaGenerator.text_area": { + "name": "text_area", + "signature": "element.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", + "description": "

Display a multi-line text input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Maximum number of characters allowed in text area.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the textarea.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_area's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text area is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text area if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/text_widgets.py#L274" + }, + "DeltaGenerator.text_input": { + "name": "text_input", + "signature": "element.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n
\n", + "description": "

Display a single-line text input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Max number of characters allowed in text input.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"default\" or \"password\"", + "is_optional": false, + "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "autocomplete", + "type_name": "str", + "is_optional": false, + "description": "

An optional value that will be passed to the <input> element's\nautocomplete property. If unspecified, this value will be set to\n"new-password" for "password" inputs, and the empty string for\n"default" inputs. For more details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text input is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/text_widgets.py#L71" + }, + "DeltaGenerator.time_input": { + "name": "time_input", + "signature": "element.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", step=0:15:00)", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n
\n", + "description": "

Display a time input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this time input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.time/datetime.datetime", + "is_optional": false, + "description": "

The value of this widget when it first renders. This will be\ncast to str internally. Defaults to the current time.

\n", + "default": "the" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this time_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the time input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\" or \"hidden\" or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "step", + "type_name": "int or timedelta", + "is_optional": false, + "description": "

The stepping interval in seconds. Defaults to 900, i.e. 15 minutes.\nYou can also pass a datetime.timedelta object.

\n", + "default": "900" + } + ], + "returns": [ + { + "type_name": "datetime.time", + "is_generator": false, + "description": "

The current value of the time input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/time_widgets.py#L214" + }, + "DeltaGenerator.title": { + "name": "title", + "signature": "element.title(body, anchor=None, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.title('This is a title')\nst.title('A title with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str or False", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the title.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/heading.py#L146" + }, + "DeltaGenerator.vega_lite_chart": { + "name": "vega_lite_chart", + "signature": "element.vega_lite_chart(data=None, spec=None, use_container_width=False, theme=\"streamlit\", **kwargs)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(chart_data, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", + "description": "

Display a chart using the Vega-Lite library.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "spec", + "type_name": "dict or None", + "is_optional": false, + "description": "

The Vega-Lite spec for the chart. If the spec was already passed in\nthe previous argument, this must be set to None. See\nhttps://vega.github.io/vega-lite/docs/ for more info.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Same as spec, but as keywords.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/dataframe_selector.py#L475" + }, + "DeltaGenerator.video": { + "name": "video", + "signature": "element.video(data, format=\"video/mp4\", start_time=0)", + "example": "
\n
\nimport streamlit as st\n\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", + "description": "

Display a video player.

\n", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "default": null + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the video file. Defaults to 'video/mp4'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/media.py#L117" + }, + "DeltaGenerator.warning": { + "name": "warning", + "signature": "element.warning(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", + "description": "

Display warning message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The warning text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/alert.py#L71" + }, + "DeltaGenerator.write": { + "name": "write", + "signature": "element.write(*args, unsafe_allow_html=False, **kwargs)", + "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nimport streamlit as st\n\nst.write('Hello, *World!* :sunglasses:')\n
\n\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nimport streamlit as st\nimport pandas as pd\n\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nimport streamlit as st\n\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n
\n", + "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression, emoji shortcodes, and colored text.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(class) : Displays information about a class.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.22.0/lib/streamlit/elements/write.py#L48" + } + }, + "1.23.0": { + "streamlit.altair_chart": { + "name": "altair_chart", + "signature": "st.altair_chart(altair_chart, use_container_width=False, theme=\"streamlit\")", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(chart_data).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n
\n", + "description": "

Display a chart using the Altair library.

\n", + "args": [ + { + "name": "altair_chart", + "type_name": "altair.Chart", + "is_optional": false, + "description": "

The Altair chart object to display.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/dataframe_selector.py#L492" + }, + "streamlit.area_chart": { + "name": "area_chart", + "signature": "st.area_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n
\n", + "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/dataframe_selector.py#L317" + }, + "streamlit.audio": { + "name": "audio", + "signature": "st.audio(data, format=\"audio/wav\", start_time=0, *, sample_rate=None)", + "example": "
\n
\nimport streamlit as st\nimport numpy as np\n\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n\nsample_rate = 44100  # 44100 samples per second\nseconds = 2  # Note duration of 2 seconds\nfrequency_la = 440  # Our played note will be 440 Hz\n# Generate array with seconds*sample_rate steps, ranging between 0 and seconds\nt = np.linspace(0, seconds, seconds * sample_rate, False)\n# Generate a 440 Hz sine wave\nnote_la = np.sin(frequency_la * t * 2 * np.pi)\n\nst.audio(note_la, sample_rate=sample_rate)\n
\n\n \n
\n", + "description": "

Display an audio player.

\n", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw audio data, filename, or a URL pointing to the file to load.\nRaw data formats must include all necessary file headers to match the file\nformat specified via format.\nIf data is a numpy array, it must either be a 1D array of the waveform\nor a 2D array of shape (num_channels, num_samples) with waveforms\nfor all channels. See the default channel order at\nhttp://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx

\n", + "default": "channel" + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + }, + { + "name": "sample_rate", + "type_name": "int or None", + "is_optional": false, + "description": "

The sample rate of the audio data in samples per second. Only required if\ndata is a numpy array.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/media.py#L42" + }, + "streamlit.balloons": { + "name": "balloons", + "signature": "st.balloons()", + "example": "
\n
\nimport streamlit as st\n\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", + "description": "

Draw celebratory balloons.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/balloons.py#L25" + }, + "streamlit.bar_chart": { + "name": "bar_chart", + "signature": "st.bar_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n
\n", + "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/dataframe_selector.py#L404" + }, + "streamlit.bokeh_chart": { + "name": "bokeh_chart", + "signature": "st.bokeh_chart(figure, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n
\n", + "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", + "args": [ + { + "name": "figure", + "type_name": "bokeh.plotting.figure.Figure", + "is_optional": false, + "description": "

A Bokeh figure to plot.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Bokeh's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/bokeh_chart.py#L36" + }, + "streamlit.button": { + "name": "button", + "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\n\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n
\n", + "description": "

Display a button widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/button.py#L61" + }, + "streamlit.cache": { + "name": "cache", + "signature": "st.cache(func=None, persist=False, allow_output_mutation=False, show_spinner=True, suppress_st_warning=False, hash_funcs=None, max_entries=None, ttl=None)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\n@st.cache(persist=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To disable hashing return values, set the allow_output_mutation parameter to True:

\n
\n@st.cache(allow_output_mutation=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. MongoClient) to a hash function (id) like this:

\n
\n@st.cache(hash_funcs={MongoClient: id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "pymongo.mongo_client.MongoClient") to the hash function instead:

\n
\n@st.cache(hash_funcs={"pymongo.mongo_client.MongoClient": id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n
\n", + "description": "

Function decorator to memoize function executions.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to cache. Streamlit hashes the function and dependent code.

\n", + "default": null + }, + { + "name": "persist", + "type_name": "boolean", + "is_optional": false, + "description": "

Whether to persist the cache on disk.

\n", + "default": null + }, + { + "name": "allow_output_mutation", + "type_name": "boolean", + "is_optional": false, + "description": "

Streamlit shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.

\n

If you know what you're doing and would like to override this warning, set this to True.

\n", + "default": null + }, + { + "name": "show_spinner", + "type_name": "boolean", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na cache miss.

\n", + "default": "True" + }, + { + "name": "suppress_st_warning", + "type_name": "boolean", + "is_optional": false, + "description": "

Suppress warnings about calling Streamlit commands from within\nthe cached function.

\n", + "default": null + }, + { + "name": "hash_funcs", + "type_name": "dict or None", + "is_optional": false, + "description": "

Mapping of types or fully qualified names to hash functions. This is used to override\nthe behavior of the hasher inside Streamlit's caching mechanism: when the hasher\nencounters an object, it will first check to see if its type matches a key in this\ndict and, if so, will use the provided function to generate a hash for it. See below\nfor an example of how this can be used.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." + }, + { + "name": "ttl", + "type_name": "float or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.

\n", + "default": "None." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/runtime/legacy_caching/caching.py#L486" + }, + "streamlit.cache_data": { + "name": "cache_data", + "signature": "st.cache_data(func=None, *, ttl, max_entries, show_spinner, persist, experimental_allow_widgets)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\nimport streamlit as st\n\n@st.cache_data(persist="disk")\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

By default, all parameters to a cached function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nconnection = make_database_connection()\nd1 = fetch_and_clean_data(connection, num_rows=10)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nanother_connection = make_database_connection()\nd2 = fetch_and_clean_data(another_connection, num_rows=10)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _database_connection parameter was different\n# in both calls.\n
\n

A cached function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nfetch_and_clean_data.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Decorator to cache functions that return data (e.g. dataframe transforms, database queries, ML inference).

\n

Cached objects are stored in "pickled" form, which means that the return\nvalue of a cached function must be pickleable. Each caller of the cached\nfunction gets its own copy of the cached data.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_data.clear().

\n

To cache global resources, use st.cache_resource instead. Learn more\nabout caching at https://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to cache. Streamlit hashes the function's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float, timedelta, str, or None", + "is_optional": false, + "description": "

The maximum time to keep an entry in the cache. Can be one of:

\n\n

Note that ttl will be ignored if persist="disk" or persist=True.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. When a new entry is added to a full cache,\nthe oldest cached entry will be removed. Defaults to None.

\n", + "default": "None." + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached data is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "persist", + "type_name": "\"disk\", boolean, or None", + "is_optional": false, + "description": "

Optional location to persist cached data to. Passing "disk" (or True)\nwill persist the cached data to the local disk. None (or False) will disable\npersistence. The default is None.

\n", + "default": "None." + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/runtime/caching/cache_data_api.py#L378" + }, + "streamlit.cache_resource": { + "name": "cache_resource", + "signature": "st.cache_resource(func, *, ttl, max_entries, show_spinner, validate, experimental_allow_widgets)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(url):\n    # Create a database session object that points to the URL.\n    return session\n\ns1 = get_database_session(SESSION_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(SESSION_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the connection object in s1 is the same as in s2.\n\ns3 = get_database_session(SESSION_URL_2)\n# This is a different URL, so the function executes.\n
\n

By default, all parameters to a cache_resource function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\ns1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _sessionmaker parameter was different\n# in both calls.\n
\n

A cache_resource function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\nget_database_session.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Decorator to cache functions that return global resources (e.g. database connections, ML models).

\n

Cached objects are shared across all users, sessions, and reruns. They\nmust be thread-safe because they can be accessed from multiple threads\nconcurrently. If thread safety is an issue, consider using st.session_state\nto store resources per session instead.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_resource.clear().

\n

To cache data, use st.cache_data instead. Learn more about caching at\nhttps://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function that creates the cached resource. Streamlit hashes the\nfunction's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float, timedelta, str, or None", + "is_optional": false, + "description": "

The maximum time to keep an entry in the cache. Can be one of:

\n\n

Note that ttl will be ignored if persist="disk" or persist=True.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. When a new entry is added to a full cache,\nthe oldest cached entry will be removed. Defaults to None.

\n", + "default": "None." + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached resource is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "validate", + "type_name": "callable or None", + "is_optional": false, + "description": "

An optional validation function for cached data. validate is called\neach time the cached value is accessed. It receives the cached value as\nits only parameter and it must return a boolean. If validate returns\nFalse, the current cached value is discarded, and the decorated function\nis called to compute a new value. This is useful e.g. to check the\nhealth of database connections.

\n", + "default": null + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/runtime/caching/cache_resource_api.py#L258" + }, + "streamlit.camera_input": { + "name": "camera_input", + "signature": "st.camera_input(label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", + "description": "

Display a widget that returns pictures from the user's webcam.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this widget is used for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the camera input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this camera_input's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile", + "is_generator": false, + "description": "

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/camera_input.py#L109" + }, + "streamlit.caption": { + "name": "caption", + "signature": "st.caption(body, unsafe_allow_html=False, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.caption('This is a string that explains something above.')\nst.caption('A caption with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the caption.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/markdown.py#L132" + }, + "streamlit.checkbox": { + "name": "checkbox", + "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n
\n", + "description": "

Display a checkbox widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this checkbox is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "value", + "type_name": "bool", + "is_optional": false, + "description": "

Preselect the checkbox when it first renders. This will be\ncast to bool internally.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the checkbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this checkbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

Whether or not the checkbox is checked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/checkbox.py#L52" + }, + "streamlit.code": { + "name": "code", + "signature": "st.code(body, language=\"python\", line_numbers=False)", + "example": "
\n
\nimport streamlit as st\n\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", + "description": "

Display a code block with optional syntax highlighting.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as code.

\n", + "default": null + }, + { + "name": "language", + "type_name": "str or None", + "is_optional": false, + "description": "

The language that the code is written in, for syntax highlighting.\nIf None, the code will be unstyled. Defaults to "python".

\n

For a list of available language values, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", + "default": "s" + }, + { + "name": "line_numbers", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean indicating whether to show line numbers to the\nleft of the code block. Defaults to False.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/code.py#L27" + }, + "streamlit.color_picker": { + "name": "color_picker", + "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n
\n", + "description": "

Display a color picker widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "str", + "is_optional": false, + "description": "

The hex value of this widget when it first renders. If None,\ndefaults to black.

\n", + "default": "black." + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the color picker.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this color_picker's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The selected color as a hex string.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/color_picker.py#L52" + }, + "streamlit.columns": { + "name": "columns", + "signature": "st.columns(spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or iterable of numbers", + "is_optional": false, + "description": "

Controls the number and width of columns to insert. Can be one of:

\n
    \n
  • An integer that specifies the number of columns. All columns have equal\nwidth in this case.
  • \n
  • An iterable of numbers (int or float) that specify the relative width of\neach column. E.g. [0.7, 0.3] creates two columns where the first\none takes up 70% of the available with and the second one takes up 30%.\nOr [1, 2, 3] creates three columns where the second one is two times\nthe width of the first one, and the third one is three times that width.
  • \n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "\"small\", \"medium\", or \"large\"", + "is_optional": false, + "description": "

The size of the gap between the columns. Defaults to "small". This\nargument can only be supplied by keyword.

\n", + "default": "s" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/layouts.py#L77" + }, + "streamlit.container": { + "name": "container", + "signature": "st.container()", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/layouts.py#L29" + }, + "streamlit.data_editor": { + "name": "data_editor", + "signature": "st.data_editor(data, *, width=None, height=None, use_container_width=False, hide_index=None, column_order=None, column_config=None, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

Or you can customize the data editor via column_config, hide_index, column_order, or disabled:

\n
\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    [\n        {"command": "st.selectbox", "rating": 4, "is_widget": True},\n        {"command": "st.balloons", "rating": 5, "is_widget": False},\n        {"command": "st.time_input", "rating": 3, "is_widget": True},\n    ]\n)\nedited_df = st.data_editor(\n    df,\n    column_config={\n        "command": "Streamlit Command",\n        "rating": st.column_config.NumberColumn(\n            "Your rating",\n            help="How much do you like this command (1-5)?",\n            min_value=1,\n            max_value=5,\n            step=1,\n            format="%d \u2b50",\n        ),\n        "is_widget": "Widget ?",\n    },\n    disabled=["command", "is_widget"],\n    hide_index=True,\n)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n
\n", + "description": "

Display a data editor widget.

\n

The data editor widget allows you to edit dataframes and many other data structures in a table-like UI.

\n
\n

Warning

\n

When going from st.experimental_data_editor to st.data_editor in\n1.23.0, the data editor's representation in st.session_state was changed.\nThe edited_cells dictionary is now called edited_rows and uses a\ndifferent format ({0: {"column name": "edited value"}} instead of\n{"0:1": "edited value"}). You may need to adjust the code if your app uses\nst.experimental_data_editor in combination with st.session_state."

\n
\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None", + "is_optional": false, + "description": "

The data to edit in the data editor.

\n
\n

Note

\n

Mixing data types within a column can make the column uneditable.\nAdditionally, the following data types are not yet supported for editing:\ncomplex, list, tuple, bytes, bytearray, memoryview, dict, set, frozenset,\ndatetime.timedelta, decimal.Decimal, fractions.Fraction, pandas.Interval,\npandas.Period, pandas.Timedelta.

\n
\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the data editor expressed in pixels. If None, the width will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the data editor expressed in pixels. If None, the height will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the data editor width to the width of the parent container.\nThis takes precedence over the width argument. Defaults to False.

\n", + "default": "False." + }, + { + "name": "hide_index", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether to hide the index column(s). If None (default), the visibility of\nindex columns is automatically determined based on the data.

\n", + "default": null + }, + { + "name": "column_order", + "type_name": "iterable of str or None", + "is_optional": false, + "description": "

Specifies the display order of columns. This also affects which columns are\nvisible. For example, column_order=("col2", "col1") will display 'col2'\nfirst, followed by 'col1', and will hide all other non-index columns. If\nNone (default), the order is inherited from the original data structure.

\n", + "default": null + }, + { + "name": "column_config", + "type_name": "dict or None", + "is_optional": false, + "description": "

Configures how columns are displayed, e.g. their title, visibility, type, or\nformat, as well as editing properties such as min/max value or step.\nThis needs to be a dictionary where each key is a column name and the value\nis one of:

\n
    \n
  • None to hide the column.
  • \n
  • A string to set the display label of the column.
  • \n
  • One of the column types defined under st.column_config, e.g.\nst.column_config.NumberColumn("Dollar values\u201d, format=\u201d$ %d") to show\na column as dollar amounts. See more info on the available column types\nand config options here.
  • \n
\n

To configure the index column(s), use _index as the column name.

\n", + "default": null + }, + { + "name": "num_rows", + "type_name": "\"fixed\" or \"dynamic\"", + "is_optional": false, + "description": "

Specifies if the user can add and delete rows in the data editor.\nIf "fixed", the user cannot add or delete rows. If "dynamic", the user can\nadd and delete rows in the data editor, but column sorting is disabled.\nDefaults to "fixed".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool or iterable of str", + "is_optional": false, + "description": "

Controls the editing of columns. If True, editing is disabled for all columns.\nIf an iterable of column names is provided (e.g., disabled=("col1", "col2")),\nonly the specified columns will be disabled for editing. If False (default),\nall columns that support editing are editable.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the unique key for this widget. If this\nis omitted, a key will be generated for the widget based on its\ncontent. Multiple widgets of the same type may not share the same\nkey.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this data_editor's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "pandas.DataFrame, pandas.Series, pyarrow.Table, numpy.ndarray, list, set, tuple, or dict.", + "is_generator": false, + "description": "

The edited data. The edited data is returned in its original data type if\nit corresponds to any of the supported return types. All other data types\nare returned as a pd.DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/data_editor.py#L527" + }, + "streamlit.dataframe": { + "name": "dataframe", + "signature": "st.dataframe(data=None, width=None, height=None, *, use_container_width=False, hide_index=None, column_order=None, column_config=None)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n

Or you can customize the dataframe via column_config, hide_index, or column_order:

\n
\nimport random\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    {\n        "name": ["Roadmap", "Extras", "Issues"],\n        "url": ["https://roadmap.streamlit.app", "https://extras.streamlit.app", "https://issues.streamlit.app"],\n        "stars": [random.randint(0, 1000) for _ in range(3)],\n        "views_history": [[random.randint(0, 5000) for _ in range(30)] for _ in range(3)],\n    }\n)\nst.dataframe(\n    df,\n    column_config={\n        "name": "App name",\n        "stars": st.column_config.NumberColumn(\n            "Github Stars",\n            help="Number of stars on GitHub",\n            format="%d \u2b50",\n        ),\n        "url": st.column_config.LinkColumn("App URL"),\n        "views_history": st.column_config.LineChartColumn(\n            "Views (past 30 days)", y_min=0, y_max=5000\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Display a dataframe as an interactive table.

\n

This command works with dataframes from Pandas, PyArrow, Snowpark, and PySpark.\nIt can also display several other types that can be converted to dataframes,\ne.g. numpy arrays, lists, sets and dictionaries.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the dataframe expressed in pixels. If None, the width\nwill be automatically calculated based on the column content.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the dataframe expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the dataframe width to the width of the parent container.\nThis takes precedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "hide_index", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether to hide the index column(s). If None (default), the visibility of\nindex columns is automatically determined based on the data.

\n", + "default": null + }, + { + "name": "column_order", + "type_name": "iterable of str or None", + "is_optional": false, + "description": "

Specifies the display order of columns. This also affects which columns are\nvisible. For example, column_order=("col2", "col1") will display 'col2'\nfirst, followed by 'col1', and will hide all other non-index columns. If\nNone (default), the order is inherited from the original data structure.

\n", + "default": null + }, + { + "name": "column_config", + "type_name": "dict or None", + "is_optional": false, + "description": "

Configures how columns are displayed, e.g. their title, visibility, type, or\nformat. This needs to be a dictionary where each key is a column name and\nthe value is one of:

\n
    \n
  • None to hide the column.
  • \n
  • A string to set the display label of the column.
  • \n
  • One of the column types defined under st.column_config, e.g.\nst.column_config.NumberColumn("Dollar values\u201d, format=\u201d$ %d") to show\na column as dollar amounts. See more info on the available column types\nand config options here.
  • \n
\n

To configure the index column(s), use _index as the column name.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/dataframe_selector.py#L43" + }, + "streamlit.date_input": { + "name": "date_input", + "signature": "st.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nd = st.date_input(\n    "When\\'s your birthday",\n    datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n
\n", + "description": "

Display a date input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this date input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", + "is_optional": false, + "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", + "default": "today" + }, + { + "name": "min_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", + "default": "value" + }, + { + "name": "max_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", + "default": "value" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this date_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.date or a tuple with 0-2 dates", + "is_generator": false, + "description": "

The current value of the date input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/time_widgets.py#L398" + }, + "streamlit.divider": { + "name": "divider", + "signature": "st.divider()", + "example": "
\n
\nimport streamlit as st\n\nst.divider()\n
\n
\n", + "description": "

Display a horizontal rule.

\n
\n

Note

\n

You can achieve the same effect with st.write("---") or\neven just "---" in your script (via magic).

\n
\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/markdown.py#L244" + }, + "streamlit.download_button": { + "name": "download_button", + "signature": "st.download_button(label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False, use_container_width=False)", + "examples": "
\n

Download a large DataFrame as a CSV:

\n
\nimport streamlit as st\n\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\nimport streamlit as st\n\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nimport streamlit as st\n\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nimport streamlit as st\n\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n
\n", + "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "data", + "type_name": "str or bytes or file", + "is_optional": false, + "description": "

The contents of the file to be downloaded. See example below for\ncaching techniques to avoid recomputing this data unnecessarily.

\n", + "default": null + }, + { + "name": "file_name", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the name of the file to be downloaded,\nsuch as 'my_file.csv'. If not specified, the name will be\nautomatically generated.

\n", + "default": null + }, + { + "name": "mime", + "type_name": "str or None", + "is_optional": false, + "description": "

The MIME type of the data. If None, defaults to "text/plain"\n(if data is of type str or is a textual file) or\n"application/octet-stream" (if data is of type bytes or is a\nbinary file).

\n", + "default": "s" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/button.py#L169" + }, + "streamlit.echo": { + "name": "echo", + "signature": "st.echo(code_location=\"above\")", + "example": "
\n
\nimport streamlit as st\n\nwith st.echo():\n    st.write('This code will be printed')\n
\n
\n", + "description": "

Use in a with block to draw some code on the app, then execute it.

\n", + "args": [ + { + "name": "code_location", + "type_name": "\"above\" or \"below\"", + "is_optional": false, + "description": "

Whether to show the echoed code before or after the results of the\nexecuted code block.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/echo.py#L27" + }, + "streamlit.empty": { + "name": "empty", + "signature": "st.empty()", + "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport streamlit as st\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nimport streamlit as st\n\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", + "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/empty.py#L24" + }, + "streamlit.error": { + "name": "error", + "signature": "st.error(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", + "description": "

Display error message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The error text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/alert.py#L39" + }, + "streamlit.exception": { + "name": "exception", + "signature": "st.exception(exception)", + "example": "
\n
\nimport streamlit as st\n\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", + "description": "

Display an exception.

\n", + "args": [ + { + "name": "exception", + "type_name": "Exception", + "is_optional": false, + "description": "

The exception to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/exception.py#L50" + }, + "streamlit.expander": { + "name": "expander", + "signature": "st.expander(label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/layouts.py#L317" + }, + "streamlit.experimental_connection": { + "name": "experimental_connection", + "signature": "st.experimental_connection(name, type=None, max_entries=None, ttl=None, **kwargs)", + "examples": "
\n

The easiest way to create a first-party (SQL or Snowpark) connection is to use their\ndefault names and define corresponding sections in your secrets.toml file.

\n
\nimport streamlit as st\nconn = st.experimental_connection("sql") # Config section defined in [connections.sql] in secrets.toml.\n
\n

Creating a SQLConnection with a custom name requires you to explicitly specify the\ntype. If type is not passed as a kwarg, it must be set in the appropriate section of\nsecrets.toml.

\n
\nimport streamlit as st\nconn1 = st.experimental_connection("my_sql_connection", type="sql") # Config section defined in [connections.my_sql_connection].\nconn2 = st.experimental_connection("my_other_sql_connection") # type must be set in [connections.my_other_sql_connection].\n
\n

Passing the full module path to the connection class that you want to use can be\nuseful, especially when working with a custom connection:

\n
\nimport streamlit as st\nconn = st.experimental_connection("my_sql_connection", type="streamlit.connections.SQLConnection")\n
\n

Finally, you can pass the connection class to use directly to this function. Doing\nso allows static type checking tools such as mypy to infer the exact return\ntype of st.experimental_connection.

\n
\nimport streamlit as st\nfrom streamlit.connections import SQLConnection\nconn = st.experimental_connection("my_sql_connection", type=SQLConnection)\n
\n
\n", + "description": "

Create a new connection to a data store or API, or return an existing one.

\n

Config options, credentials, secrets, etc. for connections are taken from various\nsources:

\n
    \n
  • Any connection-specific configuration files.
  • \n
  • An app's secrets.toml files.
  • \n
  • The kwargs passed to this function.
  • \n
\n", + "args": [ + { + "name": "name", + "type_name": "str", + "is_optional": false, + "description": "

The connection name used for secrets lookup in [connections.<name>].\nType will be inferred from passing "sql" or "snowpark".

\n", + "default": null + }, + { + "name": "type", + "type_name": "str, connection class, or None", + "is_optional": false, + "description": "

The type of connection to create. It can be a keyword ("sql" or "snowpark"),\na path to an importable class, or an imported class reference. All classes\nmust extend st.connections.ExperimentalBaseConnection and implement the\n_connect() method. If the type kwarg is None, a type field must be set\nin the connection's section in secrets.toml.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of connections to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." + }, + { + "name": "ttl", + "type_name": "float, timedelta, or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep results in the cache, or\nNone if cached results should not expire. The default is None.

\n", + "default": "None." + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Additional connection specific kwargs that are passed to the Connection's\n_connect() method. Learn more from the specific Connection's documentation.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "Connection object", + "is_generator": false, + "description": "

An initialized Connection object of the specified type.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/runtime/connection_factory.py#L170" + }, + "streamlit.experimental_data_editor": { + "name": "experimental_data_editor", + "signature": "st.experimental_data_editor(data, *, width=None, height=None, use_container_width=False, hide_index=None, column_order=None, column_config=None, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

Or you can customize the data editor via column_config, hide_index, column_order, or disabled:

\n
\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    [\n        {"command": "st.selectbox", "rating": 4, "is_widget": True},\n        {"command": "st.balloons", "rating": 5, "is_widget": False},\n        {"command": "st.time_input", "rating": 3, "is_widget": True},\n    ]\n)\nedited_df = st.data_editor(\n    df,\n    column_config={\n        "command": "Streamlit Command",\n        "rating": st.column_config.NumberColumn(\n            "Your rating",\n            help="How much do you like this command (1-5)?",\n            min_value=1,\n            max_value=5,\n            step=1,\n            format="%d \u2b50",\n        ),\n        "is_widget": "Widget ?",\n    },\n    disabled=["command", "is_widget"],\n    hide_index=True,\n)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n
\n", + "description": "

Display a data editor widget.

\n

The data editor widget allows you to edit dataframes and many other data structures in a table-like UI.

\n
\n

Warning

\n

When going from st.experimental_data_editor to st.data_editor in\n1.23.0, the data editor's representation in st.session_state was changed.\nThe edited_cells dictionary is now called edited_rows and uses a\ndifferent format ({0: {"column name": "edited value"}} instead of\n{"0:1": "edited value"}). You may need to adjust the code if your app uses\nst.experimental_data_editor in combination with st.session_state."

\n
\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None", + "is_optional": false, + "description": "

The data to edit in the data editor.

\n
\n

Note

\n

Mixing data types within a column can make the column uneditable.\nAdditionally, the following data types are not yet supported for editing:\ncomplex, list, tuple, bytes, bytearray, memoryview, dict, set, frozenset,\ndatetime.timedelta, decimal.Decimal, fractions.Fraction, pandas.Interval,\npandas.Period, pandas.Timedelta.

\n
\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the data editor expressed in pixels. If None, the width will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the data editor expressed in pixels. If None, the height will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the data editor width to the width of the parent container.\nThis takes precedence over the width argument. Defaults to False.

\n", + "default": "False." + }, + { + "name": "hide_index", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether to hide the index column(s). If None (default), the visibility of\nindex columns is automatically determined based on the data.

\n", + "default": null + }, + { + "name": "column_order", + "type_name": "iterable of str or None", + "is_optional": false, + "description": "

Specifies the display order of columns. This also affects which columns are\nvisible. For example, column_order=("col2", "col1") will display 'col2'\nfirst, followed by 'col1', and will hide all other non-index columns. If\nNone (default), the order is inherited from the original data structure.

\n", + "default": null + }, + { + "name": "column_config", + "type_name": "dict or None", + "is_optional": false, + "description": "

Configures how columns are displayed, e.g. their title, visibility, type, or\nformat, as well as editing properties such as min/max value or step.\nThis needs to be a dictionary where each key is a column name and the value\nis one of:

\n
    \n
  • None to hide the column.
  • \n
  • A string to set the display label of the column.
  • \n
  • One of the column types defined under st.column_config, e.g.\nst.column_config.NumberColumn("Dollar values\u201d, format=\u201d$ %d") to show\na column as dollar amounts. See more info on the available column types\nand config options here.
  • \n
\n

To configure the index column(s), use _index as the column name.

\n", + "default": null + }, + { + "name": "num_rows", + "type_name": "\"fixed\" or \"dynamic\"", + "is_optional": false, + "description": "

Specifies if the user can add and delete rows in the data editor.\nIf "fixed", the user cannot add or delete rows. If "dynamic", the user can\nadd and delete rows in the data editor, but column sorting is disabled.\nDefaults to "fixed".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool or iterable of str", + "is_optional": false, + "description": "

Controls the editing of columns. If True, editing is disabled for all columns.\nIf an iterable of column names is provided (e.g., disabled=("col1", "col2")),\nonly the specified columns will be disabled for editing. If False (default),\nall columns that support editing are editable.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the unique key for this widget. If this\nis omitted, a key will be generated for the widget based on its\ncontent. Multiple widgets of the same type may not share the same\nkey.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this data_editor's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "pandas.DataFrame, pandas.Series, pyarrow.Table, numpy.ndarray, list, set, tuple, or dict.", + "is_generator": false, + "description": "

The edited data. The edited data is returned in its original data type if\nit corresponds to any of the supported return types. All other data types\nare returned as a pd.DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/data_editor.py#L527" + }, + "streamlit.experimental_get_query_params": { + "name": "experimental_get_query_params", + "signature": "st.experimental_get_query_params()", + "example": "
\n

Let's say the user's web browser is at\nhttp://localhost:8501/?show_map=True&selected=asia&selected=america.\nThen, you can get the query parameters using the following:

\n
\nimport streamlit as st\n\nst.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\n

Note that the values in the returned dict are always lists. This is\nbecause we internally use Python's urllib.parse.parse_qs(), which behaves\nthis way. And this behavior makes sense when you consider that every item\nin a query string is potentially a 1-element array.

\n
\n", + "description": "

Return the query parameters that is currently showing in the browser's URL bar.

\n", + "args": [], + "returns": [ + { + "type_name": "dict", + "is_generator": false, + "description": "

The current query parameters as a dict. "Query parameters" are the part of the URL that comes\nafter the first "?".

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/commands/query_params.py#L29" + }, + "streamlit.experimental_memo": { + "name": "experimental_memo", + "signature": "st.experimental_memo(func=None, *, ttl, max_entries, show_spinner, persist, experimental_allow_widgets)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\nimport streamlit as st\n\n@st.cache_data(persist="disk")\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

By default, all parameters to a cached function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nconnection = make_database_connection()\nd1 = fetch_and_clean_data(connection, num_rows=10)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nanother_connection = make_database_connection()\nd2 = fetch_and_clean_data(another_connection, num_rows=10)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _database_connection parameter was different\n# in both calls.\n
\n

A cached function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nfetch_and_clean_data.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Decorator to cache functions that return data (e.g. dataframe transforms, database queries, ML inference).

\n

Cached objects are stored in "pickled" form, which means that the return\nvalue of a cached function must be pickleable. Each caller of the cached\nfunction gets its own copy of the cached data.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_data.clear().

\n

To cache global resources, use st.cache_resource instead. Learn more\nabout caching at https://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to cache. Streamlit hashes the function's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float, timedelta, str, or None", + "is_optional": false, + "description": "

The maximum time to keep an entry in the cache. Can be one of:

\n\n

Note that ttl will be ignored if persist="disk" or persist=True.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. When a new entry is added to a full cache,\nthe oldest cached entry will be removed. Defaults to None.

\n", + "default": "None." + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached data is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "persist", + "type_name": "\"disk\", boolean, or None", + "is_optional": false, + "description": "

Optional location to persist cached data to. Passing "disk" (or True)\nwill persist the cached data to the local disk. None (or False) will disable\npersistence. The default is None.

\n", + "default": "None." + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/runtime/caching/cache_data_api.py#L378" + }, + "streamlit.experimental_rerun": { + "name": "experimental_rerun", + "signature": "st.experimental_rerun()", + "description": "

Rerun the script immediately.

\n

When st.experimental_rerun() is called, the script is halted - no\nmore statements will be run, and the script will be queued to re-run\nfrom the top.

\n

If this function is called outside of Streamlit, it will raise an\nException.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/commands/execution_control.py#L46" + }, + "streamlit.experimental_set_query_params": { + "name": "experimental_set_query_params", + "signature": "st.experimental_set_query_params(**query_params)", + "example": "
\n

To point the user's web browser to something like\n"http://localhost:8501/?show_map=True&selected=asia&selected=america",\nyou would do the following:

\n
\nimport streamlit as st\n\nst.experimental_set_query_params(\n    show_map=True,\n    selected=["asia", "america"],\n)\n
\n
\n", + "description": "

Set the query parameters that are shown in the browser's URL bar.

\n
\n

Warning

\n

Query param embed cannot be set using this method.

\n
\n", + "args": [ + { + "name": "**query_params", + "type_name": "dict", + "is_optional": false, + "description": "

The query parameters to set, as key-value pairs.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/commands/query_params.py#L65" + }, + "streamlit.experimental_singleton": { + "name": "experimental_singleton", + "signature": "st.experimental_singleton(func, *, ttl, max_entries, show_spinner, validate, experimental_allow_widgets)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(url):\n    # Create a database session object that points to the URL.\n    return session\n\ns1 = get_database_session(SESSION_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(SESSION_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the connection object in s1 is the same as in s2.\n\ns3 = get_database_session(SESSION_URL_2)\n# This is a different URL, so the function executes.\n
\n

By default, all parameters to a cache_resource function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\ns1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _sessionmaker parameter was different\n# in both calls.\n
\n

A cache_resource function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\nget_database_session.clear()\n# Clear all cached entries for this function.\n
\n
\n", + "description": "

Decorator to cache functions that return global resources (e.g. database connections, ML models).

\n

Cached objects are shared across all users, sessions, and reruns. They\nmust be thread-safe because they can be accessed from multiple threads\nconcurrently. If thread safety is an issue, consider using st.session_state\nto store resources per session instead.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_resource.clear().

\n

To cache data, use st.cache_data instead. Learn more about caching at\nhttps://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function that creates the cached resource. Streamlit hashes the\nfunction's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float, timedelta, str, or None", + "is_optional": false, + "description": "

The maximum time to keep an entry in the cache. Can be one of:

\n\n

Note that ttl will be ignored if persist="disk" or persist=True.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. When a new entry is added to a full cache,\nthe oldest cached entry will be removed. Defaults to None.

\n", + "default": "None." + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached resource is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "validate", + "type_name": "callable or None", + "is_optional": false, + "description": "

An optional validation function for cached data. validate is called\neach time the cached value is accessed. It receives the cached value as\nits only parameter and it must return a boolean. If validate returns\nFalse, the current cached value is discarded, and the decorated function\nis called to compute a new value. This is useful e.g. to check the\nhealth of database connections.

\n", + "default": null + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/runtime/caching/cache_resource_api.py#L258" + }, + "streamlit.file_uploader": { + "name": "file_uploader", + "signature": "st.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nimport streamlit as st\nimport pandas as pd\nfrom io import StringIO\n\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nimport streamlit as st\n\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n
\n", + "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this file uploader is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str or list of str or None", + "is_optional": false, + "description": "

Array of allowed extensions. ['png', 'jpg']\nThe default is None, which means all extensions are allowed.

\n", + "default": "None" + }, + { + "name": "accept_multiple_files", + "type_name": "bool", + "is_optional": false, + "description": "

If True, allows the user to upload multiple files at the same time,\nin which case the return value will be a list of files.\nDefault: False

\n", + "default": "False" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the file uploader.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this file_uploader's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the file uploader if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile or list of UploadedFile", + "is_generator": false, + "description": "
    \n
  • If accept_multiple_files is False, returns either None or\nan UploadedFile object.
  • \n
  • If accept_multiple_files is True, returns a list with the\nuploaded files as UploadedFile objects. If no files were\nuploaded, returns an empty list.
  • \n
\n

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/file_uploader.py#L214" + }, + "streamlit.form": { + "name": "form", + "signature": "st.form(key, clear_on_submit=False)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n

Inserting elements out of order:

\n
\nimport streamlit as st\n\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n
\n", + "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

A string that identifies the form. Each form must have its own\nkey. (This key is not displayed to the user in the interface.)

\n", + "default": null + }, + { + "name": "clear_on_submit", + "type_name": "bool", + "is_optional": false, + "description": "

If True, all widgets inside the form will be reset to their default\nvalues after the user presses the Submit button. Defaults to False.\n(Note that Custom Components are unaffected by this flag, and\nwill not be reset to their defaults on form submission.)

\n", + "default": "values" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/form.py#L118" + }, + "streamlit.form_submit_button": { + "name": "form_submit_button", + "signature": "st.form_submit_button(label=\"Submit\", help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nDefaults to "Submit".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

A tooltip that gets displayed when the button is hovered over.\nDefaults to None.

\n", + "default": "None." + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/form.py#L211" + }, + "streamlit.get_option": { + "name": "get_option", + "signature": "st.get_option(key)", + "description": "

Return the current value of a given Streamlit config option.

\n

Run streamlit config show in the terminal to see all available options.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

The config option key of the form "section.optionName". To see all\navailable options, run streamlit config show on a terminal.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/config.py#L131" + }, + "streamlit.graphviz_chart": { + "name": "graphviz_chart", + "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nimport graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n
\n", + "description": "

Display a graph using the dagre-d3 library.

\n", + "args": [ + { + "name": "figure_or_dot", + "type_name": "graphviz.dot.Graph, graphviz.dot.Digraph, str", + "is_optional": false, + "description": "

The Graphlib graph object or dot string to display

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/graphviz_chart.py#L39" + }, + "streamlit.header": { + "name": "header", + "signature": "st.header(body, anchor=None, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.header('This is a header')\nst.header('A header with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in header formatting.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str or False", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the header.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/heading.py#L40" + }, + "streamlit.help": { + "name": "help", + "signature": "st.help(obj=)", + "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nimport streamlit as st\nimport pandas\n\nst.help(pandas.DataFrame)\n
\n\n \n

Want to quickly check what data type is output by a certain function?\nTry:

\n
\nimport streamlit as st\n\nx = my_poorly_documented_function()\nst.help(x)\n
\n

Want to quickly inspect an object? No sweat:

\n
\nclass Dog:\n  '''A typical dog.'''\n\n  def __init__(self, breed, color):\n    self.breed = breed\n    self.color = color\n\n  def bark(self):\n    return 'Woof!'\n\n\nfido = Dog('poodle', 'white')\n\nst.help(fido)\n
\n\n \n

And if you're using Magic, you can get help for functions, classes,\nand modules without even typing st.help:

\n
\nimport streamlit as st\nimport pandas\n\n# Get help for Pandas read_csv:\npandas.read_csv\n\n# Get help for Streamlit itself:\nst\n
\n\n \n
\n", + "description": "

Display help and other information for a given object.

\n

Depending on the type of object that is passed in, this displays the\nobject's name, type, value, signature, docstring, and member variables,\nmethods \u2014 as well as the values/docstring of members and methods.

\n", + "args": [ + { + "name": "obj", + "type_name": "any", + "is_optional": false, + "description": "

The object whose information should be displayed. If left\nunspecified, this call will display help for Streamlit itself.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/doc_string.py#L49" + }, + "streamlit.image": { + "name": "image", + "signature": "st.image(image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", + "example": "
\n
\nimport streamlit as st\nfrom PIL import Image\n\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n
\n", + "description": "

Display an image or list of images.

\n", + "args": [ + { + "name": "image", + "type_name": "numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]", + "is_optional": false, + "description": "

Monochrome image of shape (w,h) or (w,h,1)\nOR a color image of shape (w,h,3)\nOR an RGBA image of shape (w,h,4)\nOR a URL to fetch the image from\nOR a path of a local image file\nOR an SVG XML string like <svg xmlns=...</svg>\nOR a list of one of the above, to display multiple images.

\n", + "default": null + }, + { + "name": "caption", + "type_name": "str or list of str", + "is_optional": false, + "description": "

Image caption. If displaying multiple images, caption should be a\nlist of captions (one for each image).

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Image width. None means use the image width,\nbut do not exceed the width of the column.\nShould be set for SVG images, as they have no default image width.

\n", + "default": "image" + }, + { + "name": "use_column_width", + "type_name": "\"auto\", \"always\", \"never\", or bool", + "is_optional": false, + "description": "

If "auto", set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf "always" or True, set the image's width to the column width.\nIf "never" or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", + "default": null + }, + { + "name": "clamp", + "type_name": "bool", + "is_optional": false, + "description": "

Clamp image pixel values to a valid range ([0-255] per channel).\nThis is only meaningful for byte array images; the parameter is\nignored for image URLs. If this is not set, and an image has an\nout-of-range value, an error will be thrown.

\n", + "default": null + }, + { + "name": "channels", + "type_name": "\"RGB\" or \"BGR\"", + "is_optional": false, + "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to "RGB", meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to "BGR", instead.

\n", + "default": "s" + }, + { + "name": "output_format", + "type_name": "\"JPEG\", \"PNG\", or \"auto\"", + "is_optional": false, + "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to "auto" which identifies the compression type based\non the type and format of the image argument.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/image.py#L88" + }, + "streamlit.info": { + "name": "info", + "signature": "st.info(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", + "description": "

Display an informational message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The info text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/alert.py#L103" + }, + "streamlit.json": { + "name": "json", + "signature": "st.json(body, *, expanded=True)", + "example": "
\n
\nimport streamlit as st\n\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n
\n", + "description": "

Display object or string as a pretty-printed JSON string.

\n", + "args": [ + { + "name": "body", + "type_name": "object or str", + "is_optional": false, + "description": "

The object to print as JSON. All referenced objects should be\nserializable to JSON as well. If object is a string, we assume it\ncontains serialized JSON.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean that allows the user to set whether the initial\nstate of this json element should be expanded. Defaults to True.\nThis argument can only be supplied by keyword.

\n", + "default": "True." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/json.py#L35" + }, + "streamlit.latex": { + "name": "latex", + "signature": "st.latex(body, *, help=None)", + "example": "
\n
\nimport streamlit as st\n\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", + "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", + "args": [ + { + "name": "body", + "type_name": "str or SymPy expression", + "is_optional": false, + "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the LaTeX expression.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/markdown.py#L196" + }, + "streamlit.line_chart": { + "name": "line_chart", + "signature": "st.line_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\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 \n
\n", + "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict or None", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/dataframe_selector.py#L230" + }, + "streamlit.map": { + "name": "map", + "signature": "st.map(data=None, zoom=None, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n
\n", + "description": "

Display a map with points on it.

\n

This is a wrapper around st.pydeck_chart to quickly create\nscatterplot charts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to be plotted. Must have two columns:

\n
    \n
  • latitude called 'lat', 'latitude', 'LAT', 'LATITUDE'
  • \n
  • longitude called 'lon', 'longitude', 'LON', 'LONGITUDE'.
  • \n
\n", + "default": null + }, + { + "name": "zoom", + "type_name": "int", + "is_optional": false, + "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/map.py#L76" + }, + "streamlit.markdown": { + "name": "markdown", + "signature": "st.markdown(body, unsafe_allow_html=False, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.markdown('Streamlit is **_really_ cool**.')\nst.markdown("This text is :red[colored red], and this is **:blue[colored]** and bold.")\nst.markdown(":green[$\\sqrt{x^2+y^2}=1$] is a Pythagorean identity. :pencil:")\n
\n
\n", + "description": "

Display string formatted as Markdown.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the Markdown.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/markdown.py#L31" + }, + "streamlit.metric": { + "name": "metric", + "signature": "st.metric(label, value, delta=None, delta_color=\"normal\", help=None, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n

st.metric looks especially nice in combination with st.columns:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n

The delta indicator color can also be inverted or turned off:

\n
\nimport streamlit as st\n\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n
\n", + "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

The header or title for the metric. The label can optionally contain\nMarkdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Value of the metric. None is rendered as a long dash.

\n", + "default": null + }, + { + "name": "delta", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Indicator of how the metric changed, rendered with an arrow below\nthe metric. If delta is negative (int/float) or starts with a minus\nsign (str), the arrow points down and the text is red; else the\narrow points up and the text is green. If None (default), no delta\nindicator is shown.

\n", + "default": null + }, + { + "name": "delta_color", + "type_name": "\"normal\", \"inverse\", or \"off\"", + "is_optional": false, + "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the metric label.

\n", + "default": null + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/metric.py#L46" + }, + "streamlit.multiselect": { + "name": "multiselect", + "signature": "st.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", max_selections=None)", + "example": "
\n
\nimport streamlit as st\n\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n
\n", + "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence[V], numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "default", + "type_name": "[V], V, or None", + "is_optional": false, + "description": "

List of default values. Can also be a single value.

\n", + "default": "values." + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of selectbox options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe multiselect.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the multiselect.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this multiselect's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the multiselect widget if set\nto True. The default is False. This argument can only be supplied\nby keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "max_selections", + "type_name": "int", + "is_optional": false, + "description": "

The max selections that can be selected at a time.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list", + "is_generator": false, + "description": "

A list with the selected options

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/multiselect.py#L145" + }, + "streamlit.number_input": { + "name": "number_input", + "signature": "st.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n
\n", + "description": "

Display a numeric input widget.

\n
\n

Note

\n

Integer values exceeding +/- (1<<53) - 1 cannot be accurately\nstored or returned by the widget due to serialization contstraints\nbetween the Python server and JavaScript client. You must handle\nsuch numbers as floats, leading to a loss in precision.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. Output must be purely numeric. This does not impact\nthe return value. Valid formatters: %d %e %f %g %i %u

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this number_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the number input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int or float", + "is_generator": false, + "description": "

The current value of the numeric input widget. The return type\nwill match the data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/number_input.py#L66" + }, + "streamlit.plotly_chart": { + "name": "plotly_chart", + "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", theme=\"streamlit\", **kwargs)", + "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport numpy as np\nimport plotly.figure_factory as ff\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n        hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n
\n", + "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", + "args": [ + { + "name": "figure_or_data", + "type_name": "plotly.graph_objs.Figure, plotly.graph_objs.Data,", + "is_optional": false, + "description": "

dict/list of plotly.graph_objs.Figure/Data

\n

See https://plot.ly/python/ for examples of graph descriptions.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + }, + { + "name": "sharing", + "type_name": "\"streamlit\", \"private\", \"secret\", or \"public\"", + "is_optional": false, + "description": "

Use "streamlit" to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": null, + "is_optional": null, + "description": "

Any argument accepted by Plotly's plot() function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/plotly_chart.py#L81" + }, + "streamlit.progress": { + "name": "progress", + "signature": "st.progress(value, text=None)", + "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport streamlit as st\nimport time\n\nprogress_text = "Operation in progress. Please wait."\nmy_bar = st.progress(0, text=progress_text)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1, text=progress_text)\n
\n
\n", + "description": "

Display a progress bar.

\n", + "args": [ + { + "name": "value", + "type_name": "int or float", + "is_optional": false, + "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", + "default": null + }, + { + "name": "text", + "type_name": "str or None", + "is_optional": false, + "description": "

A message to display above the progress bar. The text can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/progress.py#L66" + }, + "streamlit.pydeck_chart": { + "name": "pydeck_chart", + "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)", + "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport pydeck as pdk\n\nchart_data = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=chart_data,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=chart_data,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", + "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "args": [ + { + "name": "pydeck_obj", + "type_name": "pydeck.Deck or None", + "is_optional": false, + "description": "

Object specifying the PyDeck chart to draw.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/deck_gl_json_chart.py#L36" + }, + "streamlit.pyplot": { + "name": "pyplot", + "signature": "st.pyplot(fig=None, clear_figure=None, use_container_width=True, **kwargs)", + "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", + "example": "
\n
\nimport streamlit as st\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n
\n", + "description": "

Display a matplotlib.pyplot figure.

\n", + "args": [ + { + "name": "fig", + "type_name": "Matplotlib Figure", + "is_optional": false, + "description": "

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

\n", + "default": null + }, + { + "name": "clear_figure", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", + "default": "based" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n", + "default": "s" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Arguments to pass to Matplotlib's savefig function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/pyplot.py#L38" + }, + "streamlit.radio": { + "name": "radio", + "signature": "st.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ngenre = st.radio(\n    "What\\'s your favorite movie genre",\n    ('Comedy', 'Drama', 'Documentary'))\n\nif genre == 'Comedy':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn\\'t select comedy.")\n
\n\n \n
\n", + "description": "

Display a radio button widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this radio group is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the radio options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of radio options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe radio.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the radio.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this radio's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the radio button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "horizontal", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", + "default": "false" + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/radio.py#L75" + }, + "streamlit.select_slider": { + "name": "select_slider", + "signature": "st.select_slider(label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\nimport streamlit as st\n\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nimport streamlit as st\n\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n ", + "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the slider options. All options will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", + "default": "." + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to first option.

\n", + "default": "first" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels from the options.\nargument. It receives the option as an argument and its output\nwill be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the select slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this select_slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the select slider if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any value or tuple of any value", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/select_slider.py#L106" + }, + "streamlit.selectbox": { + "name": "selectbox", + "signature": "st.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n
\n", + "description": "

Display a select widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels. It receives the option\nas an argument and its output will be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the selectbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this selectbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the selectbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/selectbox.py#L71" + }, + "streamlit.set_option": { + "name": "set_option", + "signature": "st.set_option(key, value)", + "description": "

Set config option.

\n
\n
Currently, only the following config options can be set within the script itself:
\n
    \n
  • client.caching
  • \n
  • client.displayEnabled
  • \n
  • deprecation.*
  • \n
\n
\n
\n

Calling with any other options will raise StreamlitAPIException.

\n

Run streamlit config show in the terminal to see all available options.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

The config option key of the form "section.optionName". To see all\navailable options, run streamlit config show on a terminal.

\n", + "default": null + }, + { + "name": "value", + "type_name": null, + "is_optional": null, + "description": "

The new value to assign to this config option.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/config.py#L92" + }, + "streamlit.set_page_config": { + "name": "set_page_config", + "signature": "st.set_page_config(page_title=None, page_icon=None, layout=\"centered\", initial_sidebar_state=\"auto\", menu_items=None)", + "example": "
\nimport streamlit as st\n\nst.set_page_config(\n    page_title="Ex-stream-ly Cool App",\n    page_icon="\ud83e\uddca",\n    layout="wide",\n    initial_sidebar_state="expanded",\n    menu_items={\n        'Get Help': 'https://www.extremelycoolapp.com/help',\n        'Report a bug': "https://www.extremelycoolapp.com/bug",\n        'About': "# This is a header. This is an *extremely* cool app!"\n    }\n)\n
\n", + "description": "

Configures the default settings of the page.

\n
\n

Note

\n

This must be the first Streamlit command used on an app page, and must only\nbe set once per page.

\n
\n", + "args": [ + { + "name": "page_title", + "type_name": "str or None", + "is_optional": false, + "description": "

The page title, shown in the browser tab. If None, defaults to the\nfilename of the script ("app.py" would show "app \u2022 Streamlit").

\n", + "default": "the" + }, + { + "name": "page_icon", + "type_name": "Anything supported by st.image or str or None", + "is_optional": false, + "description": "

The page favicon.\nBesides the types supported by st.image (like URLs or numpy arrays),\nyou can pass in an emoji as a string ("\ud83e\udd88") or a shortcode (":shark:").\nIf you're feeling lucky, try "random" for a random emoji!\nEmoji icons are courtesy of Twemoji and loaded from MaxCDN.

\n", + "default": null + }, + { + "name": "layout", + "type_name": "\"centered\" or \"wide\"", + "is_optional": false, + "description": "

How the page content should be laid out. Defaults to "centered",\nwhich constrains the elements into a centered column of fixed width;\n"wide" uses the entire screen.

\n", + "default": "s" + }, + { + "name": "initial_sidebar_state", + "type_name": "\"auto\", \"expanded\", or \"collapsed\"", + "is_optional": false, + "description": "

How the sidebar should start out. Defaults to "auto",\nwhich hides the sidebar on mobile-sized devices, and shows it otherwise.\n"expanded" shows the sidebar initially; "collapsed" hides it.

\n", + "default": "s" + }, + { + "name": "menu_items", + "type_name": "dict", + "is_optional": false, + "description": "

Configure the menu that appears on the top-right side of this app.\nThe keys in this dict denote the menu item you'd like to configure:

\n
    \n
  • \n
    "Get help": str or None
    \n
    The URL this menu item should point to.\nIf None, hides this menu item.
    \n
    \n
  • \n
  • \n
    "Report a Bug": str or None
    \n
    The URL this menu item should point to.\nIf None, hides this menu item.
    \n
    \n
  • \n
  • \n
    "About": str or None
    \n
    A markdown string to show in the About dialog.\nIf None, only shows Streamlit's default About text.
    \n
    \n
  • \n
\n

The URL may also refer to an email address e.g. mailto:john@example.com.

\n", + "default": "About" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/commands/page_config.py#L114" + }, + "streamlit.slider": { + "name": "slider", + "signature": "st.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nimport streamlit as st\n\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nimport streamlit as st\nfrom datetime import time\n\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nimport streamlit as st\nfrom datetime import datetime\n\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n
\n", + "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n
\n

Note

\n

Integer values exceeding +/- (1<<53) - 1 cannot be accurately\nstored or returned by the widget due to serialization contstraints\nbetween the Python server and JavaScript client. You must handle\nsuch numbers as floats, leading to a loss in precision.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The minimum permitted value.\nDefaults to 0 if the value is an int, 0.0 if a float,\nvalue - timedelta(days=14) if a date/datetime, time.min if a time

\n", + "default": "0" + }, + { + "name": "max_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The maximum permitted value.\nDefaults to 100 if the value is an int, 1.0 if a float,\nvalue + timedelta(days=14) if a date/datetime, time.max if a time

\n", + "default": "100" + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to min_value.

\n", + "default": "min_value." + }, + { + "name": "step", + "type_name": "int, float, timedelta, or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. This does not impact the return value.\nFormatter for int/float supports: %d %e %f %g %i\nFormatter for date/time/datetime uses Moment.js notation:\nhttps://momentjs.com/docs/#/displaying/format/

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the slider if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int/float/date/time/datetime or tuple of int/float/date/time/datetime", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/slider.py#L171" + }, + "streamlit.snow": { + "name": "snow", + "signature": "st.snow()", + "example": "
\n
\nimport streamlit as st\n\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", + "description": "

Draw celebratory snowfall.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/snow.py#L25" + }, + "streamlit.spinner": { + "name": "spinner", + "signature": "st.spinner(text=\"In progress...\")", + "example": "
\n
\nimport time\nimport streamlit as st\n\nwith st.spinner('Wait for it...'):\n    time.sleep(5)\nst.success('Done!')\n
\n
\n", + "description": "

Temporarily displays a message while executing a block of code.

\n", + "args": [ + { + "name": "text", + "type_name": "str", + "is_optional": false, + "description": "

A message to display while executing that block

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/spinner.py#L23" + }, + "streamlit.stop": { + "name": "stop", + "signature": "st.stop()", + "example": "
\n
\nimport streamlit as st\n\nname = st.text_input('Name')\nif not name:\n  st.warning('Please input a name.')\n  st.stop()\nst.success('Thank you for inputting a name.')\n
\n
\n", + "description": "

Stops execution immediately.

\n

Streamlit will not run any statements after st.stop().\nWe recommend rendering a message to explain why the script has stopped.\nWhen run outside of Streamlit, this will raise an Exception.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/commands/execution_control.py#L25" + }, + "streamlit.subheader": { + "name": "subheader", + "signature": "st.subheader(body, anchor=None, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.subheader('This is a subheader')\nst.subheader('A subheader with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in subheader formatting.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str or False", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the subheader.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/heading.py#L93" + }, + "streamlit.success": { + "name": "success", + "signature": "st.success(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", + "description": "

Display a success message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The success text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/alert.py#L136" + }, + "streamlit.table": { + "name": "table", + "signature": "st.table(data=None)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n
\n", + "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/dataframe_selector.py#L192" + }, + "streamlit.tabs": { + "name": "tabs", + "signature": "st.tabs(tabs)", + "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\nimport streamlit as st\n\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n
\n", + "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", + "args": [ + { + "name": "tabs", + "type_name": "list of strings", + "is_optional": false, + "description": "

Creates a tab for each string in the list. The first tab is selected by default.\nThe string is used as the name of the tab and can optionally contain Markdown,\nsupporting the following elements: Bold, Italics, Strikethroughs, Inline Code,\nEmojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": "." + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/layouts.py#L205" + }, + "streamlit.text": { + "name": "text", + "signature": "st.text(body, *, help=None)", + "example": "
\n
\nimport streamlit as st\n\nst.text('This is some text.')\n
\n
\n", + "description": "

Write fixed-width and preformatted text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the text.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/text.py#L27" + }, + "streamlit.text_area": { + "name": "text_area", + "signature": "st.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", + "description": "

Display a multi-line text input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Maximum number of characters allowed in text area.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the textarea.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_area's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text area is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text area if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/text_widgets.py#L274" + }, + "streamlit.text_input": { + "name": "text_input", + "signature": "st.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n
\n", + "description": "

Display a single-line text input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Max number of characters allowed in text input.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"default\" or \"password\"", + "is_optional": false, + "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "autocomplete", + "type_name": "str", + "is_optional": false, + "description": "

An optional value that will be passed to the <input> element's\nautocomplete property. If unspecified, this value will be set to\n"new-password" for "password" inputs, and the empty string for\n"default" inputs. For more details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text input is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/text_widgets.py#L71" + }, + "streamlit.time_input": { + "name": "time_input", + "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", step=0:15:00)", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n
\n", + "description": "

Display a time input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this time input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.time/datetime.datetime", + "is_optional": false, + "description": "

The value of this widget when it first renders. This will be\ncast to str internally. Defaults to the current time.

\n", + "default": "the" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this time_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the time input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "step", + "type_name": "int or timedelta", + "is_optional": false, + "description": "

The stepping interval in seconds. Defaults to 900, i.e. 15 minutes.\nYou can also pass a datetime.timedelta object.

\n", + "default": "900" + } + ], + "returns": [ + { + "type_name": "datetime.time", + "is_generator": false, + "description": "

The current value of the time input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/time_widgets.py#L213" + }, + "streamlit.title": { + "name": "title", + "signature": "st.title(body, anchor=None, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.title('This is a title')\nst.title('A title with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str or False", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the title.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/heading.py#L146" + }, + "streamlit.vega_lite_chart": { + "name": "vega_lite_chart", + "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, theme=\"streamlit\", **kwargs)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(chart_data, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", + "description": "

Display a chart using the Vega-Lite library.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "spec", + "type_name": "dict or None", + "is_optional": false, + "description": "

The Vega-Lite spec for the chart. If the spec was already passed in\nthe previous argument, this must be set to None. See\nhttps://vega.github.io/vega-lite/docs/ for more info.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Same as spec, but as keywords.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/dataframe_selector.py#L545" + }, + "streamlit.video": { + "name": "video", + "signature": "st.video(data, format=\"video/mp4\", start_time=0)", + "example": "
\n
\nimport streamlit as st\n\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", + "description": "

Display a video player.

\n", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "default": null + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the video file. Defaults to 'video/mp4'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/media.py#L116" + }, + "streamlit.warning": { + "name": "warning", + "signature": "st.warning(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", + "description": "

Display warning message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The warning text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/alert.py#L71" + }, + "streamlit.write": { + "name": "write", + "signature": "st.write(*args, unsafe_allow_html=False, **kwargs)", + "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nimport streamlit as st\n\nst.write('Hello, *World!* :sunglasses:')\n
\n\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nimport streamlit as st\nimport pandas as pd\n\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nimport streamlit as st\n\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n
\n", + "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression, emoji shortcodes, and colored text.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(class) : Displays information about a class.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/write.py#L49" + }, + "streamlit.experimental_memo.clear": { + "name": "experimental_memo.clear", + "signature": "st.experimental_memo.clear()", + "description": "

Clear all in-memory and on-disk data caches.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/runtime/caching/cache_data_api.py#L549" + }, + "streamlit.cache_data.clear": { + "name": "cache_data.clear", + "signature": "st.cache_data.clear()", + "description": "

Clear all in-memory and on-disk data caches.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/runtime/caching/cache_data_api.py#L549" + }, + "streamlit.experimental_singleton.clear": { + "name": "experimental_singleton.clear", + "signature": "st.experimental_singleton.clear()", + "description": "

Clear all cache_resource caches.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/runtime/caching/cache_resource_api.py#L406" + }, + "streamlit.cache_resource.clear": { + "name": "cache_resource.clear", + "signature": "st.cache_resource.clear()", + "description": "

Clear all cache_resource caches.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/runtime/caching/cache_resource_api.py#L406" + }, + "streamlit.connections.ExperimentalBaseConnection": { + "name": "ExperimentalBaseConnection", + "signature": "st.connections.ExperimentalBaseConnection(connection_name, **kwargs)", + "is_class": true, + "methods": [ + { + "name": "reset", + "signature": "st.connections.reset.reset()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", + "description": "

Reset this connection so that it gets reinitialized the next time it's used.

", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/connections/base_connection.py#L137" + } + ], + "properties": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/connections/base_connection.py#L25", + "description": "

The abstract base class that all Streamlit Connections must inherit from.

\n

This base class provides connection authors with a standardized way to hook into the\nst.experimental_connection() factory function: connection authors are required to\nprovide an implementation for the abstract method _connect in their subclasses.

\n

Additionally, it also provides a few methods/properties designed to make\nimplementation of connections more convenient. See the docstrings for each of the\nmethods of this class for more information

\n
\n

Note

\n

While providing an implementation of _connect is technically all that's\nrequired to define a valid connection, connections should also provide the user\nwith context-specific ways of interacting with the underlying connection object.\nFor example, the first-party SQLConnection provides a query() method for\nreads and a session property for more complex operations.

\n
\n", + "args": [], + "returns": [] + }, + "streamlit.connections.SQLConnection": { + "name": "SQLConnection", + "signature": "st.connections.SQLConnection(connection_name, **kwargs)", + "is_class": true, + "methods": [ + { + "name": "query", + "signature": "st.connections.query.query(sql, *, ttl=None, index_col=None, chunksize=None, params=None, **kwargs)", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("sql")\ndf = conn.query("select * from pet_owners where owner = :owner", ttl=3600, params={"owner":"barbara"})\nst.dataframe(df)\n
\n
\n", + "description": "

Run a read-only query.

", + "args": [ + { + "name": "sql", + "type_name": "str", + "is_optional": false, + "description": "

The read-only SQL query to execute.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float, int, timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep results in the cache, or\nNone if cached results should not expire. The default is None.

\n", + "default": "None." + }, + { + "name": "index_col", + "type_name": "str, list of str, or None", + "is_optional": false, + "description": "

Column(s) to set as index(MultiIndex). Default is None.

\n", + "default": "None." + }, + { + "name": "chunksize", + "type_name": "int or None", + "is_optional": false, + "description": "

If specified, return an iterator where chunksize is the number of\nrows to include in each chunk. Default is None.

\n", + "default": "None." + }, + { + "name": "params", + "type_name": "list, tuple, dict or None", + "is_optional": false, + "description": "

List of parameters to pass to the execute method. The syntax used to pass\nparameters is database driver dependent. Check your database driver\ndocumentation for which of the five syntax styles, described in PEP 249\nparamstyle, is supported.\nDefault is None.

\n", + "default": "None." + }, + { + "name": "**kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

Additional keyword arguments are passed to pd.read_sql.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "pd.DataFrame", + "is_generator": false, + "description": "

The result of running the query, formatted as a pandas DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/connections/sql_connection.py#L121" + }, + { + "name": "reset", + "signature": "st.connections.reset.reset()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", + "description": "

Reset this connection so that it gets reinitialized the next time it's used.

", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/connections/base_connection.py#L137" + } + ], + "properties": [ + { + "name": "session", + "signature": "st.connections.session.session", + "example": "
\n
\nimport streamlit as st\nconn = st.experimental_connection("sql")\nn = st.slider("Pick a number")\nif st.button("Add the number!"):\n    with conn.session as session:\n        session.execute("INSERT INTO numbers (val) VALUES (:n);", {"n": n})\n        session.commit()\n
\n
\n", + "description": "

Return a SQLAlchemy Session.

", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/connections/sql_connection.py#L226" + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/connections/sql_connection.py#L45", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("sql")\ndf = conn.query("select * from pet_owners")\nst.dataframe(df)\n
\n
\n", + "description": "

A connection to a SQL database using a SQLAlchemy Engine. Initialize using st.experimental_connection("<name>", type="sql").

\n

SQLConnection provides the query() convenience method, which can be used to\nrun simple read-only queries with both caching and simple error handling/retries.\nMore complex DB interactions can be performed by using the .session property\nto receive a regular SQLAlchemy Session.

\n

SQLConnections should always be created using st.experimental_connection(),\nnot initialized directly. Connection parameters for a SQLConnection can be\nspecified using either st.secrets or **kwargs. Some frequently used\nparameters include:

\n
    \n
  • url or arguments for sqlalchemy.engine.URL.create().\nMost commonly it includes a dialect, host, database, username and password.
  • \n
  • create_engine_kwargs can be passed via st.secrets, such as for\nsnowflake-sqlalchemy\nor Google BigQuery.\nThese can also be passed directly as **kwargs to experimental_connection().
  • \n
  • autocommit=True to run with isolation level AUTOCOMMIT. Default is False.
  • \n
\n", + "args": [], + "returns": [] + }, + "streamlit.connections.SnowparkConnection": { + "name": "SnowparkConnection", + "signature": "st.connections.SnowparkConnection(connection_name, **kwargs)", + "is_class": true, + "methods": [ + { + "name": "query", + "signature": "st.connections.query.query(sql, ttl=None)", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("snowpark")\ndf = conn.query("select * from pet_owners")\nst.dataframe(df)\n
\n
\n", + "description": "

Run a read-only SQL query.

", + "args": [ + { + "name": "sql", + "type_name": "str", + "is_optional": false, + "description": "

The read-only SQL query to execute.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float, int, timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep results in the cache, or\nNone if cached results should not expire. The default is None.

\n", + "default": "None." + } + ], + "returns": [ + { + "type_name": "pd.DataFrame", + "is_generator": false, + "description": "

The result of running the query, formatted as a pandas DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/connections/snowpark_connection.py#L123" + }, + { + "name": "reset", + "signature": "st.connections.reset.reset()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", + "description": "

Reset this connection so that it gets reinitialized the next time it's used.

", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/connections/base_connection.py#L137" + }, + { + "name": "safe_session", + "signature": "st.connections.safe_session.safe_session()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("snowpark")\nwith conn.safe_session() as session:\n    df = session.table("mytable").limit(10).to_pandas()\n\nst.dataframe(df)\n
\n
\n", + "description": "

Grab the underlying Snowpark session in a thread-safe manner.

", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/connections/snowpark_connection.py#L207" + } + ], + "properties": [ + { + "name": "session", + "signature": "st.connections.session.session", + "example": "
\n
\nimport streamlit as st\n\nsession = st.experimental_connection("snowpark").session\ndf = session.table("mytable").limit(10).to_pandas()\nst.dataframe(df)\n
\n
\n", + "description": "

Access the underlying Snowpark session.

", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/connections/snowpark_connection.py#L184" + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/connections/snowpark_connection.py#L70", + "description": "

A connection to Snowpark using snowflake.snowpark.session.Session. Initialize using

\n

st.experimental_connection("<name>", type="snowpark").

\n

In addition to accessing the Snowpark Session, SnowparkConnection supports direct SQL querying using\nquery("...") and thread safe access using with conn.safe_session():. See methods\nbelow for more information. SnowparkConnections should always be created using\nst.experimental_connection(), not initialized directly.

\n
\n

Note

\n

We don't expect this iteration of SnowparkConnection to be able to scale\nwell in apps with many concurrent users due to the lock contention that will occur\nover the single underlying Session object under high load.

\n
\n", + "args": [], + "returns": [] + }, + "streamlit.connections.SQLConnection.query": { + "name": "query", + "signature": "SQLConnection.query(sql, *, ttl=None, index_col=None, chunksize=None, params=None, **kwargs)", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("sql")\ndf = conn.query("select * from pet_owners where owner = :owner", ttl=3600, params={"owner":"barbara"})\nst.dataframe(df)\n
\n
\n", + "description": "

Run a read-only query.

\n

This method implements both query result caching (with caching behavior\nidentical to that of using @st.cache_data) as well as simple error handling/retries.

\n
\n

Note

\n

Queries that are run without a specified ttl are cached indefinitely.

\n
\n

Aside from the ttl kwarg, all kwargs passed to this function are passed down\nto pd.read_sql\nand have the behavior described in the pandas documentation.

\n", + "args": [ + { + "name": "sql", + "type_name": "str", + "is_optional": false, + "description": "

The read-only SQL query to execute.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float, int, timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep results in the cache, or\nNone if cached results should not expire. The default is None.

\n", + "default": "None." + }, + { + "name": "index_col", + "type_name": "str, list of str, or None", + "is_optional": false, + "description": "

Column(s) to set as index(MultiIndex). Default is None.

\n", + "default": "None." + }, + { + "name": "chunksize", + "type_name": "int or None", + "is_optional": false, + "description": "

If specified, return an iterator where chunksize is the number of\nrows to include in each chunk. Default is None.

\n", + "default": "None." + }, + { + "name": "params", + "type_name": "list, tuple, dict or None", + "is_optional": false, + "description": "

List of parameters to pass to the execute method. The syntax used to pass\nparameters is database driver dependent. Check your database driver\ndocumentation for which of the five syntax styles, described in PEP 249\nparamstyle, is supported.\nDefault is None.

\n", + "default": "None." + }, + { + "name": "**kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

Additional keyword arguments are passed to pd.read_sql.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "pd.DataFrame", + "is_generator": false, + "description": "

The result of running the query, formatted as a pandas DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/connections/sql_connection.py#L121" + }, + "streamlit.connections.SQLConnection.reset": { + "name": "reset", + "signature": "SQLConnection.reset()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", + "description": "

Reset this connection so that it gets reinitialized the next time it's used.

\n

This method can be useful when a connection has become stale, an auth token has\nexpired, or in similar scenarios where a broken connection might be fixed by\nreinitializing it. Note that some connection methods may already use reset()\nin their error handling code.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/connections/base_connection.py#L137" + }, + "streamlit.connections.SQLConnection.session": { + "name": "session", + "signature": "SQLConnection.session", + "example": "
\n
\nimport streamlit as st\nconn = st.experimental_connection("sql")\nn = st.slider("Pick a number")\nif st.button("Add the number!"):\n    with conn.session as session:\n        session.execute("INSERT INTO numbers (val) VALUES (:n);", {"n": n})\n        session.commit()\n
\n
\n", + "description": "

Return a SQLAlchemy Session.

\n

Users of this connection should use the contextmanager pattern for writes,\ntransactions, and anything more complex than simple read queries.

\n

See the usage example below, which assumes we have a table numbers with a\nsingle integer column val. The SQLAlchemy docs also contain\nmuch more information on the usage of sessions.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/connections/sql_connection.py#L226" + }, + "streamlit.connections.SnowparkConnection.query": { + "name": "query", + "signature": "SnowparkConnection.query(sql, ttl=None)", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("snowpark")\ndf = conn.query("select * from pet_owners")\nst.dataframe(df)\n
\n
\n", + "description": "

Run a read-only SQL query.

\n

This method implements both query result caching (with caching behavior\nidentical to that of using @st.cache_data) as well as simple error handling/retries.

\n
\n

Note

\n

Queries that are run without a specified ttl are cached indefinitely.

\n
\n", + "args": [ + { + "name": "sql", + "type_name": "str", + "is_optional": false, + "description": "

The read-only SQL query to execute.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float, int, timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep results in the cache, or\nNone if cached results should not expire. The default is None.

\n", + "default": "None." + } + ], + "returns": [ + { + "type_name": "pd.DataFrame", + "is_generator": false, + "description": "

The result of running the query, formatted as a pandas DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/connections/snowpark_connection.py#L123" + }, + "streamlit.connections.SnowparkConnection.reset": { + "name": "reset", + "signature": "SnowparkConnection.reset()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", + "description": "

Reset this connection so that it gets reinitialized the next time it's used.

\n

This method can be useful when a connection has become stale, an auth token has\nexpired, or in similar scenarios where a broken connection might be fixed by\nreinitializing it. Note that some connection methods may already use reset()\nin their error handling code.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/connections/base_connection.py#L137" + }, + "streamlit.connections.SnowparkConnection.safe_session": { + "name": "safe_session", + "signature": "SnowparkConnection.safe_session()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("snowpark")\nwith conn.safe_session() as session:\n    df = session.table("mytable").limit(10).to_pandas()\n\nst.dataframe(df)\n
\n
\n", + "description": "

Grab the underlying Snowpark session in a thread-safe manner.

\n

As operations on a Snowpark session are not thread safe, we need to take care\nwhen using a session in the context of a Streamlit app where each script run\noccurs in its own thread. Using the contextmanager pattern to do this ensures\nthat access on this connection's underlying Session is done in a thread-safe\nmanner.

\n

Information on how to use Snowpark sessions can be found in the Snowpark documentation.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/connections/snowpark_connection.py#L207" + }, + "streamlit.connections.SnowparkConnection.session": { + "name": "session", + "signature": "SnowparkConnection.session", + "example": "
\n
\nimport streamlit as st\n\nsession = st.experimental_connection("snowpark").session\ndf = session.table("mytable").limit(10).to_pandas()\nst.dataframe(df)\n
\n
\n", + "description": "

Access the underlying Snowpark session.

\n
\n

Note

\n

Snowpark sessions are not thread safe. Users of this method are\nresponsible for ensuring that access to the session returned by this method is\ndone in a thread-safe manner. For most users, we recommend using the thread-safe\nsafe_session() method and a with block.

\n
\n

Information on how to use Snowpark sessions can be found in the Snowpark documentation.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/connections/snowpark_connection.py#L184" + }, + "streamlit.connections.ExperimentalBaseConnection.reset": { + "name": "reset", + "signature": "ExperimentalBaseConnection.reset()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", + "description": "

Reset this connection so that it gets reinitialized the next time it's used.

\n

This method can be useful when a connection has become stale, an auth token has\nexpired, or in similar scenarios where a broken connection might be fixed by\nreinitializing it. Note that some connection methods may already use reset()\nin their error handling code.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/connections/base_connection.py#L137" + }, + "streamlit.column_config.BarChartColumn": { + "name": "BarChartColumn", + "signature": "st.column_config.BarChartColumn(label=None, *, width=None, help=None, y_min=None, y_max=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "sales": [\n            [0, 4, 26, 80, 100, 40],\n            [80, 20, 80, 35, 40, 100],\n            [10, 20, 80, 80, 70, 0],\n            [10, 100, 20, 100, 30, 100],\n        ],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "sales": st.column_config.BarChartColumn(\n            "Sales (last 6 months)",\n            help="The sales volume in the last 6 months",\n            y_min=0,\n            y_max=100,\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a bar chart column in st.dataframe or st.data_editor.

\n

Cells need to contain a list of numbers. Chart columns are not editable\nat the moment. This command needs to be used in the column_config parameter\nof st.dataframe or st.data_editor.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "default": null + }, + { + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", + "is_optional": false, + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null + }, + { + "name": "y_min", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The minimum value on the y-axis for all cells in the column.\nIf None (default), every cell will use the minimum of its data.

\n", + "default": null + }, + { + "name": "y_max", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The maximum value on the y-axis for all cells in the column. If None (default),\nevery cell will use the maximum of its data.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/lib/column_types.py#L745" + }, + "streamlit.column_config.CheckboxColumn": { + "name": "CheckboxColumn", + "signature": "st.column_config.CheckboxColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "widgets": ["st.selectbox", "st.number_input", "st.text_area", "st.button"],\n        "favorite": [True, False, False, True],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "favorite": st.column_config.CheckboxColumn(\n            "Your favorite?",\n            help="Select your **favorite** widgets",\n            default=False,\n        )\n    },\n    disabled=["widgets"],\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a checkbox column in st.dataframe or st.data_editor.

\n

This is the default column type for boolean values. This command needs to be used in\nthe column_config parameter of st.dataframe or st.data_editor.\nWhen used with st.data_editor, editing will be enabled with a checkbox widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "default": null + }, + { + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", + "is_optional": false, + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", + "default": "False." + }, + { + "name": "required", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", + "default": "False." + }, + { + "name": "default", + "type_name": "bool or None", + "is_optional": false, + "description": "

Specifies the default value in this column when a new row is added by the user.

\n", + "default": "value" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/lib/column_types.py#L565" + }, + "streamlit.column_config.Column": { + "name": "Column", + "signature": "st.column_config.Column(label=None, *, width=None, help=None, disabled=None, required=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "widgets": ["st.selectbox", "st.number_input", "st.text_area", "st.button"],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "widgets": st.column_config.Column(\n            "Streamlit Widgets",\n            help="Streamlit **widget** commands \ud83c\udf88",\n            width="medium",\n            required=True,\n        )\n    },\n    hide_index=True,\n    num_rows="dynamic",\n)\n
\n\n \n
\n", + "description": "

Configure a generic column in st.dataframe or st.data_editor.

\n

The type of the column will be automatically inferred from the data type.\nThis command needs to be used in the column_config parameter of st.dataframe\nor st.data_editor.

\n

To change the type of the column and enable type-specific configuration options,\nuse one of the column types in the st.column_config namespace,\ne.g. st.column_config.NumberColumn.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "default": null + }, + { + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", + "is_optional": false, + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", + "default": "False." + }, + { + "name": "required", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/lib/column_types.py#L187" + }, + "streamlit.column_config.DateColumn": { + "name": "DateColumn", + "signature": "st.column_config.DateColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, format=None, min_value=None, max_value=None, step=None)", + "examples": "
\n
\nfrom datetime import date\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "birthday": [\n            date(1980, 1, 1),\n            date(1990, 5, 3),\n            date(1974, 5, 19),\n            date(2001, 8, 17),\n        ]\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "birthday": st.column_config.DateColumn(\n            "Birthday",\n            min_value=date(1900, 1, 1),\n            max_value=date(2005, 1, 1),\n            format="DD.MM.YYYY",\n            step=1,\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a date column in st.dataframe or st.data_editor.

\n

This is the default column type for date values. This command needs to be used in\nthe column_config parameter of st.dataframe or st.data_editor. When used\nwith st.data_editor, editing will be enabled with a date picker widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "default": null + }, + { + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", + "is_optional": false, + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", + "default": "False." + }, + { + "name": "required", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", + "default": "False." + }, + { + "name": "default", + "type_name": "datetime.date or None", + "is_optional": false, + "description": "

Specifies the default value in this column when a new row is added by the user.

\n", + "default": "value" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A momentJS format string controlling how times are displayed. See\nmomentJS docs for available\nformats. If None (default), uses YYYY-MM-DD.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "datetime.date or None", + "is_optional": false, + "description": "

The minimum date that can be entered.\nIf None (default), there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "datetime.date or None", + "is_optional": false, + "description": "

The maximum date that can be entered.\nIf None (default), there will be no maximum.

\n", + "default": null + }, + { + "name": "step", + "type_name": "int or None", + "is_optional": false, + "description": "

The stepping interval in days. If None (default), the step will be 1 day.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/lib/column_types.py#L1277" + }, + "streamlit.column_config.DatetimeColumn": { + "name": "DatetimeColumn", + "signature": "st.column_config.DatetimeColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, format=None, min_value=None, max_value=None, step=None, timezone=None)", + "examples": "
\n
\nfrom datetime import datetime\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "appointment": [\n            datetime(2024, 2, 5, 12, 30),\n            datetime(2023, 11, 10, 18, 0),\n            datetime(2024, 3, 11, 20, 10),\n            datetime(2023, 9, 12, 3, 0),\n        ]\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "appointment": st.column_config.DatetimeColumn(\n            "Appointment",\n            min_value=datetime(2023, 6, 1),\n            max_value=datetime(2025, 1, 1),\n            format="D MMM YYYY, h:mm a",\n            step=60,\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a datetime column in st.dataframe or st.data_editor.

\n

This is the default column type for datetime values. This command needs to be\nused in the column_config parameter of st.dataframe or\nst.data_editor. When used with st.data_editor, editing will be enabled\nwith a datetime picker widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "default": null + }, + { + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", + "is_optional": false, + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", + "default": "False." + }, + { + "name": "required", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", + "default": "False." + }, + { + "name": "default", + "type_name": "datetime.datetime or None", + "is_optional": false, + "description": "

Specifies the default value in this column when a new row is added by the user.

\n", + "default": "value" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A momentJS format string controlling how datetimes are displayed. See\nmomentJS docs for available\nformats. If None (default), uses YYYY-MM-DD HH:mm:ss.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "datetime.datetime or None", + "is_optional": false, + "description": "

The minimum datetime that can be entered.\nIf None (default), there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "datetime.datetime or None", + "is_optional": false, + "description": "

The maximum datetime that can be entered.\nIf None (default), there will be no maximum.

\n", + "default": null + }, + { + "name": "step", + "type_name": "int, float, datetime.timedelta, or None", + "is_optional": false, + "description": "

The stepping interval in seconds. If None (default), the step will be 1 second.

\n", + "default": null + }, + { + "name": "timezone", + "type_name": "str or None", + "is_optional": false, + "description": "

The timezone of this column. If None (default),\nthe timezone is inferred from the underlying data.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/lib/column_types.py#L1042" + }, + "streamlit.column_config.ImageColumn": { + "name": "ImageColumn", + "signature": "st.column_config.ImageColumn(label=None, *, width=None, help=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "apps": [\n            "https://storage.googleapis.com/s4a-prod-share-preview/default/st_app_screenshot_image/5435b8cb-6c6c-490b-9608-799b543655d3/Home_Page.png",\n            "https://storage.googleapis.com/s4a-prod-share-preview/default/st_app_screenshot_image/ef9a7627-13f2-47e5-8f65-3f69bb38a5c2/Home_Page.png",\n            "https://storage.googleapis.com/s4a-prod-share-preview/default/st_app_screenshot_image/31b99099-8eae-4ff8-aa89-042895ed3843/Home_Page.png",\n            "https://storage.googleapis.com/s4a-prod-share-preview/default/st_app_screenshot_image/6a399b09-241e-4ae7-a31f-7640dc1d181e/Home_Page.png",\n        ],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "apps": st.column_config.ImageColumn(\n            "Preview Image", help="Streamlit app preview screenshots"\n        )\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure an image column in st.dataframe or st.data_editor.

\n

The cell values need to be one of:

\n
    \n
  • A URL to fetch the image from. This can also be a relative URL of an image\ndeployed via static file serving.\nNote that you can NOT use an arbitrary local image if it is not available through\na public URL.
  • \n
  • A data URL containing an SVG XML like data:image/svg+xml;utf8,<svg xmlns=...</svg>.
  • \n
  • A data URL containing a Base64 encoded image like data:image/png;base64,iVBO....
  • \n
\n

Image columns are not editable at the moment. This command needs to be used in the\ncolumn_config parameter of st.dataframe or st.data_editor.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "default": null + }, + { + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", + "is_optional": false, + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/lib/column_types.py#L906" + }, + "streamlit.column_config.LineChartColumn": { + "name": "LineChartColumn", + "signature": "st.column_config.LineChartColumn(label=None, *, width=None, help=None, y_min=None, y_max=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "sales": [\n            [0, 4, 26, 80, 100, 40],\n            [80, 20, 80, 35, 40, 100],\n            [10, 20, 80, 80, 70, 0],\n            [10, 100, 20, 100, 30, 100],\n        ],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "sales": st.column_config.LineChartColumn(\n            "Sales (last 6 months)",\n            width="medium",\n            help="The sales volume in the last 6 months",\n            y_min=0,\n            y_max=100,\n         ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a line chart column in st.dataframe or st.data_editor.

\n

Cells need to contain a list of numbers. Chart columns are not editable\nat the moment. This command needs to be used in the column_config parameter\nof st.dataframe or st.data_editor.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "default": null + }, + { + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", + "is_optional": false, + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null + }, + { + "name": "y_min", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The minimum value on the y-axis for all cells in the column.\nIf None (default), every cell will use the minimum of its data.

\n", + "default": null + }, + { + "name": "y_max", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The maximum value on the y-axis for all cells in the column. If None (default),\nevery cell will use the maximum of its data.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/lib/column_types.py#L825" + }, + "streamlit.column_config.LinkColumn": { + "name": "LinkColumn", + "signature": "st.column_config.LinkColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, max_chars=None, validate=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "apps": [\n            "https://roadmap.streamlit.app",\n            "https://extras.streamlit.app",\n            "https://issues.streamlit.app",\n            "https://30days.streamlit.app",\n        ],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "apps": st.column_config.LinkColumn(\n            "Trending apps",\n            help="The top trending Streamlit apps",\n            validate="^https://[a-z]+\\.streamlit\\.app$",\n            max_chars=100,\n        )\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a link column in st.dataframe or st.data_editor.

\n

The cell values need to be string and will be shown as clickable links.\nThis command needs to be used in the column_config parameter of st.dataframe\nor st.data_editor. When used with st.data_editor, editing will be enabled\nwith a text input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "default": null + }, + { + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", + "is_optional": false, + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", + "default": "False." + }, + { + "name": "required", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", + "default": "False." + }, + { + "name": "default", + "type_name": "str or None", + "is_optional": false, + "description": "

Specifies the default value in this column when a new row is added by the user.

\n", + "default": "value" + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of characters that can be entered. If None (default),\nthere will be no maximum.

\n", + "default": null + }, + { + "name": "validate", + "type_name": "str or None", + "is_optional": false, + "description": "

A regular expression (JS flavor, e.g. "^https://.+$") that edited values are validated against.\nIf the input is invalid, it will not be submitted.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/lib/column_types.py#L466" + }, + "streamlit.column_config.ListColumn": { + "name": "ListColumn", + "signature": "st.column_config.ListColumn(label=None, *, width=None, help=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "sales": [\n            [0, 4, 26, 80, 100, 40],\n            [80, 20, 80, 35, 40, 100],\n            [10, 20, 80, 80, 70, 0],\n            [10, 100, 20, 100, 30, 100],\n        ],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "sales": st.column_config.ListColumn(\n            "Sales (last 6 months)",\n            help="The sales volume in the last 6 months",\n            width="medium",\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a list column in st.dataframe or st.data_editor.

\n

This is the default column type for list-like values. List columns are not editable\nat the moment. This command needs to be used in the column_config parameter of\nst.dataframe or st.data_editor.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "default": null + }, + { + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", + "is_optional": false, + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/lib/column_types.py#L977" + }, + "streamlit.column_config.NumberColumn": { + "name": "NumberColumn", + "signature": "st.column_config.NumberColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, format=None, min_value=None, max_value=None, step=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "price": [20, 950, 250, 500],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "price": st.column_config.NumberColumn(\n            "Price (in USD)",\n            help="The price of the product in USD",\n            min_value=0,\n            max_value=1000,\n            step=1,\n            format="$%d",\n        )\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a number column in st.dataframe or st.data_editor.

\n

This is the default column type for integer and float values. This command needs to\nbe used in the column_config parameter of st.dataframe or st.data_editor.\nWhen used with st.data_editor, editing will be enabled with a numeric input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "default": null + }, + { + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", + "is_optional": false, + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", + "default": "False." + }, + { + "name": "required", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", + "default": "False." + }, + { + "name": "default", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

Specifies the default value in this column when a new row is added by the user.

\n", + "default": "value" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how numbers are displayed.\nThis does not impact the return value. Valid formatters: %d %e %f %g %i %u.\nYou can also add prefixes and suffixes, e.g. "$ %.2f" to show a dollar prefix.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The minimum value that can be entered.\nIf None (default), there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The maximum value that can be entered.\nIf None (default), there will be no maximum.

\n", + "default": null + }, + { + "name": "step", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The stepping interval. Specifies the precision of numbers that can be entered.\nIf None (default), uses 1 for integers and unrestricted precision for floats.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/lib/column_types.py#L262" + }, + "streamlit.column_config.ProgressColumn": { + "name": "ProgressColumn", + "signature": "st.column_config.ProgressColumn(label=None, *, width=None, help=None, format=None, min_value=None, max_value=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "sales": [200, 550, 1000, 80],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "sales": st.column_config.ProgressColumn(\n            "Sales volume",\n            help="The sales volume in USD",\n            format="$%f",\n            min_value=0,\n            max_value=1000,\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a progress column in st.dataframe or st.data_editor.

\n

Cells need to contain a number. Progress columns are not editable at the moment.\nThis command needs to be used in the column_config parameter of st.dataframe\nor st.data_editor.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "default": null + }, + { + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", + "is_optional": false, + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how numbers are displayed.\nValid formatters: %d %e %f %g %i %u. You can also add prefixes and suffixes,\ne.g. "$ %.2f" to show a dollar prefix.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The minimum value of the progress bar.\nIf None (default), will be 0.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The minimum value of the progress bar. If None (default), will be 100 for\ninteger values and 1 for float values.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/lib/column_types.py#L1390" + }, + "streamlit.column_config.SelectboxColumn": { + "name": "SelectboxColumn", + "signature": "st.column_config.SelectboxColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, options=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "category": [\n            "\ud83d\udcca Data Exploration",\n            "\ud83d\udcc8 Data Visualization",\n            "\ud83e\udd16 LLM",\n            "\ud83d\udcca Data Exploration",\n        ],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "category": st.column_config.SelectboxColumn(\n            "App Category",\n            help="The category of the app",\n            width="medium",\n            options=[\n                "\ud83d\udcca Data Exploration",\n                "\ud83d\udcc8 Data Visualization",\n                "\ud83e\udd16 LLM",\n            ],\n        )\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a selectbox column in st.dataframe or st.data_editor.

\n

This is the default column type for Pandas categorical values. This command needs to\nbe used in the column_config parameter of st.dataframe or st.data_editor.\nWhen used with st.data_editor, editing will be enabled with a selectbox widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "default": null + }, + { + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", + "is_optional": false, + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", + "default": "False." + }, + { + "name": "required", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", + "default": "False." + }, + { + "name": "default", + "type_name": "str, int, float, bool, or None", + "is_optional": false, + "description": "

Specifies the default value in this column when a new row is added by the user.

\n", + "default": "value" + }, + { + "name": "options", + "type_name": "iterable of str or None", + "is_optional": false, + "description": "

The options that can be selected during editing. If None (default), this will be\ninferred from the underlying dataframe column if its dtype is \u201ccategory\u201d\n(see Pandas docs on categorical data).

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/lib/column_types.py#L647" + }, + "streamlit.column_config.TextColumn": { + "name": "TextColumn", + "signature": "st.column_config.TextColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, max_chars=None, validate=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "widgets": ["st.selectbox", "st.number_input", "st.text_area", "st.button"],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "widgets": st.column_config.TextColumn(\n            "Widgets",\n            help="Streamlit **widget** commands \ud83c\udf88",\n            default="st.",\n            max_chars=50,\n            validate="^st\\.[a-z_]+$",\n        )\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a text column in st.dataframe or st.data_editor.

\n

This is the default column type for string values. This command needs to be used in the\ncolumn_config parameter of st.dataframe or st.data_editor. When used with\nst.data_editor, editing will be enabled with a text input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "default": null + }, + { + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", + "is_optional": false, + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", + "default": "False." + }, + { + "name": "required", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", + "default": "False." + }, + { + "name": "default", + "type_name": "str or None", + "is_optional": false, + "description": "

Specifies the default value in this column when a new row is added by the user.

\n", + "default": "value" + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of characters that can be entered. If None (default),\nthere will be no maximum.

\n", + "default": null + }, + { + "name": "validate", + "type_name": "str or None", + "is_optional": false, + "description": "

A regular expression (JS flavor, e.g. "^[a-z]+$") that edited values are validated against.\nIf the input is invalid, it will not be submitted.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/lib/column_types.py#L372" + }, + "streamlit.column_config.TimeColumn": { + "name": "TimeColumn", + "signature": "st.column_config.TimeColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, format=None, min_value=None, max_value=None, step=None)", + "examples": "
\n
\nfrom datetime import time\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "appointment": [\n            time(12, 30),\n            time(18, 0),\n            time(9, 10),\n            time(16, 25),\n        ]\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "appointment": st.column_config.TimeColumn(\n            "Appointment",\n            min_value=time(8, 0, 0),\n            max_value=time(19, 0, 0),\n            format="hh:mm a",\n            step=60,\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a time column in st.dataframe or st.data_editor.

\n

This is the default column type for time values. This command needs to be used in\nthe column_config parameter of st.dataframe or st.data_editor. When\nused with st.data_editor, editing will be enabled with a time picker widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "default": null + }, + { + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", + "is_optional": false, + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", + "default": "False." + }, + { + "name": "required", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", + "default": "False." + }, + { + "name": "default", + "type_name": "datetime.time or None", + "is_optional": false, + "description": "

Specifies the default value in this column when a new row is added by the user.

\n", + "default": "value" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A momentJS format string controlling how times are displayed. See\nmomentJS docs for available\nformats. If None (default), uses HH:mm:ss.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "datetime.time or None", + "is_optional": false, + "description": "

The minimum time that can be entered.\nIf None (default), there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "datetime.time or None", + "is_optional": false, + "description": "

The maximum time that can be entered.\nIf None (default), there will be no maximum.

\n", + "default": null + }, + { + "name": "step", + "type_name": "int, float, datetime.timedelta, or None", + "is_optional": false, + "description": "

The stepping interval in seconds. If None (default), the step will be 1 second.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/lib/column_types.py#L1163" + }, + "streamlit.components.v1.declare_component": { + "name": "declare_component", + "signature": "st.components.v1.declare_component(name, path=None, url=None)", + "description": "

Create and register a custom component.

\n", + "args": [ + { + "name": "name", + "type_name": "str", + "is_optional": false, + "description": "

A short, descriptive name for the component. Like, "slider".

\n", + "default": null + }, + { + "name": "path", + "type_name": "str or None", + "is_optional": false, + "description": "

The path to serve the component's frontend files from. Either\npath or url must be specified, but not both.

\n", + "default": null + }, + { + "name": "url", + "type_name": "str or None", + "is_optional": false, + "description": "

The URL that the component is served from. Either path or url\nmust be specified, but not both.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "CustomComponent", + "is_generator": false, + "description": "

A CustomComponent that can be called like a function.\nCalling the component will create a new instance of the component\nin the Streamlit app.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/components/v1/components.py#L246" + }, + "streamlit.components.v1.html": { + "name": "html", + "signature": "st.components.v1.html(html, width=None, height=None, scrolling=False)", + "description": "

Display an HTML string in an iframe.

\n", + "args": [ + { + "name": "html", + "type_name": "str", + "is_optional": false, + "description": "

The HTML string to embed in the iframe.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", + "default": "the" + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", + "default": "150." + }, + { + "name": "scrolling", + "type_name": "bool", + "is_optional": false, + "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/iframe.py#L59" + }, + "streamlit.components.v1.iframe": { + "name": "iframe", + "signature": "st.components.v1.iframe(src, width=None, height=None, scrolling=False)", + "description": "

Load a remote URL in an iframe.

\n", + "args": [ + { + "name": "src", + "type_name": "str", + "is_optional": false, + "description": "

The URL of the page to embed.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", + "default": "the" + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", + "default": "150." + }, + { + "name": "scrolling", + "type_name": "bool", + "is_optional": false, + "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/iframe.py#L25" + }, + "DeltaGenerator.add_rows": { + "name": "add_rows", + "signature": "element.add_rows(data=None, **kwargs)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf1 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table = st.table(df1)\n\ndf2 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table.add_rows(df2)\n# Now the table shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

You can do the same thing with plots. For example, if you want to add\nmore data to a line chart:

\n
\n# Assuming df1 and df2 from the example above still exist...\nmy_chart = st.line_chart(df1)\nmy_chart.add_rows(df2)\n# Now the chart shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

And for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:

\n
\nmy_chart = st.vega_lite_chart({\n    'mark': 'line',\n    'encoding': {'x': 'a', 'y': 'b'},\n    'datasets': {\n      'some_fancy_name': df1,  # <-- named dataset\n     },\n    'data': {'name': 'some_fancy_name'},\n}),\nmy_chart.add_rows(some_fancy_name=df2)  # <-- name used as keyword\n
\n
\n", + "description": "

Concatenate a dataframe to the bottom of the current one.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, Iterable, dict, or None", + "is_optional": false, + "description": "

Table to concat. Optional.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "**kwargs", + "type_name": "pandas.DataFrame, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

The named dataset to concat. Optional. You can only pass in 1\ndataset (including the one in the data parameter).

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/dataframe_selector.py#L620" + }, + "DeltaGenerator.altair_chart": { + "name": "altair_chart", + "signature": "element.altair_chart(altair_chart, use_container_width=False, theme=\"streamlit\")", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(chart_data).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n
\n", + "description": "

Display a chart using the Altair library.

\n", + "args": [ + { + "name": "altair_chart", + "type_name": "altair.Chart", + "is_optional": false, + "description": "

The Altair chart object to display.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/dataframe_selector.py#L492" + }, + "DeltaGenerator.area_chart": { + "name": "area_chart", + "signature": "element.area_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n
\n", + "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/dataframe_selector.py#L317" + }, + "DeltaGenerator.audio": { + "name": "audio", + "signature": "element.audio(data, format=\"audio/wav\", start_time=0, *, sample_rate=None)", + "example": "
\n
\nimport streamlit as st\nimport numpy as np\n\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n\nsample_rate = 44100  # 44100 samples per second\nseconds = 2  # Note duration of 2 seconds\nfrequency_la = 440  # Our played note will be 440 Hz\n# Generate array with seconds*sample_rate steps, ranging between 0 and seconds\nt = np.linspace(0, seconds, seconds * sample_rate, False)\n# Generate a 440 Hz sine wave\nnote_la = np.sin(frequency_la * t * 2 * np.pi)\n\nst.audio(note_la, sample_rate=sample_rate)\n
\n\n \n
\n", + "description": "

Display an audio player.

\n", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw audio data, filename, or a URL pointing to the file to load.\nRaw data formats must include all necessary file headers to match the file\nformat specified via format.\nIf data is a numpy array, it must either be a 1D array of the waveform\nor a 2D array of shape (num_channels, num_samples) with waveforms\nfor all channels. See the default channel order at\nhttp://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx

\n", + "default": "channel" + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + }, + { + "name": "sample_rate", + "type_name": "int or None", + "is_optional": false, + "description": "

The sample rate of the audio data in samples per second. Only required if\ndata is a numpy array.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/media.py#L42" + }, + "DeltaGenerator.balloons": { + "name": "balloons", + "signature": "element.balloons()", + "example": "
\n
\nimport streamlit as st\n\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", + "description": "

Draw celebratory balloons.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/balloons.py#L25" + }, + "DeltaGenerator.bar_chart": { + "name": "bar_chart", + "signature": "element.bar_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n
\n", + "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/dataframe_selector.py#L404" + }, + "DeltaGenerator.bokeh_chart": { + "name": "bokeh_chart", + "signature": "element.bokeh_chart(figure, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n
\n", + "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", + "args": [ + { + "name": "figure", + "type_name": "bokeh.plotting.figure.Figure", + "is_optional": false, + "description": "

A Bokeh figure to plot.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Bokeh's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/bokeh_chart.py#L36" + }, + "DeltaGenerator.button": { + "name": "button", + "signature": "element.button(label, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\n\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n
\n", + "description": "

Display a button widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/button.py#L61" + }, + "DeltaGenerator.camera_input": { + "name": "camera_input", + "signature": "element.camera_input(label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", + "description": "

Display a widget that returns pictures from the user's webcam.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this widget is used for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the camera input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this camera_input's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile", + "is_generator": false, + "description": "

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/camera_input.py#L109" + }, + "DeltaGenerator.caption": { + "name": "caption", + "signature": "element.caption(body, unsafe_allow_html=False, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.caption('This is a string that explains something above.')\nst.caption('A caption with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the caption.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/markdown.py#L132" + }, + "DeltaGenerator.checkbox": { + "name": "checkbox", + "signature": "element.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n
\n", + "description": "

Display a checkbox widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this checkbox is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "value", + "type_name": "bool", + "is_optional": false, + "description": "

Preselect the checkbox when it first renders. This will be\ncast to bool internally.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the checkbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this checkbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

Whether or not the checkbox is checked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/checkbox.py#L52" + }, + "DeltaGenerator.code": { + "name": "code", + "signature": "element.code(body, language=\"python\", line_numbers=False)", + "example": "
\n
\nimport streamlit as st\n\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", + "description": "

Display a code block with optional syntax highlighting.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as code.

\n", + "default": null + }, + { + "name": "language", + "type_name": "str or None", + "is_optional": false, + "description": "

The language that the code is written in, for syntax highlighting.\nIf None, the code will be unstyled. Defaults to "python".

\n

For a list of available language values, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", + "default": "s" + }, + { + "name": "line_numbers", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean indicating whether to show line numbers to the\nleft of the code block. Defaults to False.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/code.py#L27" + }, + "DeltaGenerator.color_picker": { + "name": "color_picker", + "signature": "element.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n
\n", + "description": "

Display a color picker widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "str", + "is_optional": false, + "description": "

The hex value of this widget when it first renders. If None,\ndefaults to black.

\n", + "default": "black." + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the color picker.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this color_picker's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The selected color as a hex string.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/color_picker.py#L52" + }, + "DeltaGenerator.columns": { + "name": "columns", + "signature": "element.columns(spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or iterable of numbers", + "is_optional": false, + "description": "

Controls the number and width of columns to insert. Can be one of:

\n
    \n
  • An integer that specifies the number of columns. All columns have equal\nwidth in this case.
  • \n
  • An iterable of numbers (int or float) that specify the relative width of\neach column. E.g. [0.7, 0.3] creates two columns where the first\none takes up 70% of the available with and the second one takes up 30%.\nOr [1, 2, 3] creates three columns where the second one is two times\nthe width of the first one, and the third one is three times that width.
  • \n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "\"small\", \"medium\", or \"large\"", + "is_optional": false, + "description": "

The size of the gap between the columns. Defaults to "small". This\nargument can only be supplied by keyword.

\n", + "default": "s" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/layouts.py#L77" + }, + "DeltaGenerator.container": { + "name": "container", + "signature": "element.container()", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/layouts.py#L29" + }, + "DeltaGenerator.data_editor": { + "name": "data_editor", + "signature": "element.data_editor(data, *, width=None, height=None, use_container_width=False, hide_index=None, column_order=None, column_config=None, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

Or you can customize the data editor via column_config, hide_index, column_order, or disabled:

\n
\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    [\n        {"command": "st.selectbox", "rating": 4, "is_widget": True},\n        {"command": "st.balloons", "rating": 5, "is_widget": False},\n        {"command": "st.time_input", "rating": 3, "is_widget": True},\n    ]\n)\nedited_df = st.data_editor(\n    df,\n    column_config={\n        "command": "Streamlit Command",\n        "rating": st.column_config.NumberColumn(\n            "Your rating",\n            help="How much do you like this command (1-5)?",\n            min_value=1,\n            max_value=5,\n            step=1,\n            format="%d \u2b50",\n        ),\n        "is_widget": "Widget ?",\n    },\n    disabled=["command", "is_widget"],\n    hide_index=True,\n)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n
\n", + "description": "

Display a data editor widget.

\n

The data editor widget allows you to edit dataframes and many other data structures in a table-like UI.

\n
\n

Warning

\n

When going from st.experimental_data_editor to st.data_editor in\n1.23.0, the data editor's representation in st.session_state was changed.\nThe edited_cells dictionary is now called edited_rows and uses a\ndifferent format ({0: {"column name": "edited value"}} instead of\n{"0:1": "edited value"}). You may need to adjust the code if your app uses\nst.experimental_data_editor in combination with st.session_state."

\n
\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None", + "is_optional": false, + "description": "

The data to edit in the data editor.

\n
\n

Note

\n

Mixing data types within a column can make the column uneditable.\nAdditionally, the following data types are not yet supported for editing:\ncomplex, list, tuple, bytes, bytearray, memoryview, dict, set, frozenset,\ndatetime.timedelta, decimal.Decimal, fractions.Fraction, pandas.Interval,\npandas.Period, pandas.Timedelta.

\n
\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the data editor expressed in pixels. If None, the width will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the data editor expressed in pixels. If None, the height will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the data editor width to the width of the parent container.\nThis takes precedence over the width argument. Defaults to False.

\n", + "default": "False." + }, + { + "name": "hide_index", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether to hide the index column(s). If None (default), the visibility of\nindex columns is automatically determined based on the data.

\n", + "default": null + }, + { + "name": "column_order", + "type_name": "iterable of str or None", + "is_optional": false, + "description": "

Specifies the display order of columns. This also affects which columns are\nvisible. For example, column_order=("col2", "col1") will display 'col2'\nfirst, followed by 'col1', and will hide all other non-index columns. If\nNone (default), the order is inherited from the original data structure.

\n", + "default": null + }, + { + "name": "column_config", + "type_name": "dict or None", + "is_optional": false, + "description": "

Configures how columns are displayed, e.g. their title, visibility, type, or\nformat, as well as editing properties such as min/max value or step.\nThis needs to be a dictionary where each key is a column name and the value\nis one of:

\n
    \n
  • None to hide the column.
  • \n
  • A string to set the display label of the column.
  • \n
  • One of the column types defined under st.column_config, e.g.\nst.column_config.NumberColumn("Dollar values\u201d, format=\u201d$ %d") to show\na column as dollar amounts. See more info on the available column types\nand config options here.
  • \n
\n

To configure the index column(s), use _index as the column name.

\n", + "default": null + }, + { + "name": "num_rows", + "type_name": "\"fixed\" or \"dynamic\"", + "is_optional": false, + "description": "

Specifies if the user can add and delete rows in the data editor.\nIf "fixed", the user cannot add or delete rows. If "dynamic", the user can\nadd and delete rows in the data editor, but column sorting is disabled.\nDefaults to "fixed".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool or iterable of str", + "is_optional": false, + "description": "

Controls the editing of columns. If True, editing is disabled for all columns.\nIf an iterable of column names is provided (e.g., disabled=("col1", "col2")),\nonly the specified columns will be disabled for editing. If False (default),\nall columns that support editing are editable.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the unique key for this widget. If this\nis omitted, a key will be generated for the widget based on its\ncontent. Multiple widgets of the same type may not share the same\nkey.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this data_editor's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "pandas.DataFrame, pandas.Series, pyarrow.Table, numpy.ndarray, list, set, tuple, or dict.", + "is_generator": false, + "description": "

The edited data. The edited data is returned in its original data type if\nit corresponds to any of the supported return types. All other data types\nare returned as a pd.DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/data_editor.py#L527" + }, + "DeltaGenerator.dataframe": { + "name": "dataframe", + "signature": "element.dataframe(data=None, width=None, height=None, *, use_container_width=False, hide_index=None, column_order=None, column_config=None)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n

Or you can customize the dataframe via column_config, hide_index, or column_order:

\n
\nimport random\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    {\n        "name": ["Roadmap", "Extras", "Issues"],\n        "url": ["https://roadmap.streamlit.app", "https://extras.streamlit.app", "https://issues.streamlit.app"],\n        "stars": [random.randint(0, 1000) for _ in range(3)],\n        "views_history": [[random.randint(0, 5000) for _ in range(30)] for _ in range(3)],\n    }\n)\nst.dataframe(\n    df,\n    column_config={\n        "name": "App name",\n        "stars": st.column_config.NumberColumn(\n            "Github Stars",\n            help="Number of stars on GitHub",\n            format="%d \u2b50",\n        ),\n        "url": st.column_config.LinkColumn("App URL"),\n        "views_history": st.column_config.LineChartColumn(\n            "Views (past 30 days)", y_min=0, y_max=5000\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Display a dataframe as an interactive table.

\n

This command works with dataframes from Pandas, PyArrow, Snowpark, and PySpark.\nIt can also display several other types that can be converted to dataframes,\ne.g. numpy arrays, lists, sets and dictionaries.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the dataframe expressed in pixels. If None, the width\nwill be automatically calculated based on the column content.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the dataframe expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the dataframe width to the width of the parent container.\nThis takes precedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "hide_index", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether to hide the index column(s). If None (default), the visibility of\nindex columns is automatically determined based on the data.

\n", + "default": null + }, + { + "name": "column_order", + "type_name": "iterable of str or None", + "is_optional": false, + "description": "

Specifies the display order of columns. This also affects which columns are\nvisible. For example, column_order=("col2", "col1") will display 'col2'\nfirst, followed by 'col1', and will hide all other non-index columns. If\nNone (default), the order is inherited from the original data structure.

\n", + "default": null + }, + { + "name": "column_config", + "type_name": "dict or None", + "is_optional": false, + "description": "

Configures how columns are displayed, e.g. their title, visibility, type, or\nformat. This needs to be a dictionary where each key is a column name and\nthe value is one of:

\n
    \n
  • None to hide the column.
  • \n
  • A string to set the display label of the column.
  • \n
  • One of the column types defined under st.column_config, e.g.\nst.column_config.NumberColumn("Dollar values\u201d, format=\u201d$ %d") to show\na column as dollar amounts. See more info on the available column types\nand config options here.
  • \n
\n

To configure the index column(s), use _index as the column name.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/dataframe_selector.py#L43" + }, + "DeltaGenerator.date_input": { + "name": "date_input", + "signature": "element.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nd = st.date_input(\n    "When\\'s your birthday",\n    datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n
\n", + "description": "

Display a date input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this date input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", + "is_optional": false, + "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", + "default": "today" + }, + { + "name": "min_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", + "default": "value" + }, + { + "name": "max_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", + "default": "value" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this date_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.date or a tuple with 0-2 dates", + "is_generator": false, + "description": "

The current value of the date input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/time_widgets.py#L398" + }, + "DeltaGenerator.dg": { + "name": "dg", + "signature": "element.dg", + "description": "

Get our DeltaGenerator.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/alert.py#L168" + }, + "DeltaGenerator.divider": { + "name": "divider", + "signature": "element.divider()", + "example": "
\n
\nimport streamlit as st\n\nst.divider()\n
\n
\n", + "description": "

Display a horizontal rule.

\n
\n

Note

\n

You can achieve the same effect with st.write("---") or\neven just "---" in your script (via magic).

\n
\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/markdown.py#L244" + }, + "DeltaGenerator.download_button": { + "name": "download_button", + "signature": "element.download_button(label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False, use_container_width=False)", + "examples": "
\n

Download a large DataFrame as a CSV:

\n
\nimport streamlit as st\n\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\nimport streamlit as st\n\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nimport streamlit as st\n\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nimport streamlit as st\n\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n
\n", + "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "data", + "type_name": "str or bytes or file", + "is_optional": false, + "description": "

The contents of the file to be downloaded. See example below for\ncaching techniques to avoid recomputing this data unnecessarily.

\n", + "default": null + }, + { + "name": "file_name", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the name of the file to be downloaded,\nsuch as 'my_file.csv'. If not specified, the name will be\nautomatically generated.

\n", + "default": null + }, + { + "name": "mime", + "type_name": "str or None", + "is_optional": false, + "description": "

The MIME type of the data. If None, defaults to "text/plain"\n(if data is of type str or is a textual file) or\n"application/octet-stream" (if data is of type bytes or is a\nbinary file).

\n", + "default": "s" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/button.py#L169" + }, + "DeltaGenerator.empty": { + "name": "empty", + "signature": "element.empty()", + "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport streamlit as st\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nimport streamlit as st\n\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", + "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/empty.py#L24" + }, + "DeltaGenerator.error": { + "name": "error", + "signature": "element.error(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", + "description": "

Display error message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The error text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/alert.py#L39" + }, + "DeltaGenerator.exception": { + "name": "exception", + "signature": "element.exception(exception)", + "example": "
\n
\nimport streamlit as st\n\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", + "description": "

Display an exception.

\n", + "args": [ + { + "name": "exception", + "type_name": "Exception", + "is_optional": false, + "description": "

The exception to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/exception.py#L50" + }, + "DeltaGenerator.expander": { + "name": "expander", + "signature": "element.expander(label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/layouts.py#L317" + }, + "DeltaGenerator.experimental_data_editor": { + "name": "experimental_data_editor", + "signature": "element.experimental_data_editor(data, *, width=None, height=None, use_container_width=False, hide_index=None, column_order=None, column_config=None, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

Or you can customize the data editor via column_config, hide_index, column_order, or disabled:

\n
\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    [\n        {"command": "st.selectbox", "rating": 4, "is_widget": True},\n        {"command": "st.balloons", "rating": 5, "is_widget": False},\n        {"command": "st.time_input", "rating": 3, "is_widget": True},\n    ]\n)\nedited_df = st.data_editor(\n    df,\n    column_config={\n        "command": "Streamlit Command",\n        "rating": st.column_config.NumberColumn(\n            "Your rating",\n            help="How much do you like this command (1-5)?",\n            min_value=1,\n            max_value=5,\n            step=1,\n            format="%d \u2b50",\n        ),\n        "is_widget": "Widget ?",\n    },\n    disabled=["command", "is_widget"],\n    hide_index=True,\n)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n
\n", + "description": "

Display a data editor widget.

\n

The data editor widget allows you to edit dataframes and many other data structures in a table-like UI.

\n
\n

Warning

\n

When going from st.experimental_data_editor to st.data_editor in\n1.23.0, the data editor's representation in st.session_state was changed.\nThe edited_cells dictionary is now called edited_rows and uses a\ndifferent format ({0: {"column name": "edited value"}} instead of\n{"0:1": "edited value"}). You may need to adjust the code if your app uses\nst.experimental_data_editor in combination with st.session_state."

\n
\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None", + "is_optional": false, + "description": "

The data to edit in the data editor.

\n
\n

Note

\n

Mixing data types within a column can make the column uneditable.\nAdditionally, the following data types are not yet supported for editing:\ncomplex, list, tuple, bytes, bytearray, memoryview, dict, set, frozenset,\ndatetime.timedelta, decimal.Decimal, fractions.Fraction, pandas.Interval,\npandas.Period, pandas.Timedelta.

\n
\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the data editor expressed in pixels. If None, the width will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the data editor expressed in pixels. If None, the height will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the data editor width to the width of the parent container.\nThis takes precedence over the width argument. Defaults to False.

\n", + "default": "False." + }, + { + "name": "hide_index", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether to hide the index column(s). If None (default), the visibility of\nindex columns is automatically determined based on the data.

\n", + "default": null + }, + { + "name": "column_order", + "type_name": "iterable of str or None", + "is_optional": false, + "description": "

Specifies the display order of columns. This also affects which columns are\nvisible. For example, column_order=("col2", "col1") will display 'col2'\nfirst, followed by 'col1', and will hide all other non-index columns. If\nNone (default), the order is inherited from the original data structure.

\n", + "default": null + }, + { + "name": "column_config", + "type_name": "dict or None", + "is_optional": false, + "description": "

Configures how columns are displayed, e.g. their title, visibility, type, or\nformat, as well as editing properties such as min/max value or step.\nThis needs to be a dictionary where each key is a column name and the value\nis one of:

\n
    \n
  • None to hide the column.
  • \n
  • A string to set the display label of the column.
  • \n
  • One of the column types defined under st.column_config, e.g.\nst.column_config.NumberColumn("Dollar values\u201d, format=\u201d$ %d") to show\na column as dollar amounts. See more info on the available column types\nand config options here.
  • \n
\n

To configure the index column(s), use _index as the column name.

\n", + "default": null + }, + { + "name": "num_rows", + "type_name": "\"fixed\" or \"dynamic\"", + "is_optional": false, + "description": "

Specifies if the user can add and delete rows in the data editor.\nIf "fixed", the user cannot add or delete rows. If "dynamic", the user can\nadd and delete rows in the data editor, but column sorting is disabled.\nDefaults to "fixed".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool or iterable of str", + "is_optional": false, + "description": "

Controls the editing of columns. If True, editing is disabled for all columns.\nIf an iterable of column names is provided (e.g., disabled=("col1", "col2")),\nonly the specified columns will be disabled for editing. If False (default),\nall columns that support editing are editable.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the unique key for this widget. If this\nis omitted, a key will be generated for the widget based on its\ncontent. Multiple widgets of the same type may not share the same\nkey.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this data_editor's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "pandas.DataFrame, pandas.Series, pyarrow.Table, numpy.ndarray, list, set, tuple, or dict.", + "is_generator": false, + "description": "

The edited data. The edited data is returned in its original data type if\nit corresponds to any of the supported return types. All other data types\nare returned as a pd.DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/data_editor.py#L527" + }, + "DeltaGenerator.file_uploader": { + "name": "file_uploader", + "signature": "element.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nimport streamlit as st\nimport pandas as pd\nfrom io import StringIO\n\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nimport streamlit as st\n\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n
\n", + "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this file uploader is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str or list of str or None", + "is_optional": false, + "description": "

Array of allowed extensions. ['png', 'jpg']\nThe default is None, which means all extensions are allowed.

\n", + "default": "None" + }, + { + "name": "accept_multiple_files", + "type_name": "bool", + "is_optional": false, + "description": "

If True, allows the user to upload multiple files at the same time,\nin which case the return value will be a list of files.\nDefault: False

\n", + "default": "False" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the file uploader.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this file_uploader's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the file uploader if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile or list of UploadedFile", + "is_generator": false, + "description": "
    \n
  • If accept_multiple_files is False, returns either None or\nan UploadedFile object.
  • \n
  • If accept_multiple_files is True, returns a list with the\nuploaded files as UploadedFile objects. If no files were\nuploaded, returns an empty list.
  • \n
\n

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/file_uploader.py#L214" + }, + "DeltaGenerator.form": { + "name": "form", + "signature": "element.form(key, clear_on_submit=False)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n

Inserting elements out of order:

\n
\nimport streamlit as st\n\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n
\n", + "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

A string that identifies the form. Each form must have its own\nkey. (This key is not displayed to the user in the interface.)

\n", + "default": null + }, + { + "name": "clear_on_submit", + "type_name": "bool", + "is_optional": false, + "description": "

If True, all widgets inside the form will be reset to their default\nvalues after the user presses the Submit button. Defaults to False.\n(Note that Custom Components are unaffected by this flag, and\nwill not be reset to their defaults on form submission.)

\n", + "default": "values" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/form.py#L118" + }, + "DeltaGenerator.form_submit_button": { + "name": "form_submit_button", + "signature": "element.form_submit_button(label=\"Submit\", help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nDefaults to "Submit".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

A tooltip that gets displayed when the button is hovered over.\nDefaults to None.

\n", + "default": "None." + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/form.py#L211" + }, + "DeltaGenerator.graphviz_chart": { + "name": "graphviz_chart", + "signature": "element.graphviz_chart(figure_or_dot, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nimport graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n
\n", + "description": "

Display a graph using the dagre-d3 library.

\n", + "args": [ + { + "name": "figure_or_dot", + "type_name": "graphviz.dot.Graph, graphviz.dot.Digraph, str", + "is_optional": false, + "description": "

The Graphlib graph object or dot string to display

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/graphviz_chart.py#L39" + }, + "DeltaGenerator.header": { + "name": "header", + "signature": "element.header(body, anchor=None, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.header('This is a header')\nst.header('A header with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in header formatting.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str or False", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the header.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/heading.py#L40" + }, + "DeltaGenerator.help": { + "name": "help", + "signature": "element.help(obj=)", + "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nimport streamlit as st\nimport pandas\n\nst.help(pandas.DataFrame)\n
\n\n \n

Want to quickly check what data type is output by a certain function?\nTry:

\n
\nimport streamlit as st\n\nx = my_poorly_documented_function()\nst.help(x)\n
\n

Want to quickly inspect an object? No sweat:

\n
\nclass Dog:\n  '''A typical dog.'''\n\n  def __init__(self, breed, color):\n    self.breed = breed\n    self.color = color\n\n  def bark(self):\n    return 'Woof!'\n\n\nfido = Dog('poodle', 'white')\n\nst.help(fido)\n
\n\n \n

And if you're using Magic, you can get help for functions, classes,\nand modules without even typing st.help:

\n
\nimport streamlit as st\nimport pandas\n\n# Get help for Pandas read_csv:\npandas.read_csv\n\n# Get help for Streamlit itself:\nst\n
\n\n \n
\n", + "description": "

Display help and other information for a given object.

\n

Depending on the type of object that is passed in, this displays the\nobject's name, type, value, signature, docstring, and member variables,\nmethods \u2014 as well as the values/docstring of members and methods.

\n", + "args": [ + { + "name": "obj", + "type_name": "any", + "is_optional": false, + "description": "

The object whose information should be displayed. If left\nunspecified, this call will display help for Streamlit itself.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/doc_string.py#L49" + }, + "DeltaGenerator.id": { + "name": "id", + "signature": "element.id" + }, + "DeltaGenerator.image": { + "name": "image", + "signature": "element.image(image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", + "example": "
\n
\nimport streamlit as st\nfrom PIL import Image\n\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n
\n", + "description": "

Display an image or list of images.

\n", + "args": [ + { + "name": "image", + "type_name": "numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]", + "is_optional": false, + "description": "

Monochrome image of shape (w,h) or (w,h,1)\nOR a color image of shape (w,h,3)\nOR an RGBA image of shape (w,h,4)\nOR a URL to fetch the image from\nOR a path of a local image file\nOR an SVG XML string like <svg xmlns=...</svg>\nOR a list of one of the above, to display multiple images.

\n", + "default": null + }, + { + "name": "caption", + "type_name": "str or list of str", + "is_optional": false, + "description": "

Image caption. If displaying multiple images, caption should be a\nlist of captions (one for each image).

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Image width. None means use the image width,\nbut do not exceed the width of the column.\nShould be set for SVG images, as they have no default image width.

\n", + "default": "image" + }, + { + "name": "use_column_width", + "type_name": "\"auto\", \"always\", \"never\", or bool", + "is_optional": false, + "description": "

If "auto", set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf "always" or True, set the image's width to the column width.\nIf "never" or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", + "default": null + }, + { + "name": "clamp", + "type_name": "bool", + "is_optional": false, + "description": "

Clamp image pixel values to a valid range ([0-255] per channel).\nThis is only meaningful for byte array images; the parameter is\nignored for image URLs. If this is not set, and an image has an\nout-of-range value, an error will be thrown.

\n", + "default": null + }, + { + "name": "channels", + "type_name": "\"RGB\" or \"BGR\"", + "is_optional": false, + "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to "RGB", meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to "BGR", instead.

\n", + "default": "s" + }, + { + "name": "output_format", + "type_name": "\"JPEG\", \"PNG\", or \"auto\"", + "is_optional": false, + "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to "auto" which identifies the compression type based\non the type and format of the image argument.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/image.py#L88" + }, + "DeltaGenerator.info": { + "name": "info", + "signature": "element.info(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", + "description": "

Display an informational message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The info text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/alert.py#L103" + }, + "DeltaGenerator.json": { + "name": "json", + "signature": "element.json(body, *, expanded=True)", + "example": "
\n
\nimport streamlit as st\n\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n
\n", + "description": "

Display object or string as a pretty-printed JSON string.

\n", + "args": [ + { + "name": "body", + "type_name": "object or str", + "is_optional": false, + "description": "

The object to print as JSON. All referenced objects should be\nserializable to JSON as well. If object is a string, we assume it\ncontains serialized JSON.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean that allows the user to set whether the initial\nstate of this json element should be expanded. Defaults to True.\nThis argument can only be supplied by keyword.

\n", + "default": "True." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/json.py#L35" + }, + "DeltaGenerator.latex": { + "name": "latex", + "signature": "element.latex(body, *, help=None)", + "example": "
\n
\nimport streamlit as st\n\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", + "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", + "args": [ + { + "name": "body", + "type_name": "str or SymPy expression", + "is_optional": false, + "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the LaTeX expression.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/markdown.py#L196" + }, + "DeltaGenerator.line_chart": { + "name": "line_chart", + "signature": "element.line_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\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 \n
\n", + "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict or None", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/dataframe_selector.py#L230" + }, + "DeltaGenerator.map": { + "name": "map", + "signature": "element.map(data=None, zoom=None, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n
\n", + "description": "

Display a map with points on it.

\n

This is a wrapper around st.pydeck_chart to quickly create\nscatterplot charts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to be plotted. Must have two columns:

\n
    \n
  • latitude called 'lat', 'latitude', 'LAT', 'LATITUDE'
  • \n
  • longitude called 'lon', 'longitude', 'LON', 'LONGITUDE'.
  • \n
\n", + "default": null + }, + { + "name": "zoom", + "type_name": "int", + "is_optional": false, + "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/map.py#L76" + }, + "DeltaGenerator.markdown": { + "name": "markdown", + "signature": "element.markdown(body, unsafe_allow_html=False, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.markdown('Streamlit is **_really_ cool**.')\nst.markdown("This text is :red[colored red], and this is **:blue[colored]** and bold.")\nst.markdown(":green[$\\sqrt{x^2+y^2}=1$] is a Pythagorean identity. :pencil:")\n
\n
\n", + "description": "

Display string formatted as Markdown.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the Markdown.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/markdown.py#L31" + }, + "DeltaGenerator.metric": { + "name": "metric", + "signature": "element.metric(label, value, delta=None, delta_color=\"normal\", help=None, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n

st.metric looks especially nice in combination with st.columns:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n

The delta indicator color can also be inverted or turned off:

\n
\nimport streamlit as st\n\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n
\n", + "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

The header or title for the metric. The label can optionally contain\nMarkdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Value of the metric. None is rendered as a long dash.

\n", + "default": null + }, + { + "name": "delta", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Indicator of how the metric changed, rendered with an arrow below\nthe metric. If delta is negative (int/float) or starts with a minus\nsign (str), the arrow points down and the text is red; else the\narrow points up and the text is green. If None (default), no delta\nindicator is shown.

\n", + "default": null + }, + { + "name": "delta_color", + "type_name": "\"normal\", \"inverse\", or \"off\"", + "is_optional": false, + "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the metric label.

\n", + "default": null + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/metric.py#L46" + }, + "DeltaGenerator.multiselect": { + "name": "multiselect", + "signature": "element.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", max_selections=None)", + "example": "
\n
\nimport streamlit as st\n\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n
\n", + "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence[V], numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "default", + "type_name": "[V], V, or None", + "is_optional": false, + "description": "

List of default values. Can also be a single value.

\n", + "default": "values." + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of selectbox options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe multiselect.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the multiselect.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this multiselect's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the multiselect widget if set\nto True. The default is False. This argument can only be supplied\nby keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "max_selections", + "type_name": "int", + "is_optional": false, + "description": "

The max selections that can be selected at a time.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list", + "is_generator": false, + "description": "

A list with the selected options

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/multiselect.py#L145" + }, + "DeltaGenerator.number_input": { + "name": "number_input", + "signature": "element.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n
\n", + "description": "

Display a numeric input widget.

\n
\n

Note

\n

Integer values exceeding +/- (1<<53) - 1 cannot be accurately\nstored or returned by the widget due to serialization contstraints\nbetween the Python server and JavaScript client. You must handle\nsuch numbers as floats, leading to a loss in precision.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. Output must be purely numeric. This does not impact\nthe return value. Valid formatters: %d %e %f %g %i %u

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this number_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the number input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int or float", + "is_generator": false, + "description": "

The current value of the numeric input widget. The return type\nwill match the data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/number_input.py#L66" + }, + "DeltaGenerator.plotly_chart": { + "name": "plotly_chart", + "signature": "element.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", theme=\"streamlit\", **kwargs)", + "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport numpy as np\nimport plotly.figure_factory as ff\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n        hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n
\n", + "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", + "args": [ + { + "name": "figure_or_data", + "type_name": "plotly.graph_objs.Figure, plotly.graph_objs.Data,", + "is_optional": false, + "description": "

dict/list of plotly.graph_objs.Figure/Data

\n

See https://plot.ly/python/ for examples of graph descriptions.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + }, + { + "name": "sharing", + "type_name": "\"streamlit\", \"private\", \"secret\", or \"public\"", + "is_optional": false, + "description": "

Use "streamlit" to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": null, + "is_optional": null, + "description": "

Any argument accepted by Plotly's plot() function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/plotly_chart.py#L81" + }, + "DeltaGenerator.progress": { + "name": "progress", + "signature": "element.progress(value, text=None)", + "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport streamlit as st\nimport time\n\nprogress_text = "Operation in progress. Please wait."\nmy_bar = st.progress(0, text=progress_text)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1, text=progress_text)\n
\n
\n", + "description": "

Display a progress bar.

\n", + "args": [ + { + "name": "value", + "type_name": "int or float", + "is_optional": false, + "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", + "default": null + }, + { + "name": "text", + "type_name": "str or None", + "is_optional": false, + "description": "

A message to display above the progress bar. The text can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/progress.py#L66" + }, + "DeltaGenerator.pydeck_chart": { + "name": "pydeck_chart", + "signature": "element.pydeck_chart(pydeck_obj=None, use_container_width=False)", + "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport pydeck as pdk\n\nchart_data = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=chart_data,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=chart_data,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", + "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "args": [ + { + "name": "pydeck_obj", + "type_name": "pydeck.Deck or None", + "is_optional": false, + "description": "

Object specifying the PyDeck chart to draw.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/deck_gl_json_chart.py#L36" + }, + "DeltaGenerator.pyplot": { + "name": "pyplot", + "signature": "element.pyplot(fig=None, clear_figure=None, use_container_width=True, **kwargs)", + "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", + "example": "
\n
\nimport streamlit as st\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n
\n", + "description": "

Display a matplotlib.pyplot figure.

\n", + "args": [ + { + "name": "fig", + "type_name": "Matplotlib Figure", + "is_optional": false, + "description": "

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

\n", + "default": null + }, + { + "name": "clear_figure", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", + "default": "based" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n", + "default": "s" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Arguments to pass to Matplotlib's savefig function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/pyplot.py#L38" + }, + "DeltaGenerator.radio": { + "name": "radio", + "signature": "element.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ngenre = st.radio(\n    "What\\'s your favorite movie genre",\n    ('Comedy', 'Drama', 'Documentary'))\n\nif genre == 'Comedy':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn\\'t select comedy.")\n
\n\n \n
\n", + "description": "

Display a radio button widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this radio group is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the radio options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of radio options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe radio.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the radio.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this radio's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the radio button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "horizontal", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", + "default": "false" + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/radio.py#L75" + }, + "DeltaGenerator.select_slider": { + "name": "select_slider", + "signature": "element.select_slider(label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\nimport streamlit as st\n\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nimport streamlit as st\n\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n ", + "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the slider options. All options will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", + "default": "." + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to first option.

\n", + "default": "first" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels from the options.\nargument. It receives the option as an argument and its output\nwill be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the select slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this select_slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the select slider if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any value or tuple of any value", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/select_slider.py#L106" + }, + "DeltaGenerator.selectbox": { + "name": "selectbox", + "signature": "element.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n
\n", + "description": "

Display a select widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels. It receives the option\nas an argument and its output will be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the selectbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this selectbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the selectbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/selectbox.py#L71" + }, + "DeltaGenerator.slider": { + "name": "slider", + "signature": "element.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nimport streamlit as st\n\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nimport streamlit as st\nfrom datetime import time\n\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nimport streamlit as st\nfrom datetime import datetime\n\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n
\n", + "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n
\n

Note

\n

Integer values exceeding +/- (1<<53) - 1 cannot be accurately\nstored or returned by the widget due to serialization contstraints\nbetween the Python server and JavaScript client. You must handle\nsuch numbers as floats, leading to a loss in precision.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The minimum permitted value.\nDefaults to 0 if the value is an int, 0.0 if a float,\nvalue - timedelta(days=14) if a date/datetime, time.min if a time

\n", + "default": "0" + }, + { + "name": "max_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The maximum permitted value.\nDefaults to 100 if the value is an int, 1.0 if a float,\nvalue + timedelta(days=14) if a date/datetime, time.max if a time

\n", + "default": "100" + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to min_value.

\n", + "default": "min_value." + }, + { + "name": "step", + "type_name": "int, float, timedelta, or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. This does not impact the return value.\nFormatter for int/float supports: %d %e %f %g %i\nFormatter for date/time/datetime uses Moment.js notation:\nhttps://momentjs.com/docs/#/displaying/format/

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the slider if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int/float/date/time/datetime or tuple of int/float/date/time/datetime", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/slider.py#L171" + }, + "DeltaGenerator.snow": { + "name": "snow", + "signature": "element.snow()", + "example": "
\n
\nimport streamlit as st\n\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", + "description": "

Draw celebratory snowfall.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/snow.py#L25" + }, + "DeltaGenerator.subheader": { + "name": "subheader", + "signature": "element.subheader(body, anchor=None, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.subheader('This is a subheader')\nst.subheader('A subheader with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in subheader formatting.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str or False", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the subheader.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/heading.py#L93" + }, + "DeltaGenerator.success": { + "name": "success", + "signature": "element.success(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", + "description": "

Display a success message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The success text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/alert.py#L136" + }, + "DeltaGenerator.table": { + "name": "table", + "signature": "element.table(data=None)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n
\n", + "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/dataframe_selector.py#L192" + }, + "DeltaGenerator.tabs": { + "name": "tabs", + "signature": "element.tabs(tabs)", + "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\nimport streamlit as st\n\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n
\n", + "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", + "args": [ + { + "name": "tabs", + "type_name": "list of strings", + "is_optional": false, + "description": "

Creates a tab for each string in the list. The first tab is selected by default.\nThe string is used as the name of the tab and can optionally contain Markdown,\nsupporting the following elements: Bold, Italics, Strikethroughs, Inline Code,\nEmojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": "." + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/layouts.py#L205" + }, + "DeltaGenerator.text": { + "name": "text", + "signature": "element.text(body, *, help=None)", + "example": "
\n
\nimport streamlit as st\n\nst.text('This is some text.')\n
\n
\n", + "description": "

Write fixed-width and preformatted text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the text.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/text.py#L27" + }, + "DeltaGenerator.text_area": { + "name": "text_area", + "signature": "element.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", + "description": "

Display a multi-line text input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Maximum number of characters allowed in text area.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the textarea.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_area's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text area is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text area if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/text_widgets.py#L274" + }, + "DeltaGenerator.text_input": { + "name": "text_input", + "signature": "element.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n
\n", + "description": "

Display a single-line text input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Max number of characters allowed in text input.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"default\" or \"password\"", + "is_optional": false, + "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "autocomplete", + "type_name": "str", + "is_optional": false, + "description": "

An optional value that will be passed to the <input> element's\nautocomplete property. If unspecified, this value will be set to\n"new-password" for "password" inputs, and the empty string for\n"default" inputs. For more details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text input is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/text_widgets.py#L71" + }, + "DeltaGenerator.time_input": { + "name": "time_input", + "signature": "element.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", step=0:15:00)", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n
\n", + "description": "

Display a time input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this time input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.time/datetime.datetime", + "is_optional": false, + "description": "

The value of this widget when it first renders. This will be\ncast to str internally. Defaults to the current time.

\n", + "default": "the" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this time_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the time input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "step", + "type_name": "int or timedelta", + "is_optional": false, + "description": "

The stepping interval in seconds. Defaults to 900, i.e. 15 minutes.\nYou can also pass a datetime.timedelta object.

\n", + "default": "900" + } + ], + "returns": [ + { + "type_name": "datetime.time", + "is_generator": false, + "description": "

The current value of the time input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/time_widgets.py#L213" + }, + "DeltaGenerator.title": { + "name": "title", + "signature": "element.title(body, anchor=None, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.title('This is a title')\nst.title('A title with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str or False", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the title.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/heading.py#L146" + }, + "DeltaGenerator.vega_lite_chart": { + "name": "vega_lite_chart", + "signature": "element.vega_lite_chart(data=None, spec=None, use_container_width=False, theme=\"streamlit\", **kwargs)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(chart_data, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", + "description": "

Display a chart using the Vega-Lite library.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "spec", + "type_name": "dict or None", + "is_optional": false, + "description": "

The Vega-Lite spec for the chart. If the spec was already passed in\nthe previous argument, this must be set to None. See\nhttps://vega.github.io/vega-lite/docs/ for more info.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Same as spec, but as keywords.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/dataframe_selector.py#L545" + }, + "DeltaGenerator.video": { + "name": "video", + "signature": "element.video(data, format=\"video/mp4\", start_time=0)", + "example": "
\n
\nimport streamlit as st\n\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", + "description": "

Display a video player.

\n", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "default": null + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the video file. Defaults to 'video/mp4'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/media.py#L116" + }, + "DeltaGenerator.warning": { + "name": "warning", + "signature": "element.warning(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", + "description": "

Display warning message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The warning text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/alert.py#L71" + }, + "DeltaGenerator.write": { + "name": "write", + "signature": "element.write(*args, unsafe_allow_html=False, **kwargs)", + "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nimport streamlit as st\n\nst.write('Hello, *World!* :sunglasses:')\n
\n\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nimport streamlit as st\nimport pandas as pd\n\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nimport streamlit as st\n\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n
\n", + "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression, emoji shortcodes, and colored text.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(class) : Displays information about a class.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.23.0/lib/streamlit/elements/write.py#L49" + } + }, + "1.24.0": { + "streamlit.altair_chart": { + "name": "altair_chart", + "signature": "st.altair_chart(altair_chart, use_container_width=False, theme=\"streamlit\")", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(chart_data).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n
\n", + "description": "

Display a chart using the Altair library.

\n", + "args": [ + { + "name": "altair_chart", + "type_name": "altair.Chart", + "is_optional": false, + "description": "

The Altair chart object to display.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/dataframe_selector.py#L492" + }, + "streamlit.area_chart": { + "name": "area_chart", + "signature": "st.area_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n
\n", + "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/dataframe_selector.py#L317" + }, + "streamlit.audio": { + "name": "audio", + "signature": "st.audio(data, format=\"audio/wav\", start_time=0, *, sample_rate=None)", + "example": "
\n
\nimport streamlit as st\nimport numpy as np\n\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n\nsample_rate = 44100  # 44100 samples per second\nseconds = 2  # Note duration of 2 seconds\nfrequency_la = 440  # Our played note will be 440 Hz\n# Generate array with seconds*sample_rate steps, ranging between 0 and seconds\nt = np.linspace(0, seconds, seconds * sample_rate, False)\n# Generate a 440 Hz sine wave\nnote_la = np.sin(frequency_la * t * 2 * np.pi)\n\nst.audio(note_la, sample_rate=sample_rate)\n
\n\n \n
\n", + "description": "

Display an audio player.

\n", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw audio data, filename, or a URL pointing to the file to load.\nRaw data formats must include all necessary file headers to match the file\nformat specified via format.\nIf data is a numpy array, it must either be a 1D array of the waveform\nor a 2D array of shape (num_channels, num_samples) with waveforms\nfor all channels. See the default channel order at\nhttp://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx

\n", + "default": "channel" + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + }, + { + "name": "sample_rate", + "type_name": "int or None", + "is_optional": false, + "description": "

The sample rate of the audio data in samples per second. Only required if\ndata is a numpy array.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/media.py#L42" + }, + "streamlit.balloons": { + "name": "balloons", + "signature": "st.balloons()", + "example": "
\n
\nimport streamlit as st\n\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", + "description": "

Draw celebratory balloons.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/balloons.py#L25" + }, + "streamlit.bar_chart": { + "name": "bar_chart", + "signature": "st.bar_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n
\n", + "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/dataframe_selector.py#L404" + }, + "streamlit.bokeh_chart": { + "name": "bokeh_chart", + "signature": "st.bokeh_chart(figure, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n
\n", + "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", + "args": [ + { + "name": "figure", + "type_name": "bokeh.plotting.figure.Figure", + "is_optional": false, + "description": "

A Bokeh figure to plot.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Bokeh's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/bokeh_chart.py#L36" + }, + "streamlit.button": { + "name": "button", + "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\n\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n
\n", + "description": "

Display a button widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/button.py#L61" + }, + "streamlit.cache": { + "name": "cache", + "signature": "st.cache(func=None, persist=False, allow_output_mutation=False, show_spinner=True, suppress_st_warning=False, hash_funcs=None, max_entries=None, ttl=None)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\n@st.cache(persist=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To disable hashing return values, set the allow_output_mutation parameter to True:

\n
\n@st.cache(allow_output_mutation=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. MongoClient) to a hash function (id) like this:

\n
\n@st.cache(hash_funcs={MongoClient: id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "pymongo.mongo_client.MongoClient") to the hash function instead:

\n
\n@st.cache(hash_funcs={"pymongo.mongo_client.MongoClient": id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n
\n", + "description": "

Function decorator to memoize function executions.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to cache. Streamlit hashes the function and dependent code.

\n", + "default": null + }, + { + "name": "persist", + "type_name": "boolean", + "is_optional": false, + "description": "

Whether to persist the cache on disk.

\n", + "default": null + }, + { + "name": "allow_output_mutation", + "type_name": "boolean", + "is_optional": false, + "description": "

Streamlit shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.

\n

If you know what you're doing and would like to override this warning, set this to True.

\n", + "default": null + }, + { + "name": "show_spinner", + "type_name": "boolean", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na cache miss.

\n", + "default": "True" + }, + { + "name": "suppress_st_warning", + "type_name": "boolean", + "is_optional": false, + "description": "

Suppress warnings about calling Streamlit commands from within\nthe cached function.

\n", + "default": null + }, + { + "name": "hash_funcs", + "type_name": "dict or None", + "is_optional": false, + "description": "

Mapping of types or fully qualified names to hash functions. This is used to override\nthe behavior of the hasher inside Streamlit's caching mechanism: when the hasher\nencounters an object, it will first check to see if its type matches a key in this\ndict and, if so, will use the provided function to generate a hash for it. See below\nfor an example of how this can be used.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." + }, + { + "name": "ttl", + "type_name": "float or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.

\n", + "default": "None." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/runtime/legacy_caching/caching.py#L486" + }, + "streamlit.cache_data": { + "name": "cache_data", + "signature": "st.cache_data(func=None, *, ttl, max_entries, show_spinner, persist, experimental_allow_widgets, hash_funcs=None)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\nimport streamlit as st\n\n@st.cache_data(persist="disk")\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

By default, all parameters to a cached function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nconnection = make_database_connection()\nd1 = fetch_and_clean_data(connection, num_rows=10)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nanother_connection = make_database_connection()\nd2 = fetch_and_clean_data(another_connection, num_rows=10)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _database_connection parameter was different\n# in both calls.\n
\n

A cached function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nfetch_and_clean_data.clear()\n# Clear all cached entries for this function.\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. datetime.datetime) to a hash\nfunction (lambda dt: dt.isoformat()) like this:

\n
\nimport streamlit as st\nimport datetime\n\n@st.cache_data(hash_funcs={datetime.datetime: lambda dt: dt.isoformat()})\ndef convert_to_utc(dt: datetime.datetime):\n    return dt.astimezone(datetime.timezone.utc)\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "datetime.datetime") to the hash function instead:

\n
\nimport streamlit as st\nimport datetime\n\n@st.cache_data(hash_funcs={"datetime.datetime": lambda dt: dt.isoformat()})\ndef convert_to_utc(dt: datetime.datetime):\n    return dt.astimezone(datetime.timezone.utc)\n
\n
\n", + "description": "

Decorator to cache functions that return data (e.g. dataframe transforms, database queries, ML inference).

\n

Cached objects are stored in "pickled" form, which means that the return\nvalue of a cached function must be pickleable. Each caller of the cached\nfunction gets its own copy of the cached data.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_data.clear().

\n

To cache global resources, use st.cache_resource instead. Learn more\nabout caching at https://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to cache. Streamlit hashes the function's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float, timedelta, str, or None", + "is_optional": false, + "description": "

The maximum time to keep an entry in the cache. Can be one of:

\n\n

Note that ttl will be ignored if persist="disk" or persist=True.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. When a new entry is added to a full cache,\nthe oldest cached entry will be removed. Defaults to None.

\n", + "default": "None." + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached data is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "persist", + "type_name": "\"disk\", boolean, or None", + "is_optional": false, + "description": "

Optional location to persist cached data to. Passing "disk" (or True)\nwill persist the cached data to the local disk. None (or False) will disable\npersistence. The default is None.

\n", + "default": "None." + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False." + }, + { + "name": "hash_funcs", + "type_name": "dict or None", + "is_optional": false, + "description": "

Mapping of types or fully qualified names to hash functions.\nThis is used to override the behavior of the hasher inside Streamlit's\ncaching mechanism: when the hasher encounters an object, it will first\ncheck to see if its type matches a key in this dict and, if so, will use\nthe provided function to generate a hash for it. See below for an example\nof how this can be used.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/runtime/caching/cache_data_api.py#L384" + }, + "streamlit.cache_resource": { + "name": "cache_resource", + "signature": "st.cache_resource(func, *, ttl, max_entries, show_spinner, validate, experimental_allow_widgets, hash_funcs=None)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(url):\n    # Create a database session object that points to the URL.\n    return session\n\ns1 = get_database_session(SESSION_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(SESSION_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the connection object in s1 is the same as in s2.\n\ns3 = get_database_session(SESSION_URL_2)\n# This is a different URL, so the function executes.\n
\n

By default, all parameters to a cache_resource function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\ns1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _sessionmaker parameter was different\n# in both calls.\n
\n

A cache_resource function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\nget_database_session.clear()\n# Clear all cached entries for this function.\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. Person) to a hash\nfunction (str) like this:

\n
\nimport streamlit as st\nfrom pydantic import BaseModel\n\nclass Person(BaseModel):\n    name: str\n\n@st.cache_resource(hash_funcs={Person: str})\ndef get_person_name(person: Person):\n    return person.name\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "__main__.Person") to the hash function instead:

\n
\nimport streamlit as st\nfrom pydantic import BaseModel\n\nclass Person(BaseModel):\n    name: str\n\n@st.cache_resource(hash_funcs={"__main__.Person": str})\ndef get_person_name(person: Person):\n    return person.name\n
\n
\n", + "description": "

Decorator to cache functions that return global resources (e.g. database connections, ML models).

\n

Cached objects are shared across all users, sessions, and reruns. They\nmust be thread-safe because they can be accessed from multiple threads\nconcurrently. If thread safety is an issue, consider using st.session_state\nto store resources per session instead.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_resource.clear().

\n

To cache data, use st.cache_data instead. Learn more about caching at\nhttps://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function that creates the cached resource. Streamlit hashes the\nfunction's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float, timedelta, str, or None", + "is_optional": false, + "description": "

The maximum time to keep an entry in the cache. Can be one of:

\n\n

Note that ttl will be ignored if persist="disk" or persist=True.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. When a new entry is added to a full cache,\nthe oldest cached entry will be removed. Defaults to None.

\n", + "default": "None." + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached resource is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "validate", + "type_name": "callable or None", + "is_optional": false, + "description": "

An optional validation function for cached data. validate is called\neach time the cached value is accessed. It receives the cached value as\nits only parameter and it must return a boolean. If validate returns\nFalse, the current cached value is discarded, and the decorated function\nis called to compute a new value. This is useful e.g. to check the\nhealth of database connections.

\n", + "default": null + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False." + }, + { + "name": "hash_funcs", + "type_name": "dict or None", + "is_optional": false, + "description": "

Mapping of types or fully qualified names to hash functions.\nThis is used to override the behavior of the hasher inside Streamlit's\ncaching mechanism: when the hasher encounters an object, it will first\ncheck to see if its type matches a key in this dict and, if so, will use\nthe provided function to generate a hash for it. See below for an example\nof how this can be used.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/runtime/caching/cache_resource_api.py#L264" + }, + "streamlit.camera_input": { + "name": "camera_input", + "signature": "st.camera_input(label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", + "description": "

Display a widget that returns pictures from the user's webcam.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this widget is used for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the camera input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this camera_input's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile", + "is_generator": false, + "description": "

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/camera_input.py#L109" + }, + "streamlit.caption": { + "name": "caption", + "signature": "st.caption(body, unsafe_allow_html=False, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.caption('This is a string that explains something above.')\nst.caption('A caption with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the caption.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/markdown.py#L132" + }, + "streamlit.chat_input": { + "name": "chat_input", + "signature": "st.chat_input(placeholder=\"Your message\", *, key=None, max_chars=None, disabled=False, on_submit=None, args=None, kwargs=None)", + "examples": "
\n
\nimport streamlit as st\n\nprompt = st.chat_input("Say something")\nif prompt:\n    st.write(f"User has sent the following prompt: {prompt}")\n
\n\n \n
\n", + "description": "

Display a chat input widget.

\n
\n

Warning

\n

Chat input can only be used once per app page and inside the main area of the app.\nIt cannot be used in the sidebar, columns, expanders, forms or tabs.\nWe plan to support this in the future.

\n
\n", + "args": [ + { + "name": "placeholder", + "type_name": "str", + "is_optional": false, + "description": "

A placeholder text shown when the chat input is empty. Defaults to\n"Your message". For accessibility reasons, you should not use an\nempty string.

\n", + "default": "s" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget based on\nits content. Multiple widgets of the same type may not share the same key.

\n", + "default": null + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of characters that can be entered. If None\n(default), there will be no maximum.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

Whether the chat input should be disabled. Defaults to False.

\n", + "default": "False." + }, + { + "name": "on_submit", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when the chat input's value is submitted.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "str or None", + "is_generator": false, + "description": "

The current (non-empty) value of the text input widget on the last\nrun of the app, None otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/chat.py#L208" + }, + "streamlit.chat_message": { + "name": "chat_message", + "signature": "st.chat_message(name, *, avatar=None)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\nimport numpy as np\n\nwith st.chat_message("user"):\n    st.write("Hello \ud83d\udc4b")\n    st.line_chart(np.random.randn(30, 3))\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\nmessage = st.chat_message("assistant")\nmessage.write("Hello human")\nmessage.bar_chart(np.random.randn(30, 3))\n
\n\n \n
\n", + "description": "

Insert a chat message container.

\n

To add elements to the returned container, you can use with notation\n(preferred) or just call methods directly on the returned object. See the\nexamples below.

\n", + "args": [ + { + "name": "name", + "type_name": "\"user\", \"assistant\", or str", + "is_optional": false, + "description": "

The name of the message author. Can be \u201cuser\u201d or \u201cassistant\u201d to\nenable preset styling and avatars.

\n

Currently, the name is not shown in the UI but is only set as an\naccessibility label. For accessibility reasons, you should not use\nan empty string.

\n", + "default": null + }, + { + "name": "avatar", + "type_name": "str, numpy.ndarray, or BytesIO", + "is_optional": false, + "description": "

The avatar shown next to the message. Can be one of:

\n
    \n
  • A single emoji, e.g. "\ud83e\uddd1\u200d\ud83d\udcbb", "\ud83e\udd16", "\ud83e\udd96". Shortcodes are not supported.
  • \n
  • \n
    An image using one of the formats allowed for st.image: path of a local
    \n
    image file; URL to fetch the image from; array of shape (w,h) or (w,h,1)\nfor a monochrome image, (w,h,3) for a color image, or (w,h,4) for an RGBA image.
    \n
    \n
  • \n
\n

If None (default), uses default icons if name is "user" or\n"assistant", or the first letter of the name value.

\n", + "default": "icons" + } + ], + "returns": [ + { + "type_name": "Container", + "is_generator": false, + "description": "

A single container that can hold multiple elements.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/chat.py#L112" + }, + "streamlit.checkbox": { + "name": "checkbox", + "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n
\n", + "description": "

Display a checkbox widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this checkbox is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "value", + "type_name": "bool", + "is_optional": false, + "description": "

Preselect the checkbox when it first renders. This will be\ncast to bool internally.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the checkbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this checkbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

Whether or not the checkbox is checked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/checkbox.py#L52" + }, + "streamlit.code": { + "name": "code", + "signature": "st.code(body, language=\"python\", line_numbers=False)", + "example": "
\n
\nimport streamlit as st\n\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", + "description": "

Display a code block with optional syntax highlighting.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as code.

\n", + "default": null + }, + { + "name": "language", + "type_name": "str or None", + "is_optional": false, + "description": "

The language that the code is written in, for syntax highlighting.\nIf None, the code will be unstyled. Defaults to "python".

\n

For a list of available language values, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", + "default": "s" + }, + { + "name": "line_numbers", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean indicating whether to show line numbers to the\nleft of the code block. Defaults to False.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/code.py#L27" + }, + "streamlit.color_picker": { + "name": "color_picker", + "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n
\n", + "description": "

Display a color picker widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "str", + "is_optional": false, + "description": "

The hex value of this widget when it first renders. If None,\ndefaults to black.

\n", + "default": "black." + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the color picker.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this color_picker's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The selected color as a hex string.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/color_picker.py#L52" + }, + "streamlit.columns": { + "name": "columns", + "signature": "st.columns(spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or iterable of numbers", + "is_optional": false, + "description": "

Controls the number and width of columns to insert. Can be one of:

\n
    \n
  • An integer that specifies the number of columns. All columns have equal\nwidth in this case.
  • \n
  • An iterable of numbers (int or float) that specify the relative width of\neach column. E.g. [0.7, 0.3] creates two columns where the first\none takes up 70% of the available with and the second one takes up 30%.\nOr [1, 2, 3] creates three columns where the second one is two times\nthe width of the first one, and the third one is three times that width.
  • \n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "\"small\", \"medium\", or \"large\"", + "is_optional": false, + "description": "

The size of the gap between the columns. Defaults to "small". This\nargument can only be supplied by keyword.

\n", + "default": "s" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/layouts.py#L75" + }, + "streamlit.container": { + "name": "container", + "signature": "st.container()", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/layouts.py#L27" + }, + "streamlit.data_editor": { + "name": "data_editor", + "signature": "st.data_editor(data, *, width=None, height=None, use_container_width=False, hide_index=None, column_order=None, column_config=None, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

Or you can customize the data editor via column_config, hide_index, column_order, or disabled:

\n
\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    [\n        {"command": "st.selectbox", "rating": 4, "is_widget": True},\n        {"command": "st.balloons", "rating": 5, "is_widget": False},\n        {"command": "st.time_input", "rating": 3, "is_widget": True},\n    ]\n)\nedited_df = st.data_editor(\n    df,\n    column_config={\n        "command": "Streamlit Command",\n        "rating": st.column_config.NumberColumn(\n            "Your rating",\n            help="How much do you like this command (1-5)?",\n            min_value=1,\n            max_value=5,\n            step=1,\n            format="%d \u2b50",\n        ),\n        "is_widget": "Widget ?",\n    },\n    disabled=["command", "is_widget"],\n    hide_index=True,\n)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n
\n", + "description": "

Display a data editor widget.

\n

The data editor widget allows you to edit dataframes and many other data structures in a table-like UI.

\n
\n

Warning

\n

When going from st.experimental_data_editor to st.data_editor in\n1.23.0, the data editor's representation in st.session_state was changed.\nThe edited_cells dictionary is now called edited_rows and uses a\ndifferent format ({0: {"column name": "edited value"}} instead of\n{"0:1": "edited value"}). You may need to adjust the code if your app uses\nst.experimental_data_editor in combination with st.session_state."

\n
\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None", + "is_optional": false, + "description": "

The data to edit in the data editor.

\n
\n

Note

\n

Mixing data types within a column can make the column uneditable.\nAdditionally, the following data types are not yet supported for editing:\ncomplex, list, tuple, bytes, bytearray, memoryview, dict, set, frozenset,\ndatetime.timedelta, decimal.Decimal, fractions.Fraction, pandas.Interval,\npandas.Period, pandas.Timedelta.

\n
\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the data editor expressed in pixels. If None, the width will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the data editor expressed in pixels. If None, the height will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the data editor width to the width of the parent container.\nThis takes precedence over the width argument. Defaults to False.

\n", + "default": "False." + }, + { + "name": "hide_index", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether to hide the index column(s). If None (default), the visibility of\nindex columns is automatically determined based on the data.

\n", + "default": null + }, + { + "name": "column_order", + "type_name": "iterable of str or None", + "is_optional": false, + "description": "

Specifies the display order of columns. This also affects which columns are\nvisible. For example, column_order=("col2", "col1") will display 'col2'\nfirst, followed by 'col1', and will hide all other non-index columns. If\nNone (default), the order is inherited from the original data structure.

\n", + "default": null + }, + { + "name": "column_config", + "type_name": "dict or None", + "is_optional": false, + "description": "

Configures how columns are displayed, e.g. their title, visibility, type, or\nformat, as well as editing properties such as min/max value or step.\nThis needs to be a dictionary where each key is a column name and the value\nis one of:

\n
    \n
  • None to hide the column.
  • \n
  • A string to set the display label of the column.
  • \n
  • One of the column types defined under st.column_config, e.g.\nst.column_config.NumberColumn("Dollar values\u201d, format=\u201d$ %d") to show\na column as dollar amounts. See more info on the available column types\nand config options here.
  • \n
\n

To configure the index column(s), use _index as the column name.

\n", + "default": null + }, + { + "name": "num_rows", + "type_name": "\"fixed\" or \"dynamic\"", + "is_optional": false, + "description": "

Specifies if the user can add and delete rows in the data editor.\nIf "fixed", the user cannot add or delete rows. If "dynamic", the user can\nadd and delete rows in the data editor, but column sorting is disabled.\nDefaults to "fixed".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool or iterable of str", + "is_optional": false, + "description": "

Controls the editing of columns. If True, editing is disabled for all columns.\nIf an iterable of column names is provided (e.g., disabled=("col1", "col2")),\nonly the specified columns will be disabled for editing. If False (default),\nall columns that support editing are editable.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the unique key for this widget. If this\nis omitted, a key will be generated for the widget based on its\ncontent. Multiple widgets of the same type may not share the same\nkey.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this data_editor's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "pandas.DataFrame, pandas.Series, pyarrow.Table, numpy.ndarray, list, set, tuple, or dict.", + "is_generator": false, + "description": "

The edited data. The edited data is returned in its original data type if\nit corresponds to any of the supported return types. All other data types\nare returned as a pd.DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/data_editor.py#L527" + }, + "streamlit.dataframe": { + "name": "dataframe", + "signature": "st.dataframe(data=None, width=None, height=None, *, use_container_width=False, hide_index=None, column_order=None, column_config=None)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n

Or you can customize the dataframe via column_config, hide_index, or column_order:

\n
\nimport random\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    {\n        "name": ["Roadmap", "Extras", "Issues"],\n        "url": ["https://roadmap.streamlit.app", "https://extras.streamlit.app", "https://issues.streamlit.app"],\n        "stars": [random.randint(0, 1000) for _ in range(3)],\n        "views_history": [[random.randint(0, 5000) for _ in range(30)] for _ in range(3)],\n    }\n)\nst.dataframe(\n    df,\n    column_config={\n        "name": "App name",\n        "stars": st.column_config.NumberColumn(\n            "Github Stars",\n            help="Number of stars on GitHub",\n            format="%d \u2b50",\n        ),\n        "url": st.column_config.LinkColumn("App URL"),\n        "views_history": st.column_config.LineChartColumn(\n            "Views (past 30 days)", y_min=0, y_max=5000\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Display a dataframe as an interactive table.

\n

This command works with dataframes from Pandas, PyArrow, Snowpark, and PySpark.\nIt can also display several other types that can be converted to dataframes,\ne.g. numpy arrays, lists, sets and dictionaries.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the dataframe expressed in pixels. If None, the width\nwill be automatically calculated based on the column content.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the dataframe expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the dataframe width to the width of the parent container.\nThis takes precedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "hide_index", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether to hide the index column(s). If None (default), the visibility of\nindex columns is automatically determined based on the data.

\n", + "default": null + }, + { + "name": "column_order", + "type_name": "iterable of str or None", + "is_optional": false, + "description": "

Specifies the display order of columns. This also affects which columns are\nvisible. For example, column_order=("col2", "col1") will display 'col2'\nfirst, followed by 'col1', and will hide all other non-index columns. If\nNone (default), the order is inherited from the original data structure.

\n", + "default": null + }, + { + "name": "column_config", + "type_name": "dict or None", + "is_optional": false, + "description": "

Configures how columns are displayed, e.g. their title, visibility, type, or\nformat. This needs to be a dictionary where each key is a column name and\nthe value is one of:

\n
    \n
  • None to hide the column.
  • \n
  • A string to set the display label of the column.
  • \n
  • One of the column types defined under st.column_config, e.g.\nst.column_config.NumberColumn("Dollar values\u201d, format=\u201d$ %d") to show\na column as dollar amounts. See more info on the available column types\nand config options here.
  • \n
\n

To configure the index column(s), use _index as the column name.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/dataframe_selector.py#L43" + }, + "streamlit.date_input": { + "name": "date_input", + "signature": "st.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nd = st.date_input(\n    "When\\'s your birthday",\n    datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n
\n", + "description": "

Display a date input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this date input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", + "is_optional": false, + "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", + "default": "today" + }, + { + "name": "min_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", + "default": "value" + }, + { + "name": "max_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", + "default": "value" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this date_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.date or a tuple with 0-2 dates", + "is_generator": false, + "description": "

The current value of the date input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/time_widgets.py#L398" + }, + "streamlit.divider": { + "name": "divider", + "signature": "st.divider()", + "example": "
\n
\nimport streamlit as st\n\nst.divider()\n
\n
\n", + "description": "

Display a horizontal rule.

\n
\n

Note

\n

You can achieve the same effect with st.write("---") or\neven just "---" in your script (via magic).

\n
\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/markdown.py#L244" + }, + "streamlit.download_button": { + "name": "download_button", + "signature": "st.download_button(label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False, use_container_width=False)", + "examples": "
\n

Download a large DataFrame as a CSV:

\n
\nimport streamlit as st\n\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\nimport streamlit as st\n\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nimport streamlit as st\n\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nimport streamlit as st\n\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n
\n", + "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "data", + "type_name": "str or bytes or file", + "is_optional": false, + "description": "

The contents of the file to be downloaded. See example below for\ncaching techniques to avoid recomputing this data unnecessarily.

\n", + "default": null + }, + { + "name": "file_name", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the name of the file to be downloaded,\nsuch as 'my_file.csv'. If not specified, the name will be\nautomatically generated.

\n", + "default": null + }, + { + "name": "mime", + "type_name": "str or None", + "is_optional": false, + "description": "

The MIME type of the data. If None, defaults to "text/plain"\n(if data is of type str or is a textual file) or\n"application/octet-stream" (if data is of type bytes or is a\nbinary file).

\n", + "default": "s" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/button.py#L169" + }, + "streamlit.echo": { + "name": "echo", + "signature": "st.echo(code_location=\"above\")", + "example": "
\n
\nimport streamlit as st\n\nwith st.echo():\n    st.write('This code will be printed')\n
\n
\n", + "description": "

Use in a with block to draw some code on the app, then execute it.

\n", + "args": [ + { + "name": "code_location", + "type_name": "\"above\" or \"below\"", + "is_optional": false, + "description": "

Whether to show the echoed code before or after the results of the\nexecuted code block.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/echo.py#L27" + }, + "streamlit.empty": { + "name": "empty", + "signature": "st.empty()", + "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport streamlit as st\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nimport streamlit as st\n\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", + "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/empty.py#L24" + }, + "streamlit.error": { + "name": "error", + "signature": "st.error(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", + "description": "

Display error message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The error text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/alert.py#L39" + }, + "streamlit.exception": { + "name": "exception", + "signature": "st.exception(exception)", + "example": "
\n
\nimport streamlit as st\n\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", + "description": "

Display an exception.

\n", + "args": [ + { + "name": "exception", + "type_name": "Exception", + "is_optional": false, + "description": "

The exception to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/exception.py#L50" + }, + "streamlit.expander": { + "name": "expander", + "signature": "st.expander(label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/layouts.py#L315" + }, + "streamlit.experimental_connection": { + "name": "experimental_connection", + "signature": "st.experimental_connection(name, type=None, max_entries=None, ttl=None, **kwargs)", + "examples": "
\n

The easiest way to create a first-party (SQL or Snowpark) connection is to use their\ndefault names and define corresponding sections in your secrets.toml file.

\n
\nimport streamlit as st\nconn = st.experimental_connection("sql") # Config section defined in [connections.sql] in secrets.toml.\n
\n

Creating a SQLConnection with a custom name requires you to explicitly specify the\ntype. If type is not passed as a kwarg, it must be set in the appropriate section of\nsecrets.toml.

\n
\nimport streamlit as st\nconn1 = st.experimental_connection("my_sql_connection", type="sql") # Config section defined in [connections.my_sql_connection].\nconn2 = st.experimental_connection("my_other_sql_connection") # type must be set in [connections.my_other_sql_connection].\n
\n

Passing the full module path to the connection class that you want to use can be\nuseful, especially when working with a custom connection:

\n
\nimport streamlit as st\nconn = st.experimental_connection("my_sql_connection", type="streamlit.connections.SQLConnection")\n
\n

Finally, you can pass the connection class to use directly to this function. Doing\nso allows static type checking tools such as mypy to infer the exact return\ntype of st.experimental_connection.

\n
\nimport streamlit as st\nfrom streamlit.connections import SQLConnection\nconn = st.experimental_connection("my_sql_connection", type=SQLConnection)\n
\n
\n", + "description": "

Create a new connection to a data store or API, or return an existing one.

\n

Config options, credentials, secrets, etc. for connections are taken from various\nsources:

\n
    \n
  • Any connection-specific configuration files.
  • \n
  • An app's secrets.toml files.
  • \n
  • The kwargs passed to this function.
  • \n
\n", + "args": [ + { + "name": "name", + "type_name": "str", + "is_optional": false, + "description": "

The connection name used for secrets lookup in [connections.<name>].\nType will be inferred from passing "sql" or "snowpark".

\n", + "default": null + }, + { + "name": "type", + "type_name": "str, connection class, or None", + "is_optional": false, + "description": "

The type of connection to create. It can be a keyword ("sql" or "snowpark"),\na path to an importable class, or an imported class reference. All classes\nmust extend st.connections.ExperimentalBaseConnection and implement the\n_connect() method. If the type kwarg is None, a type field must be set\nin the connection's section in secrets.toml.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of connections to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None." + }, + { + "name": "ttl", + "type_name": "float, timedelta, or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep results in the cache, or\nNone if cached results should not expire. The default is None.

\n", + "default": "None." + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Additional connection specific kwargs that are passed to the Connection's\n_connect() method. Learn more from the specific Connection's documentation.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "Connection object", + "is_generator": false, + "description": "

An initialized Connection object of the specified type.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/runtime/connection_factory.py#L170" + }, + "streamlit.experimental_data_editor": { + "name": "experimental_data_editor", + "signature": "st.experimental_data_editor(data, *, width=None, height=None, use_container_width=False, hide_index=None, column_order=None, column_config=None, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

Or you can customize the data editor via column_config, hide_index, column_order, or disabled:

\n
\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    [\n        {"command": "st.selectbox", "rating": 4, "is_widget": True},\n        {"command": "st.balloons", "rating": 5, "is_widget": False},\n        {"command": "st.time_input", "rating": 3, "is_widget": True},\n    ]\n)\nedited_df = st.data_editor(\n    df,\n    column_config={\n        "command": "Streamlit Command",\n        "rating": st.column_config.NumberColumn(\n            "Your rating",\n            help="How much do you like this command (1-5)?",\n            min_value=1,\n            max_value=5,\n            step=1,\n            format="%d \u2b50",\n        ),\n        "is_widget": "Widget ?",\n    },\n    disabled=["command", "is_widget"],\n    hide_index=True,\n)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n
\n", + "description": "

Display a data editor widget.

\n

The data editor widget allows you to edit dataframes and many other data structures in a table-like UI.

\n
\n

Warning

\n

When going from st.experimental_data_editor to st.data_editor in\n1.23.0, the data editor's representation in st.session_state was changed.\nThe edited_cells dictionary is now called edited_rows and uses a\ndifferent format ({0: {"column name": "edited value"}} instead of\n{"0:1": "edited value"}). You may need to adjust the code if your app uses\nst.experimental_data_editor in combination with st.session_state."

\n
\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None", + "is_optional": false, + "description": "

The data to edit in the data editor.

\n
\n

Note

\n

Mixing data types within a column can make the column uneditable.\nAdditionally, the following data types are not yet supported for editing:\ncomplex, list, tuple, bytes, bytearray, memoryview, dict, set, frozenset,\ndatetime.timedelta, decimal.Decimal, fractions.Fraction, pandas.Interval,\npandas.Period, pandas.Timedelta.

\n
\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the data editor expressed in pixels. If None, the width will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the data editor expressed in pixels. If None, the height will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the data editor width to the width of the parent container.\nThis takes precedence over the width argument. Defaults to False.

\n", + "default": "False." + }, + { + "name": "hide_index", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether to hide the index column(s). If None (default), the visibility of\nindex columns is automatically determined based on the data.

\n", + "default": null + }, + { + "name": "column_order", + "type_name": "iterable of str or None", + "is_optional": false, + "description": "

Specifies the display order of columns. This also affects which columns are\nvisible. For example, column_order=("col2", "col1") will display 'col2'\nfirst, followed by 'col1', and will hide all other non-index columns. If\nNone (default), the order is inherited from the original data structure.

\n", + "default": null + }, + { + "name": "column_config", + "type_name": "dict or None", + "is_optional": false, + "description": "

Configures how columns are displayed, e.g. their title, visibility, type, or\nformat, as well as editing properties such as min/max value or step.\nThis needs to be a dictionary where each key is a column name and the value\nis one of:

\n
    \n
  • None to hide the column.
  • \n
  • A string to set the display label of the column.
  • \n
  • One of the column types defined under st.column_config, e.g.\nst.column_config.NumberColumn("Dollar values\u201d, format=\u201d$ %d") to show\na column as dollar amounts. See more info on the available column types\nand config options here.
  • \n
\n

To configure the index column(s), use _index as the column name.

\n", + "default": null + }, + { + "name": "num_rows", + "type_name": "\"fixed\" or \"dynamic\"", + "is_optional": false, + "description": "

Specifies if the user can add and delete rows in the data editor.\nIf "fixed", the user cannot add or delete rows. If "dynamic", the user can\nadd and delete rows in the data editor, but column sorting is disabled.\nDefaults to "fixed".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool or iterable of str", + "is_optional": false, + "description": "

Controls the editing of columns. If True, editing is disabled for all columns.\nIf an iterable of column names is provided (e.g., disabled=("col1", "col2")),\nonly the specified columns will be disabled for editing. If False (default),\nall columns that support editing are editable.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the unique key for this widget. If this\nis omitted, a key will be generated for the widget based on its\ncontent. Multiple widgets of the same type may not share the same\nkey.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this data_editor's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "pandas.DataFrame, pandas.Series, pyarrow.Table, numpy.ndarray, list, set, tuple, or dict.", + "is_generator": false, + "description": "

The edited data. The edited data is returned in its original data type if\nit corresponds to any of the supported return types. All other data types\nare returned as a pd.DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/data_editor.py#L527" + }, + "streamlit.experimental_get_query_params": { + "name": "experimental_get_query_params", + "signature": "st.experimental_get_query_params()", + "example": "
\n

Let's say the user's web browser is at\nhttp://localhost:8501/?show_map=True&selected=asia&selected=america.\nThen, you can get the query parameters using the following:

\n
\nimport streamlit as st\n\nst.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\n

Note that the values in the returned dict are always lists. This is\nbecause we internally use Python's urllib.parse.parse_qs(), which behaves\nthis way. And this behavior makes sense when you consider that every item\nin a query string is potentially a 1-element array.

\n
\n", + "description": "

Return the query parameters that is currently showing in the browser's URL bar.

\n", + "args": [], + "returns": [ + { + "type_name": "dict", + "is_generator": false, + "description": "

The current query parameters as a dict. "Query parameters" are the part of the URL that comes\nafter the first "?".

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/commands/query_params.py#L29" + }, + "streamlit.experimental_memo": { + "name": "experimental_memo", + "signature": "st.experimental_memo(func=None, *, ttl, max_entries, show_spinner, persist, experimental_allow_widgets, hash_funcs=None)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\nimport streamlit as st\n\n@st.cache_data(persist="disk")\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

By default, all parameters to a cached function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nconnection = make_database_connection()\nd1 = fetch_and_clean_data(connection, num_rows=10)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nanother_connection = make_database_connection()\nd2 = fetch_and_clean_data(another_connection, num_rows=10)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _database_connection parameter was different\n# in both calls.\n
\n

A cached function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nfetch_and_clean_data.clear()\n# Clear all cached entries for this function.\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. datetime.datetime) to a hash\nfunction (lambda dt: dt.isoformat()) like this:

\n
\nimport streamlit as st\nimport datetime\n\n@st.cache_data(hash_funcs={datetime.datetime: lambda dt: dt.isoformat()})\ndef convert_to_utc(dt: datetime.datetime):\n    return dt.astimezone(datetime.timezone.utc)\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "datetime.datetime") to the hash function instead:

\n
\nimport streamlit as st\nimport datetime\n\n@st.cache_data(hash_funcs={"datetime.datetime": lambda dt: dt.isoformat()})\ndef convert_to_utc(dt: datetime.datetime):\n    return dt.astimezone(datetime.timezone.utc)\n
\n
\n", + "description": "

Decorator to cache functions that return data (e.g. dataframe transforms, database queries, ML inference).

\n

Cached objects are stored in "pickled" form, which means that the return\nvalue of a cached function must be pickleable. Each caller of the cached\nfunction gets its own copy of the cached data.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_data.clear().

\n

To cache global resources, use st.cache_resource instead. Learn more\nabout caching at https://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to cache. Streamlit hashes the function's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float, timedelta, str, or None", + "is_optional": false, + "description": "

The maximum time to keep an entry in the cache. Can be one of:

\n\n

Note that ttl will be ignored if persist="disk" or persist=True.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. When a new entry is added to a full cache,\nthe oldest cached entry will be removed. Defaults to None.

\n", + "default": "None." + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached data is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "persist", + "type_name": "\"disk\", boolean, or None", + "is_optional": false, + "description": "

Optional location to persist cached data to. Passing "disk" (or True)\nwill persist the cached data to the local disk. None (or False) will disable\npersistence. The default is None.

\n", + "default": "None." + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False." + }, + { + "name": "hash_funcs", + "type_name": "dict or None", + "is_optional": false, + "description": "

Mapping of types or fully qualified names to hash functions.\nThis is used to override the behavior of the hasher inside Streamlit's\ncaching mechanism: when the hasher encounters an object, it will first\ncheck to see if its type matches a key in this dict and, if so, will use\nthe provided function to generate a hash for it. See below for an example\nof how this can be used.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/runtime/caching/cache_data_api.py#L384" + }, + "streamlit.experimental_rerun": { + "name": "experimental_rerun", + "signature": "st.experimental_rerun()", + "description": "

Rerun the script immediately.

\n

When st.experimental_rerun() is called, the script is halted - no\nmore statements will be run, and the script will be queued to re-run\nfrom the top.

\n

If this function is called outside of Streamlit, it will raise an\nException.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/commands/execution_control.py#L46" + }, + "streamlit.experimental_set_query_params": { + "name": "experimental_set_query_params", + "signature": "st.experimental_set_query_params(**query_params)", + "example": "
\n

To point the user's web browser to something like\n"http://localhost:8501/?show_map=True&selected=asia&selected=america",\nyou would do the following:

\n
\nimport streamlit as st\n\nst.experimental_set_query_params(\n    show_map=True,\n    selected=["asia", "america"],\n)\n
\n
\n", + "description": "

Set the query parameters that are shown in the browser's URL bar.

\n
\n

Warning

\n

Query param embed cannot be set using this method.

\n
\n", + "args": [ + { + "name": "**query_params", + "type_name": "dict", + "is_optional": false, + "description": "

The query parameters to set, as key-value pairs.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/commands/query_params.py#L65" + }, + "streamlit.experimental_singleton": { + "name": "experimental_singleton", + "signature": "st.experimental_singleton(func, *, ttl, max_entries, show_spinner, validate, experimental_allow_widgets, hash_funcs=None)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(url):\n    # Create a database session object that points to the URL.\n    return session\n\ns1 = get_database_session(SESSION_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(SESSION_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the connection object in s1 is the same as in s2.\n\ns3 = get_database_session(SESSION_URL_2)\n# This is a different URL, so the function executes.\n
\n

By default, all parameters to a cache_resource function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\ns1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _sessionmaker parameter was different\n# in both calls.\n
\n

A cache_resource function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\nget_database_session.clear()\n# Clear all cached entries for this function.\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. Person) to a hash\nfunction (str) like this:

\n
\nimport streamlit as st\nfrom pydantic import BaseModel\n\nclass Person(BaseModel):\n    name: str\n\n@st.cache_resource(hash_funcs={Person: str})\ndef get_person_name(person: Person):\n    return person.name\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "__main__.Person") to the hash function instead:

\n
\nimport streamlit as st\nfrom pydantic import BaseModel\n\nclass Person(BaseModel):\n    name: str\n\n@st.cache_resource(hash_funcs={"__main__.Person": str})\ndef get_person_name(person: Person):\n    return person.name\n
\n
\n", + "description": "

Decorator to cache functions that return global resources (e.g. database connections, ML models).

\n

Cached objects are shared across all users, sessions, and reruns. They\nmust be thread-safe because they can be accessed from multiple threads\nconcurrently. If thread safety is an issue, consider using st.session_state\nto store resources per session instead.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_resource.clear().

\n

To cache data, use st.cache_data instead. Learn more about caching at\nhttps://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function that creates the cached resource. Streamlit hashes the\nfunction's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float, timedelta, str, or None", + "is_optional": false, + "description": "

The maximum time to keep an entry in the cache. Can be one of:

\n\n

Note that ttl will be ignored if persist="disk" or persist=True.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. When a new entry is added to a full cache,\nthe oldest cached entry will be removed. Defaults to None.

\n", + "default": "None." + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached resource is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "validate", + "type_name": "callable or None", + "is_optional": false, + "description": "

An optional validation function for cached data. validate is called\neach time the cached value is accessed. It receives the cached value as\nits only parameter and it must return a boolean. If validate returns\nFalse, the current cached value is discarded, and the decorated function\nis called to compute a new value. This is useful e.g. to check the\nhealth of database connections.

\n", + "default": null + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False." + }, + { + "name": "hash_funcs", + "type_name": "dict or None", + "is_optional": false, + "description": "

Mapping of types or fully qualified names to hash functions.\nThis is used to override the behavior of the hasher inside Streamlit's\ncaching mechanism: when the hasher encounters an object, it will first\ncheck to see if its type matches a key in this dict and, if so, will use\nthe provided function to generate a hash for it. See below for an example\nof how this can be used.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/runtime/caching/cache_resource_api.py#L264" + }, + "streamlit.file_uploader": { + "name": "file_uploader", + "signature": "st.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nimport streamlit as st\nimport pandas as pd\nfrom io import StringIO\n\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nimport streamlit as st\n\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n
\n", + "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this file uploader is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str or list of str or None", + "is_optional": false, + "description": "

Array of allowed extensions. ['png', 'jpg']\nThe default is None, which means all extensions are allowed.

\n", + "default": "None" + }, + { + "name": "accept_multiple_files", + "type_name": "bool", + "is_optional": false, + "description": "

If True, allows the user to upload multiple files at the same time,\nin which case the return value will be a list of files.\nDefault: False

\n", + "default": "False" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the file uploader.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this file_uploader's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the file uploader if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile or list of UploadedFile", + "is_generator": false, + "description": "
    \n
  • If accept_multiple_files is False, returns either None or\nan UploadedFile object.
  • \n
  • If accept_multiple_files is True, returns a list with the\nuploaded files as UploadedFile objects. If no files were\nuploaded, returns an empty list.
  • \n
\n

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/file_uploader.py#L214" + }, + "streamlit.form": { + "name": "form", + "signature": "st.form(key, clear_on_submit=False)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n

Inserting elements out of order:

\n
\nimport streamlit as st\n\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n
\n", + "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

A string that identifies the form. Each form must have its own\nkey. (This key is not displayed to the user in the interface.)

\n", + "default": null + }, + { + "name": "clear_on_submit", + "type_name": "bool", + "is_optional": false, + "description": "

If True, all widgets inside the form will be reset to their default\nvalues after the user presses the Submit button. Defaults to False.\n(Note that Custom Components are unaffected by this flag, and\nwill not be reset to their defaults on form submission.)

\n", + "default": "values" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/form.py#L118" + }, + "streamlit.form_submit_button": { + "name": "form_submit_button", + "signature": "st.form_submit_button(label=\"Submit\", help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nDefaults to "Submit".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

A tooltip that gets displayed when the button is hovered over.\nDefaults to None.

\n", + "default": "None." + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/form.py#L211" + }, + "streamlit.get_option": { + "name": "get_option", + "signature": "st.get_option(key)", + "description": "

Return the current value of a given Streamlit config option.

\n

Run streamlit config show in the terminal to see all available options.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

The config option key of the form "section.optionName". To see all\navailable options, run streamlit config show on a terminal.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/config.py#L131" + }, + "streamlit.graphviz_chart": { + "name": "graphviz_chart", + "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nimport graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n
\n", + "description": "

Display a graph using the dagre-d3 library.

\n", + "args": [ + { + "name": "figure_or_dot", + "type_name": "graphviz.dot.Graph, graphviz.dot.Digraph, str", + "is_optional": false, + "description": "

The Graphlib graph object or dot string to display

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/graphviz_chart.py#L39" + }, + "streamlit.header": { + "name": "header", + "signature": "st.header(body, anchor=None, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.header('This is a header')\nst.header('A header with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in header formatting.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str or False", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the header.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/heading.py#L40" + }, + "streamlit.help": { + "name": "help", + "signature": "st.help(obj=)", + "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nimport streamlit as st\nimport pandas\n\nst.help(pandas.DataFrame)\n
\n\n \n

Want to quickly check what data type is output by a certain function?\nTry:

\n
\nimport streamlit as st\n\nx = my_poorly_documented_function()\nst.help(x)\n
\n

Want to quickly inspect an object? No sweat:

\n
\nclass Dog:\n  '''A typical dog.'''\n\n  def __init__(self, breed, color):\n    self.breed = breed\n    self.color = color\n\n  def bark(self):\n    return 'Woof!'\n\n\nfido = Dog('poodle', 'white')\n\nst.help(fido)\n
\n\n \n

And if you're using Magic, you can get help for functions, classes,\nand modules without even typing st.help:

\n
\nimport streamlit as st\nimport pandas\n\n# Get help for Pandas read_csv:\npandas.read_csv\n\n# Get help for Streamlit itself:\nst\n
\n\n \n
\n", + "description": "

Display help and other information for a given object.

\n

Depending on the type of object that is passed in, this displays the\nobject's name, type, value, signature, docstring, and member variables,\nmethods \u2014 as well as the values/docstring of members and methods.

\n", + "args": [ + { + "name": "obj", + "type_name": "any", + "is_optional": false, + "description": "

The object whose information should be displayed. If left\nunspecified, this call will display help for Streamlit itself.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/doc_string.py#L48" + }, + "streamlit.image": { + "name": "image", + "signature": "st.image(image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", + "example": "
\n
\nimport streamlit as st\nfrom PIL import Image\n\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n
\n", + "description": "

Display an image or list of images.

\n", + "args": [ + { + "name": "image", + "type_name": "numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]", + "is_optional": false, + "description": "

Monochrome image of shape (w,h) or (w,h,1)\nOR a color image of shape (w,h,3)\nOR an RGBA image of shape (w,h,4)\nOR a URL to fetch the image from\nOR a path of a local image file\nOR an SVG XML string like <svg xmlns=...</svg>\nOR a list of one of the above, to display multiple images.

\n", + "default": null + }, + { + "name": "caption", + "type_name": "str or list of str", + "is_optional": false, + "description": "

Image caption. If displaying multiple images, caption should be a\nlist of captions (one for each image).

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Image width. None means use the image width,\nbut do not exceed the width of the column.\nShould be set for SVG images, as they have no default image width.

\n", + "default": "image" + }, + { + "name": "use_column_width", + "type_name": "\"auto\", \"always\", \"never\", or bool", + "is_optional": false, + "description": "

If "auto", set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf "always" or True, set the image's width to the column width.\nIf "never" or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", + "default": null + }, + { + "name": "clamp", + "type_name": "bool", + "is_optional": false, + "description": "

Clamp image pixel values to a valid range ([0-255] per channel).\nThis is only meaningful for byte array images; the parameter is\nignored for image URLs. If this is not set, and an image has an\nout-of-range value, an error will be thrown.

\n", + "default": null + }, + { + "name": "channels", + "type_name": "\"RGB\" or \"BGR\"", + "is_optional": false, + "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to "RGB", meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to "BGR", instead.

\n", + "default": "s" + }, + { + "name": "output_format", + "type_name": "\"JPEG\", \"PNG\", or \"auto\"", + "is_optional": false, + "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to "auto" which identifies the compression type based\non the type and format of the image argument.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/image.py#L88" + }, + "streamlit.info": { + "name": "info", + "signature": "st.info(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", + "description": "

Display an informational message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The info text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/alert.py#L103" + }, + "streamlit.json": { + "name": "json", + "signature": "st.json(body, *, expanded=True)", + "example": "
\n
\nimport streamlit as st\n\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n
\n", + "description": "

Display object or string as a pretty-printed JSON string.

\n", + "args": [ + { + "name": "body", + "type_name": "object or str", + "is_optional": false, + "description": "

The object to print as JSON. All referenced objects should be\nserializable to JSON as well. If object is a string, we assume it\ncontains serialized JSON.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean that allows the user to set whether the initial\nstate of this json element should be expanded. Defaults to True.\nThis argument can only be supplied by keyword.

\n", + "default": "True." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/json.py#L35" + }, + "streamlit.latex": { + "name": "latex", + "signature": "st.latex(body, *, help=None)", + "example": "
\n
\nimport streamlit as st\n\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", + "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", + "args": [ + { + "name": "body", + "type_name": "str or SymPy expression", + "is_optional": false, + "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the LaTeX expression.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/markdown.py#L196" + }, + "streamlit.line_chart": { + "name": "line_chart", + "signature": "st.line_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\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 \n
\n", + "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict or None", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/dataframe_selector.py#L230" + }, + "streamlit.map": { + "name": "map", + "signature": "st.map(data=None, zoom=None, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n
\n", + "description": "

Display a map with points on it.

\n

This is a wrapper around st.pydeck_chart to quickly create\nscatterplot charts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to be plotted. Must have two columns:

\n
    \n
  • latitude called 'lat', 'latitude', 'LAT', 'LATITUDE'
  • \n
  • longitude called 'lon', 'longitude', 'LON', 'LONGITUDE'.
  • \n
\n", + "default": null + }, + { + "name": "zoom", + "type_name": "int", + "is_optional": false, + "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/map.py#L76" + }, + "streamlit.markdown": { + "name": "markdown", + "signature": "st.markdown(body, unsafe_allow_html=False, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.markdown('Streamlit is **_really_ cool**.')\nst.markdown("This text is :red[colored red], and this is **:blue[colored]** and bold.")\nst.markdown(":green[$\\sqrt{x^2+y^2}=1$] is a Pythagorean identity. :pencil:")\n
\n
\n", + "description": "

Display string formatted as Markdown.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the Markdown.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/markdown.py#L31" + }, + "streamlit.metric": { + "name": "metric", + "signature": "st.metric(label, value, delta=None, delta_color=\"normal\", help=None, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n

st.metric looks especially nice in combination with st.columns:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n

The delta indicator color can also be inverted or turned off:

\n
\nimport streamlit as st\n\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n
\n", + "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

The header or title for the metric. The label can optionally contain\nMarkdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Value of the metric. None is rendered as a long dash.

\n", + "default": null + }, + { + "name": "delta", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Indicator of how the metric changed, rendered with an arrow below\nthe metric. If delta is negative (int/float) or starts with a minus\nsign (str), the arrow points down and the text is red; else the\narrow points up and the text is green. If None (default), no delta\nindicator is shown.

\n", + "default": null + }, + { + "name": "delta_color", + "type_name": "\"normal\", \"inverse\", or \"off\"", + "is_optional": false, + "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the metric label.

\n", + "default": null + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/metric.py#L46" + }, + "streamlit.multiselect": { + "name": "multiselect", + "signature": "st.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", max_selections=None)", + "example": "
\n
\nimport streamlit as st\n\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n
\n", + "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence[V], numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "default", + "type_name": "[V], V, or None", + "is_optional": false, + "description": "

List of default values. Can also be a single value.

\n", + "default": "values." + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of selectbox options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe multiselect.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the multiselect.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this multiselect's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the multiselect widget if set\nto True. The default is False. This argument can only be supplied\nby keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "max_selections", + "type_name": "int", + "is_optional": false, + "description": "

The max selections that can be selected at a time.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list", + "is_generator": false, + "description": "

A list with the selected options

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/multiselect.py#L145" + }, + "streamlit.number_input": { + "name": "number_input", + "signature": "st.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n
\n", + "description": "

Display a numeric input widget.

\n
\n

Note

\n

Integer values exceeding +/- (1<<53) - 1 cannot be accurately\nstored or returned by the widget due to serialization contstraints\nbetween the Python server and JavaScript client. You must handle\nsuch numbers as floats, leading to a loss in precision.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. Output must be purely numeric. This does not impact\nthe return value. Valid formatters: %d %e %f %g %i %u

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this number_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the number input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int or float", + "is_generator": false, + "description": "

The current value of the numeric input widget. The return type\nwill match the data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/number_input.py#L66" + }, + "streamlit.plotly_chart": { + "name": "plotly_chart", + "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", theme=\"streamlit\", **kwargs)", + "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport numpy as np\nimport plotly.figure_factory as ff\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n        hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n
\n", + "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", + "args": [ + { + "name": "figure_or_data", + "type_name": "plotly.graph_objs.Figure, plotly.graph_objs.Data,", + "is_optional": false, + "description": "

dict/list of plotly.graph_objs.Figure/Data

\n

See https://plot.ly/python/ for examples of graph descriptions.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + }, + { + "name": "sharing", + "type_name": "\"streamlit\", \"private\", \"secret\", or \"public\"", + "is_optional": false, + "description": "

Use "streamlit" to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": null, + "is_optional": null, + "description": "

Any argument accepted by Plotly's plot() function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/plotly_chart.py#L81" + }, + "streamlit.progress": { + "name": "progress", + "signature": "st.progress(value, text=None)", + "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport streamlit as st\nimport time\n\nprogress_text = "Operation in progress. Please wait."\nmy_bar = st.progress(0, text=progress_text)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1, text=progress_text)\n
\n
\n", + "description": "

Display a progress bar.

\n", + "args": [ + { + "name": "value", + "type_name": "int or float", + "is_optional": false, + "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", + "default": null + }, + { + "name": "text", + "type_name": "str or None", + "is_optional": false, + "description": "

A message to display above the progress bar. The text can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/progress.py#L66" + }, + "streamlit.pydeck_chart": { + "name": "pydeck_chart", + "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)", + "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport pydeck as pdk\n\nchart_data = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=chart_data,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=chart_data,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", + "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "args": [ + { + "name": "pydeck_obj", + "type_name": "pydeck.Deck or None", + "is_optional": false, + "description": "

Object specifying the PyDeck chart to draw.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/deck_gl_json_chart.py#L36" + }, + "streamlit.pyplot": { + "name": "pyplot", + "signature": "st.pyplot(fig=None, clear_figure=None, use_container_width=True, **kwargs)", + "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", + "example": "
\n
\nimport streamlit as st\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n
\n", + "description": "

Display a matplotlib.pyplot figure.

\n", + "args": [ + { + "name": "fig", + "type_name": "Matplotlib Figure", + "is_optional": false, + "description": "

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

\n", + "default": null + }, + { + "name": "clear_figure", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", + "default": "based" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n", + "default": "s" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Arguments to pass to Matplotlib's savefig function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/pyplot.py#L38" + }, + "streamlit.radio": { + "name": "radio", + "signature": "st.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ngenre = st.radio(\n    "What\\'s your favorite movie genre",\n    ('Comedy', 'Drama', 'Documentary'))\n\nif genre == 'Comedy':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn\\'t select comedy.")\n
\n\n \n
\n", + "description": "

Display a radio button widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this radio group is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the radio options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of radio options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe radio.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the radio.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this radio's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the radio button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "horizontal", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", + "default": "false" + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/radio.py#L75" + }, + "streamlit.select_slider": { + "name": "select_slider", + "signature": "st.select_slider(label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\nimport streamlit as st\n\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nimport streamlit as st\n\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n ", + "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the slider options. All options will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", + "default": "." + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to first option.

\n", + "default": "first" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels from the options.\nargument. It receives the option as an argument and its output\nwill be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the select slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this select_slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the select slider if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any value or tuple of any value", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/select_slider.py#L106" + }, + "streamlit.selectbox": { + "name": "selectbox", + "signature": "st.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n
\n", + "description": "

Display a select widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels. It receives the option\nas an argument and its output will be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the selectbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this selectbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the selectbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/selectbox.py#L71" + }, + "streamlit.set_option": { + "name": "set_option", + "signature": "st.set_option(key, value)", + "description": "

Set config option.

\n
\n
Currently, only the following config options can be set within the script itself:
\n
    \n
  • client.caching
  • \n
  • client.displayEnabled
  • \n
  • deprecation.*
  • \n
\n
\n
\n

Calling with any other options will raise StreamlitAPIException.

\n

Run streamlit config show in the terminal to see all available options.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

The config option key of the form "section.optionName". To see all\navailable options, run streamlit config show on a terminal.

\n", + "default": null + }, + { + "name": "value", + "type_name": null, + "is_optional": null, + "description": "

The new value to assign to this config option.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/config.py#L92" + }, + "streamlit.set_page_config": { + "name": "set_page_config", + "signature": "st.set_page_config(page_title=None, page_icon=None, layout=\"centered\", initial_sidebar_state=\"auto\", menu_items=None)", + "example": "
\nimport streamlit as st\n\nst.set_page_config(\n    page_title="Ex-stream-ly Cool App",\n    page_icon="\ud83e\uddca",\n    layout="wide",\n    initial_sidebar_state="expanded",\n    menu_items={\n        'Get Help': 'https://www.extremelycoolapp.com/help',\n        'Report a bug': "https://www.extremelycoolapp.com/bug",\n        'About': "# This is a header. This is an *extremely* cool app!"\n    }\n)\n
\n", + "description": "

Configures the default settings of the page.

\n
\n

Note

\n

This must be the first Streamlit command used on an app page, and must only\nbe set once per page.

\n
\n", + "args": [ + { + "name": "page_title", + "type_name": "str or None", + "is_optional": false, + "description": "

The page title, shown in the browser tab. If None, defaults to the\nfilename of the script ("app.py" would show "app \u2022 Streamlit").

\n", + "default": "the" + }, + { + "name": "page_icon", + "type_name": "Anything supported by st.image or str or None", + "is_optional": false, + "description": "

The page favicon.\nBesides the types supported by st.image (like URLs or numpy arrays),\nyou can pass in an emoji as a string ("\ud83e\udd88") or a shortcode (":shark:").\nIf you're feeling lucky, try "random" for a random emoji!\nEmoji icons are courtesy of Twemoji and loaded from MaxCDN.

\n", + "default": null + }, + { + "name": "layout", + "type_name": "\"centered\" or \"wide\"", + "is_optional": false, + "description": "

How the page content should be laid out. Defaults to "centered",\nwhich constrains the elements into a centered column of fixed width;\n"wide" uses the entire screen.

\n", + "default": "s" + }, + { + "name": "initial_sidebar_state", + "type_name": "\"auto\", \"expanded\", or \"collapsed\"", + "is_optional": false, + "description": "

How the sidebar should start out. Defaults to "auto",\nwhich hides the sidebar on mobile-sized devices, and shows it otherwise.\n"expanded" shows the sidebar initially; "collapsed" hides it.

\n", + "default": "s" + }, + { + "name": "menu_items", + "type_name": "dict", + "is_optional": false, + "description": "

Configure the menu that appears on the top-right side of this app.\nThe keys in this dict denote the menu item you'd like to configure:

\n
    \n
  • \n
    "Get help": str or None
    \n
    The URL this menu item should point to.\nIf None, hides this menu item.
    \n
    \n
  • \n
  • \n
    "Report a Bug": str or None
    \n
    The URL this menu item should point to.\nIf None, hides this menu item.
    \n
    \n
  • \n
  • \n
    "About": str or None
    \n
    A markdown string to show in the About dialog.\nIf None, only shows Streamlit's default About text.
    \n
    \n
  • \n
\n

The URL may also refer to an email address e.g. mailto:john@example.com.

\n", + "default": "About" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/commands/page_config.py#L114" + }, + "streamlit.slider": { + "name": "slider", + "signature": "st.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nimport streamlit as st\n\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nimport streamlit as st\nfrom datetime import time\n\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nimport streamlit as st\nfrom datetime import datetime\n\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n
\n", + "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n
\n

Note

\n

Integer values exceeding +/- (1<<53) - 1 cannot be accurately\nstored or returned by the widget due to serialization contstraints\nbetween the Python server and JavaScript client. You must handle\nsuch numbers as floats, leading to a loss in precision.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The minimum permitted value.\nDefaults to 0 if the value is an int, 0.0 if a float,\nvalue - timedelta(days=14) if a date/datetime, time.min if a time

\n", + "default": "0" + }, + { + "name": "max_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The maximum permitted value.\nDefaults to 100 if the value is an int, 1.0 if a float,\nvalue + timedelta(days=14) if a date/datetime, time.max if a time

\n", + "default": "100" + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to min_value.

\n", + "default": "min_value." + }, + { + "name": "step", + "type_name": "int, float, timedelta, or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. This does not impact the return value.\nFormatter for int/float supports: %d %e %f %g %i\nFormatter for date/time/datetime uses Moment.js notation:\nhttps://momentjs.com/docs/#/displaying/format/

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the slider if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int/float/date/time/datetime or tuple of int/float/date/time/datetime", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/slider.py#L171" + }, + "streamlit.snow": { + "name": "snow", + "signature": "st.snow()", + "example": "
\n
\nimport streamlit as st\n\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", + "description": "

Draw celebratory snowfall.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/snow.py#L25" + }, + "streamlit.spinner": { + "name": "spinner", + "signature": "st.spinner(text=\"In progress...\")", + "example": "
\n
\nimport time\nimport streamlit as st\n\nwith st.spinner('Wait for it...'):\n    time.sleep(5)\nst.success('Done!')\n
\n
\n", + "description": "

Temporarily displays a message while executing a block of code.

\n", + "args": [ + { + "name": "text", + "type_name": "str", + "is_optional": false, + "description": "

A message to display while executing that block

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/spinner.py#L23" + }, + "streamlit.stop": { + "name": "stop", + "signature": "st.stop()", + "example": "
\n
\nimport streamlit as st\n\nname = st.text_input('Name')\nif not name:\n  st.warning('Please input a name.')\n  st.stop()\nst.success('Thank you for inputting a name.')\n
\n
\n", + "description": "

Stops execution immediately.

\n

Streamlit will not run any statements after st.stop().\nWe recommend rendering a message to explain why the script has stopped.\nWhen run outside of Streamlit, this will raise an Exception.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/commands/execution_control.py#L25" + }, + "streamlit.subheader": { + "name": "subheader", + "signature": "st.subheader(body, anchor=None, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.subheader('This is a subheader')\nst.subheader('A subheader with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in subheader formatting.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str or False", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the subheader.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/heading.py#L93" + }, + "streamlit.success": { + "name": "success", + "signature": "st.success(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", + "description": "

Display a success message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The success text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/alert.py#L136" + }, + "streamlit.table": { + "name": "table", + "signature": "st.table(data=None)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n
\n", + "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/dataframe_selector.py#L192" + }, + "streamlit.tabs": { + "name": "tabs", + "signature": "st.tabs(tabs)", + "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\nimport streamlit as st\n\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n
\n", + "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", + "args": [ + { + "name": "tabs", + "type_name": "list of strings", + "is_optional": false, + "description": "

Creates a tab for each string in the list. The first tab is selected by default.\nThe string is used as the name of the tab and can optionally contain Markdown,\nsupporting the following elements: Bold, Italics, Strikethroughs, Inline Code,\nEmojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": "." + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/layouts.py#L203" + }, + "streamlit.text": { + "name": "text", + "signature": "st.text(body, *, help=None)", + "example": "
\n
\nimport streamlit as st\n\nst.text('This is some text.')\n
\n
\n", + "description": "

Write fixed-width and preformatted text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the text.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/text.py#L27" + }, + "streamlit.text_area": { + "name": "text_area", + "signature": "st.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", + "description": "

Display a multi-line text input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Maximum number of characters allowed in text area.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the textarea.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_area's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text area is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text area if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/text_widgets.py#L274" + }, + "streamlit.text_input": { + "name": "text_input", + "signature": "st.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n
\n", + "description": "

Display a single-line text input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Max number of characters allowed in text input.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"default\" or \"password\"", + "is_optional": false, + "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "autocomplete", + "type_name": "str", + "is_optional": false, + "description": "

An optional value that will be passed to the <input> element's\nautocomplete property. If unspecified, this value will be set to\n"new-password" for "password" inputs, and the empty string for\n"default" inputs. For more details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text input is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/text_widgets.py#L71" + }, + "streamlit.time_input": { + "name": "time_input", + "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", step=0:15:00)", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n
\n", + "description": "

Display a time input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this time input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.time/datetime.datetime", + "is_optional": false, + "description": "

The value of this widget when it first renders. This will be\ncast to str internally. Defaults to the current time.

\n", + "default": "the" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this time_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the time input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "step", + "type_name": "int or timedelta", + "is_optional": false, + "description": "

The stepping interval in seconds. Defaults to 900, i.e. 15 minutes.\nYou can also pass a datetime.timedelta object.

\n", + "default": "900" + } + ], + "returns": [ + { + "type_name": "datetime.time", + "is_generator": false, + "description": "

The current value of the time input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/time_widgets.py#L213" + }, + "streamlit.title": { + "name": "title", + "signature": "st.title(body, anchor=None, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.title('This is a title')\nst.title('A title with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str or False", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the title.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/heading.py#L146" + }, + "streamlit.vega_lite_chart": { + "name": "vega_lite_chart", + "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, theme=\"streamlit\", **kwargs)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(chart_data, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", + "description": "

Display a chart using the Vega-Lite library.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "spec", + "type_name": "dict or None", + "is_optional": false, + "description": "

The Vega-Lite spec for the chart. If the spec was already passed in\nthe previous argument, this must be set to None. See\nhttps://vega.github.io/vega-lite/docs/ for more info.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Same as spec, but as keywords.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/dataframe_selector.py#L545" + }, + "streamlit.video": { + "name": "video", + "signature": "st.video(data, format=\"video/mp4\", start_time=0)", + "example": "
\n
\nimport streamlit as st\n\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", + "description": "

Display a video player.

\n", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "default": null + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the video file. Defaults to 'video/mp4'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/media.py#L116" + }, + "streamlit.warning": { + "name": "warning", + "signature": "st.warning(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", + "description": "

Display warning message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The warning text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/alert.py#L71" + }, + "streamlit.write": { + "name": "write", + "signature": "st.write(*args, unsafe_allow_html=False, **kwargs)", + "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nimport streamlit as st\n\nst.write('Hello, *World!* :sunglasses:')\n
\n\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nimport streamlit as st\nimport pandas as pd\n\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nimport streamlit as st\n\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n
\n", + "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression, emoji shortcodes, and colored text.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(class) : Displays information about a class.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/write.py#L49" + }, + "streamlit.experimental_memo.clear": { + "name": "experimental_memo.clear", + "signature": "st.experimental_memo.clear()", + "description": "

Clear all in-memory and on-disk data caches.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/runtime/caching/cache_data_api.py#L587" + }, + "streamlit.cache_data.clear": { + "name": "cache_data.clear", + "signature": "st.cache_data.clear()", + "description": "

Clear all in-memory and on-disk data caches.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/runtime/caching/cache_data_api.py#L587" + }, + "streamlit.experimental_singleton.clear": { + "name": "experimental_singleton.clear", + "signature": "st.experimental_singleton.clear()", + "description": "

Clear all cache_resource caches.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/runtime/caching/cache_resource_api.py#L449" + }, + "streamlit.cache_resource.clear": { + "name": "cache_resource.clear", + "signature": "st.cache_resource.clear()", + "description": "

Clear all cache_resource caches.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/runtime/caching/cache_resource_api.py#L449" + }, + "streamlit.connections.ExperimentalBaseConnection": { + "name": "ExperimentalBaseConnection", + "signature": "st.connections.ExperimentalBaseConnection(connection_name, **kwargs)", + "is_class": true, + "methods": [ + { + "name": "reset", + "signature": "st.connections.reset.reset()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", + "description": "

Reset this connection so that it gets reinitialized the next time it's used.

", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/connections/base_connection.py#L137" + } + ], + "properties": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/connections/base_connection.py#L25", + "description": "

The abstract base class that all Streamlit Connections must inherit from.

\n

This base class provides connection authors with a standardized way to hook into the\nst.experimental_connection() factory function: connection authors are required to\nprovide an implementation for the abstract method _connect in their subclasses.

\n

Additionally, it also provides a few methods/properties designed to make\nimplementation of connections more convenient. See the docstrings for each of the\nmethods of this class for more information

\n
\n

Note

\n

While providing an implementation of _connect is technically all that's\nrequired to define a valid connection, connections should also provide the user\nwith context-specific ways of interacting with the underlying connection object.\nFor example, the first-party SQLConnection provides a query() method for\nreads and a session property for more complex operations.

\n
\n", + "args": [], + "returns": [] + }, + "streamlit.connections.SQLConnection": { + "name": "SQLConnection", + "signature": "st.connections.SQLConnection(connection_name, **kwargs)", + "is_class": true, + "methods": [ + { + "name": "query", + "signature": "st.connections.query.query(sql, *, ttl=None, index_col=None, chunksize=None, params=None, **kwargs)", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("sql")\ndf = conn.query("select * from pet_owners where owner = :owner", ttl=3600, params={"owner":"barbara"})\nst.dataframe(df)\n
\n
\n", + "description": "

Run a read-only query.

", + "args": [ + { + "name": "sql", + "type_name": "str", + "is_optional": false, + "description": "

The read-only SQL query to execute.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float, int, timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep results in the cache, or\nNone if cached results should not expire. The default is None.

\n", + "default": "None." + }, + { + "name": "index_col", + "type_name": "str, list of str, or None", + "is_optional": false, + "description": "

Column(s) to set as index(MultiIndex). Default is None.

\n", + "default": "None." + }, + { + "name": "chunksize", + "type_name": "int or None", + "is_optional": false, + "description": "

If specified, return an iterator where chunksize is the number of\nrows to include in each chunk. Default is None.

\n", + "default": "None." + }, + { + "name": "params", + "type_name": "list, tuple, dict or None", + "is_optional": false, + "description": "

List of parameters to pass to the execute method. The syntax used to pass\nparameters is database driver dependent. Check your database driver\ndocumentation for which of the five syntax styles, described in PEP 249\nparamstyle, is supported.\nDefault is None.

\n", + "default": "None." + }, + { + "name": "**kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

Additional keyword arguments are passed to pd.read_sql.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "pd.DataFrame", + "is_generator": false, + "description": "

The result of running the query, formatted as a pandas DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/connections/sql_connection.py#L121" + }, + { + "name": "reset", + "signature": "st.connections.reset.reset()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", + "description": "

Reset this connection so that it gets reinitialized the next time it's used.

", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/connections/base_connection.py#L137" + } + ], + "properties": [ + { + "name": "session", + "signature": "st.connections.session.session", + "example": "
\n
\nimport streamlit as st\nconn = st.experimental_connection("sql")\nn = st.slider("Pick a number")\nif st.button("Add the number!"):\n    with conn.session as session:\n        session.execute("INSERT INTO numbers (val) VALUES (:n);", {"n": n})\n        session.commit()\n
\n
\n", + "description": "

Return a SQLAlchemy Session.

", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/connections/sql_connection.py#L226" + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/connections/sql_connection.py#L45", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("sql")\ndf = conn.query("select * from pet_owners")\nst.dataframe(df)\n
\n
\n", + "description": "

A connection to a SQL database using a SQLAlchemy Engine. Initialize using st.experimental_connection("<name>", type="sql").

\n

SQLConnection provides the query() convenience method, which can be used to\nrun simple read-only queries with both caching and simple error handling/retries.\nMore complex DB interactions can be performed by using the .session property\nto receive a regular SQLAlchemy Session.

\n

SQLConnections should always be created using st.experimental_connection(),\nnot initialized directly. Connection parameters for a SQLConnection can be\nspecified using either st.secrets or **kwargs. Some frequently used\nparameters include:

\n
    \n
  • url or arguments for sqlalchemy.engine.URL.create().\nMost commonly it includes a dialect, host, database, username and password.
  • \n
  • create_engine_kwargs can be passed via st.secrets, such as for\nsnowflake-sqlalchemy\nor Google BigQuery.\nThese can also be passed directly as **kwargs to experimental_connection().
  • \n
  • autocommit=True to run with isolation level AUTOCOMMIT. Default is False.
  • \n
\n", + "args": [], + "returns": [] + }, + "streamlit.connections.SnowparkConnection": { + "name": "SnowparkConnection", + "signature": "st.connections.SnowparkConnection(connection_name, **kwargs)", + "is_class": true, + "methods": [ + { + "name": "query", + "signature": "st.connections.query.query(sql, ttl=None)", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("snowpark")\ndf = conn.query("select * from pet_owners")\nst.dataframe(df)\n
\n
\n", + "description": "

Run a read-only SQL query.

", + "args": [ + { + "name": "sql", + "type_name": "str", + "is_optional": false, + "description": "

The read-only SQL query to execute.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float, int, timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep results in the cache, or\nNone if cached results should not expire. The default is None.

\n", + "default": "None." + } + ], + "returns": [ + { + "type_name": "pd.DataFrame", + "is_generator": false, + "description": "

The result of running the query, formatted as a pandas DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/connections/snowpark_connection.py#L123" + }, + { + "name": "reset", + "signature": "st.connections.reset.reset()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", + "description": "

Reset this connection so that it gets reinitialized the next time it's used.

", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/connections/base_connection.py#L137" + }, + { + "name": "safe_session", + "signature": "st.connections.safe_session.safe_session()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("snowpark")\nwith conn.safe_session() as session:\n    df = session.table("mytable").limit(10).to_pandas()\n\nst.dataframe(df)\n
\n
\n", + "description": "

Grab the underlying Snowpark session in a thread-safe manner.

", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/connections/snowpark_connection.py#L207" + } + ], + "properties": [ + { + "name": "session", + "signature": "st.connections.session.session", + "example": "
\n
\nimport streamlit as st\n\nsession = st.experimental_connection("snowpark").session\ndf = session.table("mytable").limit(10).to_pandas()\nst.dataframe(df)\n
\n
\n", + "description": "

Access the underlying Snowpark session.

", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/connections/snowpark_connection.py#L184" + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/connections/snowpark_connection.py#L70", + "description": "

A connection to Snowpark using snowflake.snowpark.session.Session. Initialize using

\n

st.experimental_connection("<name>", type="snowpark").

\n

In addition to accessing the Snowpark Session, SnowparkConnection supports direct SQL querying using\nquery("...") and thread safe access using with conn.safe_session():. See methods\nbelow for more information. SnowparkConnections should always be created using\nst.experimental_connection(), not initialized directly.

\n
\n

Note

\n

We don't expect this iteration of SnowparkConnection to be able to scale\nwell in apps with many concurrent users due to the lock contention that will occur\nover the single underlying Session object under high load.

\n
\n", + "args": [], + "returns": [] + }, + "streamlit.connections.SQLConnection.query": { + "name": "query", + "signature": "SQLConnection.query(sql, *, ttl=None, index_col=None, chunksize=None, params=None, **kwargs)", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("sql")\ndf = conn.query("select * from pet_owners where owner = :owner", ttl=3600, params={"owner":"barbara"})\nst.dataframe(df)\n
\n
\n", + "description": "

Run a read-only query.

\n

This method implements both query result caching (with caching behavior\nidentical to that of using @st.cache_data) as well as simple error handling/retries.

\n
\n

Note

\n

Queries that are run without a specified ttl are cached indefinitely.

\n
\n

Aside from the ttl kwarg, all kwargs passed to this function are passed down\nto pd.read_sql\nand have the behavior described in the pandas documentation.

\n", + "args": [ + { + "name": "sql", + "type_name": "str", + "is_optional": false, + "description": "

The read-only SQL query to execute.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float, int, timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep results in the cache, or\nNone if cached results should not expire. The default is None.

\n", + "default": "None." + }, + { + "name": "index_col", + "type_name": "str, list of str, or None", + "is_optional": false, + "description": "

Column(s) to set as index(MultiIndex). Default is None.

\n", + "default": "None." + }, + { + "name": "chunksize", + "type_name": "int or None", + "is_optional": false, + "description": "

If specified, return an iterator where chunksize is the number of\nrows to include in each chunk. Default is None.

\n", + "default": "None." + }, + { + "name": "params", + "type_name": "list, tuple, dict or None", + "is_optional": false, + "description": "

List of parameters to pass to the execute method. The syntax used to pass\nparameters is database driver dependent. Check your database driver\ndocumentation for which of the five syntax styles, described in PEP 249\nparamstyle, is supported.\nDefault is None.

\n", + "default": "None." + }, + { + "name": "**kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

Additional keyword arguments are passed to pd.read_sql.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "pd.DataFrame", + "is_generator": false, + "description": "

The result of running the query, formatted as a pandas DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/connections/sql_connection.py#L121" + }, + "streamlit.connections.SQLConnection.reset": { + "name": "reset", + "signature": "SQLConnection.reset()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", + "description": "

Reset this connection so that it gets reinitialized the next time it's used.

\n

This method can be useful when a connection has become stale, an auth token has\nexpired, or in similar scenarios where a broken connection might be fixed by\nreinitializing it. Note that some connection methods may already use reset()\nin their error handling code.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/connections/base_connection.py#L137" + }, + "streamlit.connections.SQLConnection.session": { + "name": "session", + "signature": "SQLConnection.session", + "example": "
\n
\nimport streamlit as st\nconn = st.experimental_connection("sql")\nn = st.slider("Pick a number")\nif st.button("Add the number!"):\n    with conn.session as session:\n        session.execute("INSERT INTO numbers (val) VALUES (:n);", {"n": n})\n        session.commit()\n
\n
\n", + "description": "

Return a SQLAlchemy Session.

\n

Users of this connection should use the contextmanager pattern for writes,\ntransactions, and anything more complex than simple read queries.

\n

See the usage example below, which assumes we have a table numbers with a\nsingle integer column val. The SQLAlchemy docs also contain\nmuch more information on the usage of sessions.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/connections/sql_connection.py#L226" + }, + "streamlit.connections.SnowparkConnection.query": { + "name": "query", + "signature": "SnowparkConnection.query(sql, ttl=None)", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("snowpark")\ndf = conn.query("select * from pet_owners")\nst.dataframe(df)\n
\n
\n", + "description": "

Run a read-only SQL query.

\n

This method implements both query result caching (with caching behavior\nidentical to that of using @st.cache_data) as well as simple error handling/retries.

\n
\n

Note

\n

Queries that are run without a specified ttl are cached indefinitely.

\n
\n", + "args": [ + { + "name": "sql", + "type_name": "str", + "is_optional": false, + "description": "

The read-only SQL query to execute.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float, int, timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep results in the cache, or\nNone if cached results should not expire. The default is None.

\n", + "default": "None." + } + ], + "returns": [ + { + "type_name": "pd.DataFrame", + "is_generator": false, + "description": "

The result of running the query, formatted as a pandas DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/connections/snowpark_connection.py#L123" + }, + "streamlit.connections.SnowparkConnection.reset": { + "name": "reset", + "signature": "SnowparkConnection.reset()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", + "description": "

Reset this connection so that it gets reinitialized the next time it's used.

\n

This method can be useful when a connection has become stale, an auth token has\nexpired, or in similar scenarios where a broken connection might be fixed by\nreinitializing it. Note that some connection methods may already use reset()\nin their error handling code.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/connections/base_connection.py#L137" + }, + "streamlit.connections.SnowparkConnection.safe_session": { + "name": "safe_session", + "signature": "SnowparkConnection.safe_session()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("snowpark")\nwith conn.safe_session() as session:\n    df = session.table("mytable").limit(10).to_pandas()\n\nst.dataframe(df)\n
\n
\n", + "description": "

Grab the underlying Snowpark session in a thread-safe manner.

\n

As operations on a Snowpark session are not thread safe, we need to take care\nwhen using a session in the context of a Streamlit app where each script run\noccurs in its own thread. Using the contextmanager pattern to do this ensures\nthat access on this connection's underlying Session is done in a thread-safe\nmanner.

\n

Information on how to use Snowpark sessions can be found in the Snowpark documentation.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/connections/snowpark_connection.py#L207" + }, + "streamlit.connections.SnowparkConnection.session": { + "name": "session", + "signature": "SnowparkConnection.session", + "example": "
\n
\nimport streamlit as st\n\nsession = st.experimental_connection("snowpark").session\ndf = session.table("mytable").limit(10).to_pandas()\nst.dataframe(df)\n
\n
\n", + "description": "

Access the underlying Snowpark session.

\n
\n

Note

\n

Snowpark sessions are not thread safe. Users of this method are\nresponsible for ensuring that access to the session returned by this method is\ndone in a thread-safe manner. For most users, we recommend using the thread-safe\nsafe_session() method and a with block.

\n
\n

Information on how to use Snowpark sessions can be found in the Snowpark documentation.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/connections/snowpark_connection.py#L184" + }, + "streamlit.connections.ExperimentalBaseConnection.reset": { + "name": "reset", + "signature": "ExperimentalBaseConnection.reset()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", + "description": "

Reset this connection so that it gets reinitialized the next time it's used.

\n

This method can be useful when a connection has become stale, an auth token has\nexpired, or in similar scenarios where a broken connection might be fixed by\nreinitializing it. Note that some connection methods may already use reset()\nin their error handling code.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/connections/base_connection.py#L137" + }, + "streamlit.column_config.BarChartColumn": { + "name": "BarChartColumn", + "signature": "st.column_config.BarChartColumn(label=None, *, width=None, help=None, y_min=None, y_max=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "sales": [\n            [0, 4, 26, 80, 100, 40],\n            [80, 20, 80, 35, 40, 100],\n            [10, 20, 80, 80, 70, 0],\n            [10, 100, 20, 100, 30, 100],\n        ],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "sales": st.column_config.BarChartColumn(\n            "Sales (last 6 months)",\n            help="The sales volume in the last 6 months",\n            y_min=0,\n            y_max=100,\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a bar chart column in st.dataframe or st.data_editor.

\n

Cells need to contain a list of numbers. Chart columns are not editable\nat the moment. This command needs to be used in the column_config parameter\nof st.dataframe or st.data_editor.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "default": null + }, + { + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", + "is_optional": false, + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null + }, + { + "name": "y_min", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The minimum value on the y-axis for all cells in the column.\nIf None (default), every cell will use the minimum of its data.

\n", + "default": null + }, + { + "name": "y_max", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The maximum value on the y-axis for all cells in the column. If None (default),\nevery cell will use the maximum of its data.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/lib/column_types.py#L745" + }, + "streamlit.column_config.CheckboxColumn": { + "name": "CheckboxColumn", + "signature": "st.column_config.CheckboxColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "widgets": ["st.selectbox", "st.number_input", "st.text_area", "st.button"],\n        "favorite": [True, False, False, True],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "favorite": st.column_config.CheckboxColumn(\n            "Your favorite?",\n            help="Select your **favorite** widgets",\n            default=False,\n        )\n    },\n    disabled=["widgets"],\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a checkbox column in st.dataframe or st.data_editor.

\n

This is the default column type for boolean values. This command needs to be used in\nthe column_config parameter of st.dataframe or st.data_editor.\nWhen used with st.data_editor, editing will be enabled with a checkbox widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "default": null + }, + { + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", + "is_optional": false, + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", + "default": "False." + }, + { + "name": "required", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", + "default": "False." + }, + { + "name": "default", + "type_name": "bool or None", + "is_optional": false, + "description": "

Specifies the default value in this column when a new row is added by the user.

\n", + "default": "value" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/lib/column_types.py#L565" + }, + "streamlit.column_config.Column": { + "name": "Column", + "signature": "st.column_config.Column(label=None, *, width=None, help=None, disabled=None, required=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "widgets": ["st.selectbox", "st.number_input", "st.text_area", "st.button"],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "widgets": st.column_config.Column(\n            "Streamlit Widgets",\n            help="Streamlit **widget** commands \ud83c\udf88",\n            width="medium",\n            required=True,\n        )\n    },\n    hide_index=True,\n    num_rows="dynamic",\n)\n
\n\n \n
\n", + "description": "

Configure a generic column in st.dataframe or st.data_editor.

\n

The type of the column will be automatically inferred from the data type.\nThis command needs to be used in the column_config parameter of st.dataframe\nor st.data_editor.

\n

To change the type of the column and enable type-specific configuration options,\nuse one of the column types in the st.column_config namespace,\ne.g. st.column_config.NumberColumn.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "default": null + }, + { + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", + "is_optional": false, + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", + "default": "False." + }, + { + "name": "required", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/lib/column_types.py#L187" + }, + "streamlit.column_config.DateColumn": { + "name": "DateColumn", + "signature": "st.column_config.DateColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, format=None, min_value=None, max_value=None, step=None)", + "examples": "
\n
\nfrom datetime import date\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "birthday": [\n            date(1980, 1, 1),\n            date(1990, 5, 3),\n            date(1974, 5, 19),\n            date(2001, 8, 17),\n        ]\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "birthday": st.column_config.DateColumn(\n            "Birthday",\n            min_value=date(1900, 1, 1),\n            max_value=date(2005, 1, 1),\n            format="DD.MM.YYYY",\n            step=1,\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a date column in st.dataframe or st.data_editor.

\n

This is the default column type for date values. This command needs to be used in\nthe column_config parameter of st.dataframe or st.data_editor. When used\nwith st.data_editor, editing will be enabled with a date picker widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "default": null + }, + { + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", + "is_optional": false, + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", + "default": "False." + }, + { + "name": "required", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", + "default": "False." + }, + { + "name": "default", + "type_name": "datetime.date or None", + "is_optional": false, + "description": "

Specifies the default value in this column when a new row is added by the user.

\n", + "default": "value" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A momentJS format string controlling how times are displayed. See\nmomentJS docs for available\nformats. If None (default), uses YYYY-MM-DD.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "datetime.date or None", + "is_optional": false, + "description": "

The minimum date that can be entered.\nIf None (default), there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "datetime.date or None", + "is_optional": false, + "description": "

The maximum date that can be entered.\nIf None (default), there will be no maximum.

\n", + "default": null + }, + { + "name": "step", + "type_name": "int or None", + "is_optional": false, + "description": "

The stepping interval in days. If None (default), the step will be 1 day.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/lib/column_types.py#L1277" + }, + "streamlit.column_config.DatetimeColumn": { + "name": "DatetimeColumn", + "signature": "st.column_config.DatetimeColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, format=None, min_value=None, max_value=None, step=None, timezone=None)", + "examples": "
\n
\nfrom datetime import datetime\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "appointment": [\n            datetime(2024, 2, 5, 12, 30),\n            datetime(2023, 11, 10, 18, 0),\n            datetime(2024, 3, 11, 20, 10),\n            datetime(2023, 9, 12, 3, 0),\n        ]\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "appointment": st.column_config.DatetimeColumn(\n            "Appointment",\n            min_value=datetime(2023, 6, 1),\n            max_value=datetime(2025, 1, 1),\n            format="D MMM YYYY, h:mm a",\n            step=60,\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a datetime column in st.dataframe or st.data_editor.

\n

This is the default column type for datetime values. This command needs to be\nused in the column_config parameter of st.dataframe or\nst.data_editor. When used with st.data_editor, editing will be enabled\nwith a datetime picker widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "default": null + }, + { + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", + "is_optional": false, + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", + "default": "False." + }, + { + "name": "required", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", + "default": "False." + }, + { + "name": "default", + "type_name": "datetime.datetime or None", + "is_optional": false, + "description": "

Specifies the default value in this column when a new row is added by the user.

\n", + "default": "value" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A momentJS format string controlling how datetimes are displayed. See\nmomentJS docs for available\nformats. If None (default), uses YYYY-MM-DD HH:mm:ss.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "datetime.datetime or None", + "is_optional": false, + "description": "

The minimum datetime that can be entered.\nIf None (default), there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "datetime.datetime or None", + "is_optional": false, + "description": "

The maximum datetime that can be entered.\nIf None (default), there will be no maximum.

\n", + "default": null + }, + { + "name": "step", + "type_name": "int, float, datetime.timedelta, or None", + "is_optional": false, + "description": "

The stepping interval in seconds. If None (default), the step will be 1 second.

\n", + "default": null + }, + { + "name": "timezone", + "type_name": "str or None", + "is_optional": false, + "description": "

The timezone of this column. If None (default),\nthe timezone is inferred from the underlying data.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/lib/column_types.py#L1042" + }, + "streamlit.column_config.ImageColumn": { + "name": "ImageColumn", + "signature": "st.column_config.ImageColumn(label=None, *, width=None, help=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "apps": [\n            "https://storage.googleapis.com/s4a-prod-share-preview/default/st_app_screenshot_image/5435b8cb-6c6c-490b-9608-799b543655d3/Home_Page.png",\n            "https://storage.googleapis.com/s4a-prod-share-preview/default/st_app_screenshot_image/ef9a7627-13f2-47e5-8f65-3f69bb38a5c2/Home_Page.png",\n            "https://storage.googleapis.com/s4a-prod-share-preview/default/st_app_screenshot_image/31b99099-8eae-4ff8-aa89-042895ed3843/Home_Page.png",\n            "https://storage.googleapis.com/s4a-prod-share-preview/default/st_app_screenshot_image/6a399b09-241e-4ae7-a31f-7640dc1d181e/Home_Page.png",\n        ],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "apps": st.column_config.ImageColumn(\n            "Preview Image", help="Streamlit app preview screenshots"\n        )\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure an image column in st.dataframe or st.data_editor.

\n

The cell values need to be one of:

\n
    \n
  • A URL to fetch the image from. This can also be a relative URL of an image\ndeployed via static file serving.\nNote that you can NOT use an arbitrary local image if it is not available through\na public URL.
  • \n
  • A data URL containing an SVG XML like data:image/svg+xml;utf8,<svg xmlns=...</svg>.
  • \n
  • A data URL containing a Base64 encoded image like data:image/png;base64,iVBO....
  • \n
\n

Image columns are not editable at the moment. This command needs to be used in the\ncolumn_config parameter of st.dataframe or st.data_editor.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "default": null + }, + { + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", + "is_optional": false, + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/lib/column_types.py#L906" + }, + "streamlit.column_config.LineChartColumn": { + "name": "LineChartColumn", + "signature": "st.column_config.LineChartColumn(label=None, *, width=None, help=None, y_min=None, y_max=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "sales": [\n            [0, 4, 26, 80, 100, 40],\n            [80, 20, 80, 35, 40, 100],\n            [10, 20, 80, 80, 70, 0],\n            [10, 100, 20, 100, 30, 100],\n        ],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "sales": st.column_config.LineChartColumn(\n            "Sales (last 6 months)",\n            width="medium",\n            help="The sales volume in the last 6 months",\n            y_min=0,\n            y_max=100,\n         ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a line chart column in st.dataframe or st.data_editor.

\n

Cells need to contain a list of numbers. Chart columns are not editable\nat the moment. This command needs to be used in the column_config parameter\nof st.dataframe or st.data_editor.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "default": null + }, + { + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", + "is_optional": false, + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null + }, + { + "name": "y_min", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The minimum value on the y-axis for all cells in the column.\nIf None (default), every cell will use the minimum of its data.

\n", + "default": null + }, + { + "name": "y_max", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The maximum value on the y-axis for all cells in the column. If None (default),\nevery cell will use the maximum of its data.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/lib/column_types.py#L825" + }, + "streamlit.column_config.LinkColumn": { + "name": "LinkColumn", + "signature": "st.column_config.LinkColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, max_chars=None, validate=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "apps": [\n            "https://roadmap.streamlit.app",\n            "https://extras.streamlit.app",\n            "https://issues.streamlit.app",\n            "https://30days.streamlit.app",\n        ],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "apps": st.column_config.LinkColumn(\n            "Trending apps",\n            help="The top trending Streamlit apps",\n            validate="^https://[a-z]+\\.streamlit\\.app$",\n            max_chars=100,\n        )\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a link column in st.dataframe or st.data_editor.

\n

The cell values need to be string and will be shown as clickable links.\nThis command needs to be used in the column_config parameter of st.dataframe\nor st.data_editor. When used with st.data_editor, editing will be enabled\nwith a text input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "default": null + }, + { + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", + "is_optional": false, + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", + "default": "False." + }, + { + "name": "required", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", + "default": "False." + }, + { + "name": "default", + "type_name": "str or None", + "is_optional": false, + "description": "

Specifies the default value in this column when a new row is added by the user.

\n", + "default": "value" + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of characters that can be entered. If None (default),\nthere will be no maximum.

\n", + "default": null + }, + { + "name": "validate", + "type_name": "str or None", + "is_optional": false, + "description": "

A regular expression (JS flavor, e.g. "^https://.+$") that edited values are validated against.\nIf the input is invalid, it will not be submitted.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/lib/column_types.py#L466" + }, + "streamlit.column_config.ListColumn": { + "name": "ListColumn", + "signature": "st.column_config.ListColumn(label=None, *, width=None, help=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "sales": [\n            [0, 4, 26, 80, 100, 40],\n            [80, 20, 80, 35, 40, 100],\n            [10, 20, 80, 80, 70, 0],\n            [10, 100, 20, 100, 30, 100],\n        ],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "sales": st.column_config.ListColumn(\n            "Sales (last 6 months)",\n            help="The sales volume in the last 6 months",\n            width="medium",\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a list column in st.dataframe or st.data_editor.

\n

This is the default column type for list-like values. List columns are not editable\nat the moment. This command needs to be used in the column_config parameter of\nst.dataframe or st.data_editor.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "default": null + }, + { + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", + "is_optional": false, + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/lib/column_types.py#L977" + }, + "streamlit.column_config.NumberColumn": { + "name": "NumberColumn", + "signature": "st.column_config.NumberColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, format=None, min_value=None, max_value=None, step=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "price": [20, 950, 250, 500],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "price": st.column_config.NumberColumn(\n            "Price (in USD)",\n            help="The price of the product in USD",\n            min_value=0,\n            max_value=1000,\n            step=1,\n            format="$%d",\n        )\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a number column in st.dataframe or st.data_editor.

\n

This is the default column type for integer and float values. This command needs to\nbe used in the column_config parameter of st.dataframe or st.data_editor.\nWhen used with st.data_editor, editing will be enabled with a numeric input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "default": null + }, + { + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", + "is_optional": false, + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", + "default": "False." + }, + { + "name": "required", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", + "default": "False." + }, + { + "name": "default", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

Specifies the default value in this column when a new row is added by the user.

\n", + "default": "value" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how numbers are displayed.\nThis does not impact the return value. Valid formatters: %d %e %f %g %i %u.\nYou can also add prefixes and suffixes, e.g. "$ %.2f" to show a dollar prefix.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The minimum value that can be entered.\nIf None (default), there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The maximum value that can be entered.\nIf None (default), there will be no maximum.

\n", + "default": null + }, + { + "name": "step", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The stepping interval. Specifies the precision of numbers that can be entered.\nIf None (default), uses 1 for integers and unrestricted precision for floats.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/lib/column_types.py#L262" + }, + "streamlit.column_config.ProgressColumn": { + "name": "ProgressColumn", + "signature": "st.column_config.ProgressColumn(label=None, *, width=None, help=None, format=None, min_value=None, max_value=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "sales": [200, 550, 1000, 80],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "sales": st.column_config.ProgressColumn(\n            "Sales volume",\n            help="The sales volume in USD",\n            format="$%f",\n            min_value=0,\n            max_value=1000,\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a progress column in st.dataframe or st.data_editor.

\n

Cells need to contain a number. Progress columns are not editable at the moment.\nThis command needs to be used in the column_config parameter of st.dataframe\nor st.data_editor.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "default": null + }, + { + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", + "is_optional": false, + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how numbers are displayed.\nValid formatters: %d %e %f %g %i %u. You can also add prefixes and suffixes,\ne.g. "$ %.2f" to show a dollar prefix.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The minimum value of the progress bar.\nIf None (default), will be 0.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The minimum value of the progress bar. If None (default), will be 100 for\ninteger values and 1 for float values.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/lib/column_types.py#L1390" + }, + "streamlit.column_config.SelectboxColumn": { + "name": "SelectboxColumn", + "signature": "st.column_config.SelectboxColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, options=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "category": [\n            "\ud83d\udcca Data Exploration",\n            "\ud83d\udcc8 Data Visualization",\n            "\ud83e\udd16 LLM",\n            "\ud83d\udcca Data Exploration",\n        ],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "category": st.column_config.SelectboxColumn(\n            "App Category",\n            help="The category of the app",\n            width="medium",\n            options=[\n                "\ud83d\udcca Data Exploration",\n                "\ud83d\udcc8 Data Visualization",\n                "\ud83e\udd16 LLM",\n            ],\n        )\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a selectbox column in st.dataframe or st.data_editor.

\n

This is the default column type for Pandas categorical values. This command needs to\nbe used in the column_config parameter of st.dataframe or st.data_editor.\nWhen used with st.data_editor, editing will be enabled with a selectbox widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "default": null + }, + { + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", + "is_optional": false, + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", + "default": "False." + }, + { + "name": "required", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", + "default": "False." + }, + { + "name": "default", + "type_name": "str, int, float, bool, or None", + "is_optional": false, + "description": "

Specifies the default value in this column when a new row is added by the user.

\n", + "default": "value" + }, + { + "name": "options", + "type_name": "iterable of str or None", + "is_optional": false, + "description": "

The options that can be selected during editing. If None (default), this will be\ninferred from the underlying dataframe column if its dtype is \u201ccategory\u201d\n(see Pandas docs on categorical data).

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/lib/column_types.py#L647" + }, + "streamlit.column_config.TextColumn": { + "name": "TextColumn", + "signature": "st.column_config.TextColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, max_chars=None, validate=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "widgets": ["st.selectbox", "st.number_input", "st.text_area", "st.button"],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "widgets": st.column_config.TextColumn(\n            "Widgets",\n            help="Streamlit **widget** commands \ud83c\udf88",\n            default="st.",\n            max_chars=50,\n            validate="^st\\.[a-z_]+$",\n        )\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a text column in st.dataframe or st.data_editor.

\n

This is the default column type for string values. This command needs to be used in the\ncolumn_config parameter of st.dataframe or st.data_editor. When used with\nst.data_editor, editing will be enabled with a text input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "default": null + }, + { + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", + "is_optional": false, + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", + "default": "False." + }, + { + "name": "required", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", + "default": "False." + }, + { + "name": "default", + "type_name": "str or None", + "is_optional": false, + "description": "

Specifies the default value in this column when a new row is added by the user.

\n", + "default": "value" + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of characters that can be entered. If None (default),\nthere will be no maximum.

\n", + "default": null + }, + { + "name": "validate", + "type_name": "str or None", + "is_optional": false, + "description": "

A regular expression (JS flavor, e.g. "^[a-z]+$") that edited values are validated against.\nIf the input is invalid, it will not be submitted.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/lib/column_types.py#L372" + }, + "streamlit.column_config.TimeColumn": { + "name": "TimeColumn", + "signature": "st.column_config.TimeColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, format=None, min_value=None, max_value=None, step=None)", + "examples": "
\n
\nfrom datetime import time\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "appointment": [\n            time(12, 30),\n            time(18, 0),\n            time(9, 10),\n            time(16, 25),\n        ]\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "appointment": st.column_config.TimeColumn(\n            "Appointment",\n            min_value=time(8, 0, 0),\n            max_value=time(19, 0, 0),\n            format="hh:mm a",\n            step=60,\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a time column in st.dataframe or st.data_editor.

\n

This is the default column type for time values. This command needs to be used in\nthe column_config parameter of st.dataframe or st.data_editor. When\nused with st.data_editor, editing will be enabled with a time picker widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "default": null + }, + { + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", + "is_optional": false, + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", + "default": "False." + }, + { + "name": "required", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", + "default": "False." + }, + { + "name": "default", + "type_name": "datetime.time or None", + "is_optional": false, + "description": "

Specifies the default value in this column when a new row is added by the user.

\n", + "default": "value" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A momentJS format string controlling how times are displayed. See\nmomentJS docs for available\nformats. If None (default), uses HH:mm:ss.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "datetime.time or None", + "is_optional": false, + "description": "

The minimum time that can be entered.\nIf None (default), there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "datetime.time or None", + "is_optional": false, + "description": "

The maximum time that can be entered.\nIf None (default), there will be no maximum.

\n", + "default": null + }, + { + "name": "step", + "type_name": "int, float, datetime.timedelta, or None", + "is_optional": false, + "description": "

The stepping interval in seconds. If None (default), the step will be 1 second.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/lib/column_types.py#L1163" + }, + "streamlit.components.v1.declare_component": { + "name": "declare_component", + "signature": "st.components.v1.declare_component(name, path=None, url=None)", + "description": "

Create and register a custom component.

\n", + "args": [ + { + "name": "name", + "type_name": "str", + "is_optional": false, + "description": "

A short, descriptive name for the component. Like, "slider".

\n", + "default": null + }, + { + "name": "path", + "type_name": "str or None", + "is_optional": false, + "description": "

The path to serve the component's frontend files from. Either\npath or url must be specified, but not both.

\n", + "default": null + }, + { + "name": "url", + "type_name": "str or None", + "is_optional": false, + "description": "

The URL that the component is served from. Either path or url\nmust be specified, but not both.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "CustomComponent", + "is_generator": false, + "description": "

A CustomComponent that can be called like a function.\nCalling the component will create a new instance of the component\nin the Streamlit app.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/components/v1/components.py#L246" + }, + "streamlit.components.v1.html": { + "name": "html", + "signature": "st.components.v1.html(html, width=None, height=None, scrolling=False)", + "description": "

Display an HTML string in an iframe.

\n", + "args": [ + { + "name": "html", + "type_name": "str", + "is_optional": false, + "description": "

The HTML string to embed in the iframe.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", + "default": "the" + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", + "default": "150." + }, + { + "name": "scrolling", + "type_name": "bool", + "is_optional": false, + "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/iframe.py#L59" + }, + "streamlit.components.v1.iframe": { + "name": "iframe", + "signature": "st.components.v1.iframe(src, width=None, height=None, scrolling=False)", + "description": "

Load a remote URL in an iframe.

\n", + "args": [ + { + "name": "src", + "type_name": "str", + "is_optional": false, + "description": "

The URL of the page to embed.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", + "default": "the" + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", + "default": "150." + }, + { + "name": "scrolling", + "type_name": "bool", + "is_optional": false, + "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/iframe.py#L25" + }, + "DeltaGenerator.add_rows": { + "name": "add_rows", + "signature": "element.add_rows(data=None, **kwargs)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf1 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table = st.table(df1)\n\ndf2 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table.add_rows(df2)\n# Now the table shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

You can do the same thing with plots. For example, if you want to add\nmore data to a line chart:

\n
\n# Assuming df1 and df2 from the example above still exist...\nmy_chart = st.line_chart(df1)\nmy_chart.add_rows(df2)\n# Now the chart shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

And for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:

\n
\nmy_chart = st.vega_lite_chart({\n    'mark': 'line',\n    'encoding': {'x': 'a', 'y': 'b'},\n    'datasets': {\n      'some_fancy_name': df1,  # <-- named dataset\n     },\n    'data': {'name': 'some_fancy_name'},\n}),\nmy_chart.add_rows(some_fancy_name=df2)  # <-- name used as keyword\n
\n
\n", + "description": "

Concatenate a dataframe to the bottom of the current one.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, Iterable, dict, or None", + "is_optional": false, + "description": "

Table to concat. Optional.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "**kwargs", + "type_name": "pandas.DataFrame, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

The named dataset to concat. Optional. You can only pass in 1\ndataset (including the one in the data parameter).

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/dataframe_selector.py#L620" + }, + "DeltaGenerator.altair_chart": { + "name": "altair_chart", + "signature": "element.altair_chart(altair_chart, use_container_width=False, theme=\"streamlit\")", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(chart_data).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n
\n", + "description": "

Display a chart using the Altair library.

\n", + "args": [ + { + "name": "altair_chart", + "type_name": "altair.Chart", + "is_optional": false, + "description": "

The Altair chart object to display.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/dataframe_selector.py#L492" + }, + "DeltaGenerator.area_chart": { + "name": "area_chart", + "signature": "element.area_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n
\n", + "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/dataframe_selector.py#L317" + }, + "DeltaGenerator.audio": { + "name": "audio", + "signature": "element.audio(data, format=\"audio/wav\", start_time=0, *, sample_rate=None)", + "example": "
\n
\nimport streamlit as st\nimport numpy as np\n\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n\nsample_rate = 44100  # 44100 samples per second\nseconds = 2  # Note duration of 2 seconds\nfrequency_la = 440  # Our played note will be 440 Hz\n# Generate array with seconds*sample_rate steps, ranging between 0 and seconds\nt = np.linspace(0, seconds, seconds * sample_rate, False)\n# Generate a 440 Hz sine wave\nnote_la = np.sin(frequency_la * t * 2 * np.pi)\n\nst.audio(note_la, sample_rate=sample_rate)\n
\n\n \n
\n", + "description": "

Display an audio player.

\n", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw audio data, filename, or a URL pointing to the file to load.\nRaw data formats must include all necessary file headers to match the file\nformat specified via format.\nIf data is a numpy array, it must either be a 1D array of the waveform\nor a 2D array of shape (num_channels, num_samples) with waveforms\nfor all channels. See the default channel order at\nhttp://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx

\n", + "default": "channel" + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + }, + { + "name": "sample_rate", + "type_name": "int or None", + "is_optional": false, + "description": "

The sample rate of the audio data in samples per second. Only required if\ndata is a numpy array.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/media.py#L42" + }, + "DeltaGenerator.balloons": { + "name": "balloons", + "signature": "element.balloons()", + "example": "
\n
\nimport streamlit as st\n\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", + "description": "

Draw celebratory balloons.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/balloons.py#L25" + }, + "DeltaGenerator.bar_chart": { + "name": "bar_chart", + "signature": "element.bar_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n
\n", + "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/dataframe_selector.py#L404" + }, + "DeltaGenerator.bokeh_chart": { + "name": "bokeh_chart", + "signature": "element.bokeh_chart(figure, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n
\n", + "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", + "args": [ + { + "name": "figure", + "type_name": "bokeh.plotting.figure.Figure", + "is_optional": false, + "description": "

A Bokeh figure to plot.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Bokeh's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/bokeh_chart.py#L36" + }, + "DeltaGenerator.button": { + "name": "button", + "signature": "element.button(label, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\n\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n
\n", + "description": "

Display a button widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/button.py#L61" + }, + "DeltaGenerator.camera_input": { + "name": "camera_input", + "signature": "element.camera_input(label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", + "description": "

Display a widget that returns pictures from the user's webcam.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this widget is used for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the camera input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this camera_input's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile", + "is_generator": false, + "description": "

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/camera_input.py#L109" + }, + "DeltaGenerator.caption": { + "name": "caption", + "signature": "element.caption(body, unsafe_allow_html=False, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.caption('This is a string that explains something above.')\nst.caption('A caption with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the caption.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/markdown.py#L132" + }, + "DeltaGenerator.chat_input": { + "name": "chat_input", + "signature": "element.chat_input(placeholder=\"Your message\", *, key=None, max_chars=None, disabled=False, on_submit=None, args=None, kwargs=None)", + "examples": "
\n
\nimport streamlit as st\n\nprompt = st.chat_input("Say something")\nif prompt:\n    st.write(f"User has sent the following prompt: {prompt}")\n
\n\n \n
\n", + "description": "

Display a chat input widget.

\n
\n

Warning

\n

Chat input can only be used once per app page and inside the main area of the app.\nIt cannot be used in the sidebar, columns, expanders, forms or tabs.\nWe plan to support this in the future.

\n
\n", + "args": [ + { + "name": "placeholder", + "type_name": "str", + "is_optional": false, + "description": "

A placeholder text shown when the chat input is empty. Defaults to\n"Your message". For accessibility reasons, you should not use an\nempty string.

\n", + "default": "s" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget based on\nits content. Multiple widgets of the same type may not share the same key.

\n", + "default": null + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of characters that can be entered. If None\n(default), there will be no maximum.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

Whether the chat input should be disabled. Defaults to False.

\n", + "default": "False." + }, + { + "name": "on_submit", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when the chat input's value is submitted.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "str or None", + "is_generator": false, + "description": "

The current (non-empty) value of the text input widget on the last\nrun of the app, None otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/chat.py#L208" + }, + "DeltaGenerator.chat_message": { + "name": "chat_message", + "signature": "element.chat_message(name, *, avatar=None)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\nimport numpy as np\n\nwith st.chat_message("user"):\n    st.write("Hello \ud83d\udc4b")\n    st.line_chart(np.random.randn(30, 3))\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\nmessage = st.chat_message("assistant")\nmessage.write("Hello human")\nmessage.bar_chart(np.random.randn(30, 3))\n
\n\n \n
\n", + "description": "

Insert a chat message container.

\n

To add elements to the returned container, you can use with notation\n(preferred) or just call methods directly on the returned object. See the\nexamples below.

\n", + "args": [ + { + "name": "name", + "type_name": "\"user\", \"assistant\", or str", + "is_optional": false, + "description": "

The name of the message author. Can be \u201cuser\u201d or \u201cassistant\u201d to\nenable preset styling and avatars.

\n

Currently, the name is not shown in the UI but is only set as an\naccessibility label. For accessibility reasons, you should not use\nan empty string.

\n", + "default": null + }, + { + "name": "avatar", + "type_name": "str, numpy.ndarray, or BytesIO", + "is_optional": false, + "description": "

The avatar shown next to the message. Can be one of:

\n
    \n
  • A single emoji, e.g. "\ud83e\uddd1\u200d\ud83d\udcbb", "\ud83e\udd16", "\ud83e\udd96". Shortcodes are not supported.
  • \n
  • \n
    An image using one of the formats allowed for st.image: path of a local
    \n
    image file; URL to fetch the image from; array of shape (w,h) or (w,h,1)\nfor a monochrome image, (w,h,3) for a color image, or (w,h,4) for an RGBA image.
    \n
    \n
  • \n
\n

If None (default), uses default icons if name is "user" or\n"assistant", or the first letter of the name value.

\n", + "default": "icons" + } + ], + "returns": [ + { + "type_name": "Container", + "is_generator": false, + "description": "

A single container that can hold multiple elements.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/chat.py#L112" + }, + "DeltaGenerator.checkbox": { + "name": "checkbox", + "signature": "element.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n
\n", + "description": "

Display a checkbox widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this checkbox is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "value", + "type_name": "bool", + "is_optional": false, + "description": "

Preselect the checkbox when it first renders. This will be\ncast to bool internally.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the checkbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this checkbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

Whether or not the checkbox is checked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/checkbox.py#L52" + }, + "DeltaGenerator.code": { + "name": "code", + "signature": "element.code(body, language=\"python\", line_numbers=False)", + "example": "
\n
\nimport streamlit as st\n\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", + "description": "

Display a code block with optional syntax highlighting.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as code.

\n", + "default": null + }, + { + "name": "language", + "type_name": "str or None", + "is_optional": false, + "description": "

The language that the code is written in, for syntax highlighting.\nIf None, the code will be unstyled. Defaults to "python".

\n

For a list of available language values, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", + "default": "s" + }, + { + "name": "line_numbers", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean indicating whether to show line numbers to the\nleft of the code block. Defaults to False.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/code.py#L27" + }, + "DeltaGenerator.color_picker": { + "name": "color_picker", + "signature": "element.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n
\n", + "description": "

Display a color picker widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "str", + "is_optional": false, + "description": "

The hex value of this widget when it first renders. If None,\ndefaults to black.

\n", + "default": "black." + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the color picker.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this color_picker's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The selected color as a hex string.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/color_picker.py#L52" + }, + "DeltaGenerator.columns": { + "name": "columns", + "signature": "element.columns(spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or iterable of numbers", + "is_optional": false, + "description": "

Controls the number and width of columns to insert. Can be one of:

\n
    \n
  • An integer that specifies the number of columns. All columns have equal\nwidth in this case.
  • \n
  • An iterable of numbers (int or float) that specify the relative width of\neach column. E.g. [0.7, 0.3] creates two columns where the first\none takes up 70% of the available with and the second one takes up 30%.\nOr [1, 2, 3] creates three columns where the second one is two times\nthe width of the first one, and the third one is three times that width.
  • \n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "\"small\", \"medium\", or \"large\"", + "is_optional": false, + "description": "

The size of the gap between the columns. Defaults to "small". This\nargument can only be supplied by keyword.

\n", + "default": "s" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/layouts.py#L75" + }, + "DeltaGenerator.container": { + "name": "container", + "signature": "element.container()", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/layouts.py#L27" + }, + "DeltaGenerator.data_editor": { + "name": "data_editor", + "signature": "element.data_editor(data, *, width=None, height=None, use_container_width=False, hide_index=None, column_order=None, column_config=None, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

Or you can customize the data editor via column_config, hide_index, column_order, or disabled:

\n
\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    [\n        {"command": "st.selectbox", "rating": 4, "is_widget": True},\n        {"command": "st.balloons", "rating": 5, "is_widget": False},\n        {"command": "st.time_input", "rating": 3, "is_widget": True},\n    ]\n)\nedited_df = st.data_editor(\n    df,\n    column_config={\n        "command": "Streamlit Command",\n        "rating": st.column_config.NumberColumn(\n            "Your rating",\n            help="How much do you like this command (1-5)?",\n            min_value=1,\n            max_value=5,\n            step=1,\n            format="%d \u2b50",\n        ),\n        "is_widget": "Widget ?",\n    },\n    disabled=["command", "is_widget"],\n    hide_index=True,\n)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n
\n", + "description": "

Display a data editor widget.

\n

The data editor widget allows you to edit dataframes and many other data structures in a table-like UI.

\n
\n

Warning

\n

When going from st.experimental_data_editor to st.data_editor in\n1.23.0, the data editor's representation in st.session_state was changed.\nThe edited_cells dictionary is now called edited_rows and uses a\ndifferent format ({0: {"column name": "edited value"}} instead of\n{"0:1": "edited value"}). You may need to adjust the code if your app uses\nst.experimental_data_editor in combination with st.session_state."

\n
\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None", + "is_optional": false, + "description": "

The data to edit in the data editor.

\n
\n

Note

\n

Mixing data types within a column can make the column uneditable.\nAdditionally, the following data types are not yet supported for editing:\ncomplex, list, tuple, bytes, bytearray, memoryview, dict, set, frozenset,\ndatetime.timedelta, decimal.Decimal, fractions.Fraction, pandas.Interval,\npandas.Period, pandas.Timedelta.

\n
\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the data editor expressed in pixels. If None, the width will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the data editor expressed in pixels. If None, the height will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the data editor width to the width of the parent container.\nThis takes precedence over the width argument. Defaults to False.

\n", + "default": "False." + }, + { + "name": "hide_index", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether to hide the index column(s). If None (default), the visibility of\nindex columns is automatically determined based on the data.

\n", + "default": null + }, + { + "name": "column_order", + "type_name": "iterable of str or None", + "is_optional": false, + "description": "

Specifies the display order of columns. This also affects which columns are\nvisible. For example, column_order=("col2", "col1") will display 'col2'\nfirst, followed by 'col1', and will hide all other non-index columns. If\nNone (default), the order is inherited from the original data structure.

\n", + "default": null + }, + { + "name": "column_config", + "type_name": "dict or None", + "is_optional": false, + "description": "

Configures how columns are displayed, e.g. their title, visibility, type, or\nformat, as well as editing properties such as min/max value or step.\nThis needs to be a dictionary where each key is a column name and the value\nis one of:

\n
    \n
  • None to hide the column.
  • \n
  • A string to set the display label of the column.
  • \n
  • One of the column types defined under st.column_config, e.g.\nst.column_config.NumberColumn("Dollar values\u201d, format=\u201d$ %d") to show\na column as dollar amounts. See more info on the available column types\nand config options here.
  • \n
\n

To configure the index column(s), use _index as the column name.

\n", + "default": null + }, + { + "name": "num_rows", + "type_name": "\"fixed\" or \"dynamic\"", + "is_optional": false, + "description": "

Specifies if the user can add and delete rows in the data editor.\nIf "fixed", the user cannot add or delete rows. If "dynamic", the user can\nadd and delete rows in the data editor, but column sorting is disabled.\nDefaults to "fixed".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool or iterable of str", + "is_optional": false, + "description": "

Controls the editing of columns. If True, editing is disabled for all columns.\nIf an iterable of column names is provided (e.g., disabled=("col1", "col2")),\nonly the specified columns will be disabled for editing. If False (default),\nall columns that support editing are editable.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the unique key for this widget. If this\nis omitted, a key will be generated for the widget based on its\ncontent. Multiple widgets of the same type may not share the same\nkey.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this data_editor's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "pandas.DataFrame, pandas.Series, pyarrow.Table, numpy.ndarray, list, set, tuple, or dict.", + "is_generator": false, + "description": "

The edited data. The edited data is returned in its original data type if\nit corresponds to any of the supported return types. All other data types\nare returned as a pd.DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/data_editor.py#L527" + }, + "DeltaGenerator.dataframe": { + "name": "dataframe", + "signature": "element.dataframe(data=None, width=None, height=None, *, use_container_width=False, hide_index=None, column_order=None, column_config=None)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n

Or you can customize the dataframe via column_config, hide_index, or column_order:

\n
\nimport random\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    {\n        "name": ["Roadmap", "Extras", "Issues"],\n        "url": ["https://roadmap.streamlit.app", "https://extras.streamlit.app", "https://issues.streamlit.app"],\n        "stars": [random.randint(0, 1000) for _ in range(3)],\n        "views_history": [[random.randint(0, 5000) for _ in range(30)] for _ in range(3)],\n    }\n)\nst.dataframe(\n    df,\n    column_config={\n        "name": "App name",\n        "stars": st.column_config.NumberColumn(\n            "Github Stars",\n            help="Number of stars on GitHub",\n            format="%d \u2b50",\n        ),\n        "url": st.column_config.LinkColumn("App URL"),\n        "views_history": st.column_config.LineChartColumn(\n            "Views (past 30 days)", y_min=0, y_max=5000\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Display a dataframe as an interactive table.

\n

This command works with dataframes from Pandas, PyArrow, Snowpark, and PySpark.\nIt can also display several other types that can be converted to dataframes,\ne.g. numpy arrays, lists, sets and dictionaries.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the dataframe expressed in pixels. If None, the width\nwill be automatically calculated based on the column content.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the dataframe expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the dataframe width to the width of the parent container.\nThis takes precedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "hide_index", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether to hide the index column(s). If None (default), the visibility of\nindex columns is automatically determined based on the data.

\n", + "default": null + }, + { + "name": "column_order", + "type_name": "iterable of str or None", + "is_optional": false, + "description": "

Specifies the display order of columns. This also affects which columns are\nvisible. For example, column_order=("col2", "col1") will display 'col2'\nfirst, followed by 'col1', and will hide all other non-index columns. If\nNone (default), the order is inherited from the original data structure.

\n", + "default": null + }, + { + "name": "column_config", + "type_name": "dict or None", + "is_optional": false, + "description": "

Configures how columns are displayed, e.g. their title, visibility, type, or\nformat. This needs to be a dictionary where each key is a column name and\nthe value is one of:

\n
    \n
  • None to hide the column.
  • \n
  • A string to set the display label of the column.
  • \n
  • One of the column types defined under st.column_config, e.g.\nst.column_config.NumberColumn("Dollar values\u201d, format=\u201d$ %d") to show\na column as dollar amounts. See more info on the available column types\nand config options here.
  • \n
\n

To configure the index column(s), use _index as the column name.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/dataframe_selector.py#L43" + }, + "DeltaGenerator.date_input": { + "name": "date_input", + "signature": "element.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nd = st.date_input(\n    "When\\'s your birthday",\n    datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n
\n", + "description": "

Display a date input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this date input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", + "is_optional": false, + "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", + "default": "today" + }, + { + "name": "min_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", + "default": "value" + }, + { + "name": "max_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", + "default": "value" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this date_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.date or a tuple with 0-2 dates", + "is_generator": false, + "description": "

The current value of the date input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/time_widgets.py#L398" + }, + "DeltaGenerator.dg": { + "name": "dg", + "signature": "element.dg", + "description": "

Get our DeltaGenerator.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/alert.py#L168" + }, + "DeltaGenerator.divider": { + "name": "divider", + "signature": "element.divider()", + "example": "
\n
\nimport streamlit as st\n\nst.divider()\n
\n
\n", + "description": "

Display a horizontal rule.

\n
\n

Note

\n

You can achieve the same effect with st.write("---") or\neven just "---" in your script (via magic).

\n
\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/markdown.py#L244" + }, + "DeltaGenerator.download_button": { + "name": "download_button", + "signature": "element.download_button(label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False, use_container_width=False)", + "examples": "
\n

Download a large DataFrame as a CSV:

\n
\nimport streamlit as st\n\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\nimport streamlit as st\n\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nimport streamlit as st\n\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nimport streamlit as st\n\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n
\n", + "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "data", + "type_name": "str or bytes or file", + "is_optional": false, + "description": "

The contents of the file to be downloaded. See example below for\ncaching techniques to avoid recomputing this data unnecessarily.

\n", + "default": null + }, + { + "name": "file_name", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the name of the file to be downloaded,\nsuch as 'my_file.csv'. If not specified, the name will be\nautomatically generated.

\n", + "default": null + }, + { + "name": "mime", + "type_name": "str or None", + "is_optional": false, + "description": "

The MIME type of the data. If None, defaults to "text/plain"\n(if data is of type str or is a textual file) or\n"application/octet-stream" (if data is of type bytes or is a\nbinary file).

\n", + "default": "s" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/button.py#L169" + }, + "DeltaGenerator.empty": { + "name": "empty", + "signature": "element.empty()", + "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport streamlit as st\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nimport streamlit as st\n\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", + "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/empty.py#L24" + }, + "DeltaGenerator.error": { + "name": "error", + "signature": "element.error(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", + "description": "

Display error message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The error text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/alert.py#L39" + }, + "DeltaGenerator.exception": { + "name": "exception", + "signature": "element.exception(exception)", + "example": "
\n
\nimport streamlit as st\n\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", + "description": "

Display an exception.

\n", + "args": [ + { + "name": "exception", + "type_name": "Exception", + "is_optional": false, + "description": "

The exception to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/exception.py#L50" + }, + "DeltaGenerator.expander": { + "name": "expander", + "signature": "element.expander(label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/layouts.py#L315" + }, + "DeltaGenerator.experimental_data_editor": { + "name": "experimental_data_editor", + "signature": "element.experimental_data_editor(data, *, width=None, height=None, use_container_width=False, hide_index=None, column_order=None, column_config=None, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

Or you can customize the data editor via column_config, hide_index, column_order, or disabled:

\n
\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    [\n        {"command": "st.selectbox", "rating": 4, "is_widget": True},\n        {"command": "st.balloons", "rating": 5, "is_widget": False},\n        {"command": "st.time_input", "rating": 3, "is_widget": True},\n    ]\n)\nedited_df = st.data_editor(\n    df,\n    column_config={\n        "command": "Streamlit Command",\n        "rating": st.column_config.NumberColumn(\n            "Your rating",\n            help="How much do you like this command (1-5)?",\n            min_value=1,\n            max_value=5,\n            step=1,\n            format="%d \u2b50",\n        ),\n        "is_widget": "Widget ?",\n    },\n    disabled=["command", "is_widget"],\n    hide_index=True,\n)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n
\n", + "description": "

Display a data editor widget.

\n

The data editor widget allows you to edit dataframes and many other data structures in a table-like UI.

\n
\n

Warning

\n

When going from st.experimental_data_editor to st.data_editor in\n1.23.0, the data editor's representation in st.session_state was changed.\nThe edited_cells dictionary is now called edited_rows and uses a\ndifferent format ({0: {"column name": "edited value"}} instead of\n{"0:1": "edited value"}). You may need to adjust the code if your app uses\nst.experimental_data_editor in combination with st.session_state."

\n
\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None", + "is_optional": false, + "description": "

The data to edit in the data editor.

\n
\n

Note

\n

Mixing data types within a column can make the column uneditable.\nAdditionally, the following data types are not yet supported for editing:\ncomplex, list, tuple, bytes, bytearray, memoryview, dict, set, frozenset,\ndatetime.timedelta, decimal.Decimal, fractions.Fraction, pandas.Interval,\npandas.Period, pandas.Timedelta.

\n
\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the data editor expressed in pixels. If None, the width will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the data editor expressed in pixels. If None, the height will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the data editor width to the width of the parent container.\nThis takes precedence over the width argument. Defaults to False.

\n", + "default": "False." + }, + { + "name": "hide_index", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether to hide the index column(s). If None (default), the visibility of\nindex columns is automatically determined based on the data.

\n", + "default": null + }, + { + "name": "column_order", + "type_name": "iterable of str or None", + "is_optional": false, + "description": "

Specifies the display order of columns. This also affects which columns are\nvisible. For example, column_order=("col2", "col1") will display 'col2'\nfirst, followed by 'col1', and will hide all other non-index columns. If\nNone (default), the order is inherited from the original data structure.

\n", + "default": null + }, + { + "name": "column_config", + "type_name": "dict or None", + "is_optional": false, + "description": "

Configures how columns are displayed, e.g. their title, visibility, type, or\nformat, as well as editing properties such as min/max value or step.\nThis needs to be a dictionary where each key is a column name and the value\nis one of:

\n
    \n
  • None to hide the column.
  • \n
  • A string to set the display label of the column.
  • \n
  • One of the column types defined under st.column_config, e.g.\nst.column_config.NumberColumn("Dollar values\u201d, format=\u201d$ %d") to show\na column as dollar amounts. See more info on the available column types\nand config options here.
  • \n
\n

To configure the index column(s), use _index as the column name.

\n", + "default": null + }, + { + "name": "num_rows", + "type_name": "\"fixed\" or \"dynamic\"", + "is_optional": false, + "description": "

Specifies if the user can add and delete rows in the data editor.\nIf "fixed", the user cannot add or delete rows. If "dynamic", the user can\nadd and delete rows in the data editor, but column sorting is disabled.\nDefaults to "fixed".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool or iterable of str", + "is_optional": false, + "description": "

Controls the editing of columns. If True, editing is disabled for all columns.\nIf an iterable of column names is provided (e.g., disabled=("col1", "col2")),\nonly the specified columns will be disabled for editing. If False (default),\nall columns that support editing are editable.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the unique key for this widget. If this\nis omitted, a key will be generated for the widget based on its\ncontent. Multiple widgets of the same type may not share the same\nkey.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this data_editor's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "pandas.DataFrame, pandas.Series, pyarrow.Table, numpy.ndarray, list, set, tuple, or dict.", + "is_generator": false, + "description": "

The edited data. The edited data is returned in its original data type if\nit corresponds to any of the supported return types. All other data types\nare returned as a pd.DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/data_editor.py#L527" + }, + "DeltaGenerator.file_uploader": { + "name": "file_uploader", + "signature": "element.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nimport streamlit as st\nimport pandas as pd\nfrom io import StringIO\n\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nimport streamlit as st\n\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n
\n", + "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this file uploader is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str or list of str or None", + "is_optional": false, + "description": "

Array of allowed extensions. ['png', 'jpg']\nThe default is None, which means all extensions are allowed.

\n", + "default": "None" + }, + { + "name": "accept_multiple_files", + "type_name": "bool", + "is_optional": false, + "description": "

If True, allows the user to upload multiple files at the same time,\nin which case the return value will be a list of files.\nDefault: False

\n", + "default": "False" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the file uploader.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this file_uploader's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the file uploader if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile or list of UploadedFile", + "is_generator": false, + "description": "
    \n
  • If accept_multiple_files is False, returns either None or\nan UploadedFile object.
  • \n
  • If accept_multiple_files is True, returns a list with the\nuploaded files as UploadedFile objects. If no files were\nuploaded, returns an empty list.
  • \n
\n

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/file_uploader.py#L214" + }, + "DeltaGenerator.form": { + "name": "form", + "signature": "element.form(key, clear_on_submit=False)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n

Inserting elements out of order:

\n
\nimport streamlit as st\n\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n
\n", + "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

A string that identifies the form. Each form must have its own\nkey. (This key is not displayed to the user in the interface.)

\n", + "default": null + }, + { + "name": "clear_on_submit", + "type_name": "bool", + "is_optional": false, + "description": "

If True, all widgets inside the form will be reset to their default\nvalues after the user presses the Submit button. Defaults to False.\n(Note that Custom Components are unaffected by this flag, and\nwill not be reset to their defaults on form submission.)

\n", + "default": "values" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/form.py#L118" + }, + "DeltaGenerator.form_submit_button": { + "name": "form_submit_button", + "signature": "element.form_submit_button(label=\"Submit\", help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nDefaults to "Submit".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

A tooltip that gets displayed when the button is hovered over.\nDefaults to None.

\n", + "default": "None." + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/form.py#L211" + }, + "DeltaGenerator.graphviz_chart": { + "name": "graphviz_chart", + "signature": "element.graphviz_chart(figure_or_dot, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nimport graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n
\n", + "description": "

Display a graph using the dagre-d3 library.

\n", + "args": [ + { + "name": "figure_or_dot", + "type_name": "graphviz.dot.Graph, graphviz.dot.Digraph, str", + "is_optional": false, + "description": "

The Graphlib graph object or dot string to display

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/graphviz_chart.py#L39" + }, + "DeltaGenerator.header": { + "name": "header", + "signature": "element.header(body, anchor=None, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.header('This is a header')\nst.header('A header with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in header formatting.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str or False", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the header.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/heading.py#L40" + }, + "DeltaGenerator.help": { + "name": "help", + "signature": "element.help(obj=)", + "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nimport streamlit as st\nimport pandas\n\nst.help(pandas.DataFrame)\n
\n\n \n

Want to quickly check what data type is output by a certain function?\nTry:

\n
\nimport streamlit as st\n\nx = my_poorly_documented_function()\nst.help(x)\n
\n

Want to quickly inspect an object? No sweat:

\n
\nclass Dog:\n  '''A typical dog.'''\n\n  def __init__(self, breed, color):\n    self.breed = breed\n    self.color = color\n\n  def bark(self):\n    return 'Woof!'\n\n\nfido = Dog('poodle', 'white')\n\nst.help(fido)\n
\n\n \n

And if you're using Magic, you can get help for functions, classes,\nand modules without even typing st.help:

\n
\nimport streamlit as st\nimport pandas\n\n# Get help for Pandas read_csv:\npandas.read_csv\n\n# Get help for Streamlit itself:\nst\n
\n\n \n
\n", + "description": "

Display help and other information for a given object.

\n

Depending on the type of object that is passed in, this displays the\nobject's name, type, value, signature, docstring, and member variables,\nmethods \u2014 as well as the values/docstring of members and methods.

\n", + "args": [ + { + "name": "obj", + "type_name": "any", + "is_optional": false, + "description": "

The object whose information should be displayed. If left\nunspecified, this call will display help for Streamlit itself.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/doc_string.py#L48" + }, + "DeltaGenerator.id": { + "name": "id", + "signature": "element.id" + }, + "DeltaGenerator.image": { + "name": "image", + "signature": "element.image(image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", + "example": "
\n
\nimport streamlit as st\nfrom PIL import Image\n\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n
\n", + "description": "

Display an image or list of images.

\n", + "args": [ + { + "name": "image", + "type_name": "numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]", + "is_optional": false, + "description": "

Monochrome image of shape (w,h) or (w,h,1)\nOR a color image of shape (w,h,3)\nOR an RGBA image of shape (w,h,4)\nOR a URL to fetch the image from\nOR a path of a local image file\nOR an SVG XML string like <svg xmlns=...</svg>\nOR a list of one of the above, to display multiple images.

\n", + "default": null + }, + { + "name": "caption", + "type_name": "str or list of str", + "is_optional": false, + "description": "

Image caption. If displaying multiple images, caption should be a\nlist of captions (one for each image).

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Image width. None means use the image width,\nbut do not exceed the width of the column.\nShould be set for SVG images, as they have no default image width.

\n", + "default": "image" + }, + { + "name": "use_column_width", + "type_name": "\"auto\", \"always\", \"never\", or bool", + "is_optional": false, + "description": "

If "auto", set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf "always" or True, set the image's width to the column width.\nIf "never" or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", + "default": null + }, + { + "name": "clamp", + "type_name": "bool", + "is_optional": false, + "description": "

Clamp image pixel values to a valid range ([0-255] per channel).\nThis is only meaningful for byte array images; the parameter is\nignored for image URLs. If this is not set, and an image has an\nout-of-range value, an error will be thrown.

\n", + "default": null + }, + { + "name": "channels", + "type_name": "\"RGB\" or \"BGR\"", + "is_optional": false, + "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to "RGB", meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to "BGR", instead.

\n", + "default": "s" + }, + { + "name": "output_format", + "type_name": "\"JPEG\", \"PNG\", or \"auto\"", + "is_optional": false, + "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to "auto" which identifies the compression type based\non the type and format of the image argument.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/image.py#L88" + }, + "DeltaGenerator.info": { + "name": "info", + "signature": "element.info(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", + "description": "

Display an informational message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The info text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/alert.py#L103" + }, + "DeltaGenerator.json": { + "name": "json", + "signature": "element.json(body, *, expanded=True)", + "example": "
\n
\nimport streamlit as st\n\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n
\n", + "description": "

Display object or string as a pretty-printed JSON string.

\n", + "args": [ + { + "name": "body", + "type_name": "object or str", + "is_optional": false, + "description": "

The object to print as JSON. All referenced objects should be\nserializable to JSON as well. If object is a string, we assume it\ncontains serialized JSON.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean that allows the user to set whether the initial\nstate of this json element should be expanded. Defaults to True.\nThis argument can only be supplied by keyword.

\n", + "default": "True." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/json.py#L35" + }, + "DeltaGenerator.latex": { + "name": "latex", + "signature": "element.latex(body, *, help=None)", + "example": "
\n
\nimport streamlit as st\n\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", + "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", + "args": [ + { + "name": "body", + "type_name": "str or SymPy expression", + "is_optional": false, + "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the LaTeX expression.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/markdown.py#L196" + }, + "DeltaGenerator.line_chart": { + "name": "line_chart", + "signature": "element.line_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\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 \n
\n", + "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict or None", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/dataframe_selector.py#L230" + }, + "DeltaGenerator.map": { + "name": "map", + "signature": "element.map(data=None, zoom=None, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n
\n", + "description": "

Display a map with points on it.

\n

This is a wrapper around st.pydeck_chart to quickly create\nscatterplot charts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to be plotted. Must have two columns:

\n
    \n
  • latitude called 'lat', 'latitude', 'LAT', 'LATITUDE'
  • \n
  • longitude called 'lon', 'longitude', 'LON', 'LONGITUDE'.
  • \n
\n", + "default": null + }, + { + "name": "zoom", + "type_name": "int", + "is_optional": false, + "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/map.py#L76" + }, + "DeltaGenerator.markdown": { + "name": "markdown", + "signature": "element.markdown(body, unsafe_allow_html=False, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.markdown('Streamlit is **_really_ cool**.')\nst.markdown("This text is :red[colored red], and this is **:blue[colored]** and bold.")\nst.markdown(":green[$\\sqrt{x^2+y^2}=1$] is a Pythagorean identity. :pencil:")\n
\n
\n", + "description": "

Display string formatted as Markdown.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the Markdown.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/markdown.py#L31" + }, + "DeltaGenerator.metric": { + "name": "metric", + "signature": "element.metric(label, value, delta=None, delta_color=\"normal\", help=None, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n

st.metric looks especially nice in combination with st.columns:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n

The delta indicator color can also be inverted or turned off:

\n
\nimport streamlit as st\n\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n
\n", + "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

The header or title for the metric. The label can optionally contain\nMarkdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Value of the metric. None is rendered as a long dash.

\n", + "default": null + }, + { + "name": "delta", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Indicator of how the metric changed, rendered with an arrow below\nthe metric. If delta is negative (int/float) or starts with a minus\nsign (str), the arrow points down and the text is red; else the\narrow points up and the text is green. If None (default), no delta\nindicator is shown.

\n", + "default": null + }, + { + "name": "delta_color", + "type_name": "\"normal\", \"inverse\", or \"off\"", + "is_optional": false, + "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the metric label.

\n", + "default": null + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/metric.py#L46" + }, + "DeltaGenerator.multiselect": { + "name": "multiselect", + "signature": "element.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", max_selections=None)", + "example": "
\n
\nimport streamlit as st\n\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n
\n", + "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence[V], numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "default", + "type_name": "[V], V, or None", + "is_optional": false, + "description": "

List of default values. Can also be a single value.

\n", + "default": "values." + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of selectbox options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe multiselect.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the multiselect.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this multiselect's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the multiselect widget if set\nto True. The default is False. This argument can only be supplied\nby keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "max_selections", + "type_name": "int", + "is_optional": false, + "description": "

The max selections that can be selected at a time.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list", + "is_generator": false, + "description": "

A list with the selected options

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/multiselect.py#L145" + }, + "DeltaGenerator.number_input": { + "name": "number_input", + "signature": "element.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n
\n", + "description": "

Display a numeric input widget.

\n
\n

Note

\n

Integer values exceeding +/- (1<<53) - 1 cannot be accurately\nstored or returned by the widget due to serialization contstraints\nbetween the Python server and JavaScript client. You must handle\nsuch numbers as floats, leading to a loss in precision.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. Output must be purely numeric. This does not impact\nthe return value. Valid formatters: %d %e %f %g %i %u

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this number_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the number input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int or float", + "is_generator": false, + "description": "

The current value of the numeric input widget. The return type\nwill match the data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/number_input.py#L66" + }, + "DeltaGenerator.plotly_chart": { + "name": "plotly_chart", + "signature": "element.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", theme=\"streamlit\", **kwargs)", + "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport numpy as np\nimport plotly.figure_factory as ff\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n        hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n
\n", + "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", + "args": [ + { + "name": "figure_or_data", + "type_name": "plotly.graph_objs.Figure, plotly.graph_objs.Data,", + "is_optional": false, + "description": "

dict/list of plotly.graph_objs.Figure/Data

\n

See https://plot.ly/python/ for examples of graph descriptions.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + }, + { + "name": "sharing", + "type_name": "\"streamlit\", \"private\", \"secret\", or \"public\"", + "is_optional": false, + "description": "

Use "streamlit" to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": null, + "is_optional": null, + "description": "

Any argument accepted by Plotly's plot() function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/plotly_chart.py#L81" + }, + "DeltaGenerator.progress": { + "name": "progress", + "signature": "element.progress(value, text=None)", + "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport streamlit as st\nimport time\n\nprogress_text = "Operation in progress. Please wait."\nmy_bar = st.progress(0, text=progress_text)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1, text=progress_text)\n
\n
\n", + "description": "

Display a progress bar.

\n", + "args": [ + { + "name": "value", + "type_name": "int or float", + "is_optional": false, + "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", + "default": null + }, + { + "name": "text", + "type_name": "str or None", + "is_optional": false, + "description": "

A message to display above the progress bar. The text can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/progress.py#L66" + }, + "DeltaGenerator.pydeck_chart": { + "name": "pydeck_chart", + "signature": "element.pydeck_chart(pydeck_obj=None, use_container_width=False)", + "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport pydeck as pdk\n\nchart_data = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=chart_data,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=chart_data,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", + "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "args": [ + { + "name": "pydeck_obj", + "type_name": "pydeck.Deck or None", + "is_optional": false, + "description": "

Object specifying the PyDeck chart to draw.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/deck_gl_json_chart.py#L36" + }, + "DeltaGenerator.pyplot": { + "name": "pyplot", + "signature": "element.pyplot(fig=None, clear_figure=None, use_container_width=True, **kwargs)", + "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", + "example": "
\n
\nimport streamlit as st\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n
\n", + "description": "

Display a matplotlib.pyplot figure.

\n", + "args": [ + { + "name": "fig", + "type_name": "Matplotlib Figure", + "is_optional": false, + "description": "

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

\n", + "default": null + }, + { + "name": "clear_figure", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", + "default": "based" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n", + "default": "s" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Arguments to pass to Matplotlib's savefig function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/pyplot.py#L38" + }, + "DeltaGenerator.radio": { + "name": "radio", + "signature": "element.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ngenre = st.radio(\n    "What\\'s your favorite movie genre",\n    ('Comedy', 'Drama', 'Documentary'))\n\nif genre == 'Comedy':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn\\'t select comedy.")\n
\n\n \n
\n", + "description": "

Display a radio button widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this radio group is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the radio options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of radio options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe radio.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the radio.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this radio's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the radio button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False." + }, + { + "name": "horizontal", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", + "default": "false" + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/radio.py#L75" + }, + "DeltaGenerator.select_slider": { + "name": "select_slider", + "signature": "element.select_slider(label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\nimport streamlit as st\n\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nimport streamlit as st\n\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n ", + "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the slider options. All options will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", + "default": "." + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to first option.

\n", + "default": "first" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels from the options.\nargument. It receives the option as an argument and its output\nwill be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the select slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this select_slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the select slider if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any value or tuple of any value", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/select_slider.py#L106" + }, + "DeltaGenerator.selectbox": { + "name": "selectbox", + "signature": "element.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n
\n", + "description": "

Display a select widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": "." + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels. It receives the option\nas an argument and its output will be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the selectbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this selectbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the selectbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/selectbox.py#L71" + }, + "DeltaGenerator.slider": { + "name": "slider", + "signature": "element.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nimport streamlit as st\n\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nimport streamlit as st\nfrom datetime import time\n\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nimport streamlit as st\nfrom datetime import datetime\n\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n
\n", + "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n
\n

Note

\n

Integer values exceeding +/- (1<<53) - 1 cannot be accurately\nstored or returned by the widget due to serialization contstraints\nbetween the Python server and JavaScript client. You must handle\nsuch numbers as floats, leading to a loss in precision.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The minimum permitted value.\nDefaults to 0 if the value is an int, 0.0 if a float,\nvalue - timedelta(days=14) if a date/datetime, time.min if a time

\n", + "default": "0" + }, + { + "name": "max_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The maximum permitted value.\nDefaults to 100 if the value is an int, 1.0 if a float,\nvalue + timedelta(days=14) if a date/datetime, time.max if a time

\n", + "default": "100" + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to min_value.

\n", + "default": "min_value." + }, + { + "name": "step", + "type_name": "int, float, timedelta, or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. This does not impact the return value.\nFormatter for int/float supports: %d %e %f %g %i\nFormatter for date/time/datetime uses Moment.js notation:\nhttps://momentjs.com/docs/#/displaying/format/

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the slider if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int/float/date/time/datetime or tuple of int/float/date/time/datetime", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/slider.py#L171" + }, + "DeltaGenerator.snow": { + "name": "snow", + "signature": "element.snow()", + "example": "
\n
\nimport streamlit as st\n\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", + "description": "

Draw celebratory snowfall.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/snow.py#L25" + }, + "DeltaGenerator.subheader": { + "name": "subheader", + "signature": "element.subheader(body, anchor=None, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.subheader('This is a subheader')\nst.subheader('A subheader with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in subheader formatting.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str or False", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the subheader.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/heading.py#L93" + }, + "DeltaGenerator.success": { + "name": "success", + "signature": "element.success(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", + "description": "

Display a success message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The success text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/alert.py#L136" + }, + "DeltaGenerator.table": { + "name": "table", + "signature": "element.table(data=None)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n
\n", + "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/dataframe_selector.py#L192" + }, + "DeltaGenerator.tabs": { + "name": "tabs", + "signature": "element.tabs(tabs)", + "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\nimport streamlit as st\n\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n
\n", + "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", + "args": [ + { + "name": "tabs", + "type_name": "list of strings", + "is_optional": false, + "description": "

Creates a tab for each string in the list. The first tab is selected by default.\nThe string is used as the name of the tab and can optionally contain Markdown,\nsupporting the following elements: Bold, Italics, Strikethroughs, Inline Code,\nEmojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": "." + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/layouts.py#L203" + }, + "DeltaGenerator.text": { + "name": "text", + "signature": "element.text(body, *, help=None)", + "example": "
\n
\nimport streamlit as st\n\nst.text('This is some text.')\n
\n
\n", + "description": "

Write fixed-width and preformatted text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the text.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/text.py#L27" + }, + "DeltaGenerator.text_area": { + "name": "text_area", + "signature": "element.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", + "description": "

Display a multi-line text input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Maximum number of characters allowed in text area.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the textarea.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_area's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text area is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text area if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/text_widgets.py#L274" + }, + "DeltaGenerator.text_input": { + "name": "text_input", + "signature": "element.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n
\n", + "description": "

Display a single-line text input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Max number of characters allowed in text input.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"default\" or \"password\"", + "is_optional": false, + "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "autocomplete", + "type_name": "str", + "is_optional": false, + "description": "

An optional value that will be passed to the <input> element's\nautocomplete property. If unspecified, this value will be set to\n"new-password" for "password" inputs, and the empty string for\n"default" inputs. For more details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text input is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/text_widgets.py#L71" + }, + "DeltaGenerator.time_input": { + "name": "time_input", + "signature": "element.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", step=0:15:00)", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n
\n", + "description": "

Display a time input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this time input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.time/datetime.datetime", + "is_optional": false, + "description": "

The value of this widget when it first renders. This will be\ncast to str internally. Defaults to the current time.

\n", + "default": "the" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this time_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the time input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False." + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "step", + "type_name": "int or timedelta", + "is_optional": false, + "description": "

The stepping interval in seconds. Defaults to 900, i.e. 15 minutes.\nYou can also pass a datetime.timedelta object.

\n", + "default": "900" + } + ], + "returns": [ + { + "type_name": "datetime.time", + "is_generator": false, + "description": "

The current value of the time input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/time_widgets.py#L213" + }, + "DeltaGenerator.title": { + "name": "title", + "signature": "element.title(body, anchor=None, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.title('This is a title')\nst.title('A title with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str or False", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the title.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/heading.py#L146" + }, + "DeltaGenerator.vega_lite_chart": { + "name": "vega_lite_chart", + "signature": "element.vega_lite_chart(data=None, spec=None, use_container_width=False, theme=\"streamlit\", **kwargs)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(chart_data, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", + "description": "

Display a chart using the Vega-Lite library.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "spec", + "type_name": "dict or None", + "is_optional": false, + "description": "

The Vega-Lite spec for the chart. If the spec was already passed in\nthe previous argument, this must be set to None. See\nhttps://vega.github.io/vega-lite/docs/ for more info.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Same as spec, but as keywords.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/dataframe_selector.py#L545" + }, + "DeltaGenerator.video": { + "name": "video", + "signature": "element.video(data, format=\"video/mp4\", start_time=0)", + "example": "
\n
\nimport streamlit as st\n\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", + "description": "

Display a video player.

\n", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file opened with", + "is_optional": false, + "description": "

io.open().\nRaw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "default": null + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the video file. Defaults to 'video/mp4'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/media.py#L116" + }, + "DeltaGenerator.warning": { + "name": "warning", + "signature": "element.warning(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", + "description": "

Display warning message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The warning text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/alert.py#L71" + }, + "DeltaGenerator.write": { + "name": "write", + "signature": "element.write(*args, unsafe_allow_html=False, **kwargs)", + "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nimport streamlit as st\n\nst.write('Hello, *World!* :sunglasses:')\n
\n\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nimport streamlit as st\nimport pandas as pd\n\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nimport streamlit as st\n\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n
\n", + "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression, emoji shortcodes, and colored text.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(class) : Displays information about a class.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": "False." + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.24.0/lib/streamlit/elements/write.py#L49" + } + }, + "1.25.0": { + "streamlit.altair_chart": { + "name": "altair_chart", + "signature": "st.altair_chart(altair_chart, use_container_width=False, theme=\"streamlit\")", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(chart_data).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n
\n", + "description": "

Display a chart using the Altair library.

\n", + "args": [ + { + "name": "altair_chart", + "type_name": "altair.Chart", + "is_optional": false, + "description": "

The Altair chart object to display.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Altair's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/dataframe_selector.py#L492" + }, + "streamlit.area_chart": { + "name": "area_chart", + "signature": "st.area_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n
\n", + "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/dataframe_selector.py#L317" + }, + "streamlit.audio": { + "name": "audio", + "signature": "st.audio(data, format=\"audio/wav\", start_time=0, *, sample_rate=None)", + "example": "
\n
\nimport streamlit as st\nimport numpy as np\n\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n\nsample_rate = 44100  # 44100 samples per second\nseconds = 2  # Note duration of 2 seconds\nfrequency_la = 440  # Our played note will be 440 Hz\n# Generate array with seconds*sample_rate steps, ranging between 0 and seconds\nt = np.linspace(0, seconds, seconds * sample_rate, False)\n# Generate a 440 Hz sine wave\nnote_la = np.sin(frequency_la * t * 2 * np.pi)\n\nst.audio(note_la, sample_rate=sample_rate)\n
\n\n \n
\n", + "description": "

Display an audio player.

\n", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file", + "is_optional": false, + "description": "

Raw audio data, filename, or a URL pointing to the file to load.\nRaw data formats must include all necessary file headers to match the file\nformat specified via format.\nIf data is a numpy array, it must either be a 1D array of the waveform\nor a 2D array of shape (num_channels, num_samples) with waveforms\nfor all channels. See the default channel order at\nhttp://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx

\n", + "default": "channel" + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + }, + { + "name": "sample_rate", + "type_name": "int or None", + "is_optional": false, + "description": "

The sample rate of the audio data in samples per second. Only required if\ndata is a numpy array.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/media.py#L42" + }, + "streamlit.balloons": { + "name": "balloons", + "signature": "st.balloons()", + "example": "
\n
\nimport streamlit as st\n\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", + "description": "

Draw celebratory balloons.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/balloons.py#L25" + }, + "streamlit.bar_chart": { + "name": "bar_chart", + "signature": "st.bar_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n
\n", + "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, or dict", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/dataframe_selector.py#L404" + }, + "streamlit.bokeh_chart": { + "name": "bokeh_chart", + "signature": "st.bokeh_chart(figure, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n
\n", + "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", + "args": [ + { + "name": "figure", + "type_name": "bokeh.plotting.figure.Figure", + "is_optional": false, + "description": "

A Bokeh figure to plot.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Bokeh's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/bokeh_chart.py#L36" + }, + "streamlit.button": { + "name": "button", + "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\n\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n
\n", + "description": "

Display a button widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/button.py#L61" + }, + "streamlit.cache": { + "name": "cache", + "signature": "st.cache(func=None, persist=False, allow_output_mutation=False, show_spinner=True, suppress_st_warning=False, hash_funcs=None, max_entries=None, ttl=None)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\n@st.cache(persist=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To disable hashing return values, set the allow_output_mutation parameter to True:

\n
\n@st.cache(allow_output_mutation=True)\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. MongoClient) to a hash function (id) like this:

\n
\n@st.cache(hash_funcs={MongoClient: id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "pymongo.mongo_client.MongoClient") to the hash function instead:

\n
\n@st.cache(hash_funcs={"pymongo.mongo_client.MongoClient": id})\ndef connect_to_database(url):\n    return MongoClient(url)\n
\n
\n", + "description": "

Function decorator to memoize function executions.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to cache. Streamlit hashes the function and dependent code.

\n", + "default": null + }, + { + "name": "persist", + "type_name": "boolean", + "is_optional": false, + "description": "

Whether to persist the cache on disk.

\n", + "default": null + }, + { + "name": "allow_output_mutation", + "type_name": "boolean", + "is_optional": false, + "description": "

Streamlit shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.

\n

If you know what you're doing and would like to override this warning, set this to True.

\n", + "default": null + }, + { + "name": "show_spinner", + "type_name": "boolean", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na cache miss.

\n", + "default": "True" + }, + { + "name": "suppress_st_warning", + "type_name": "boolean", + "is_optional": false, + "description": "

Suppress warnings about calling Streamlit commands from within\nthe cached function.

\n", + "default": null + }, + { + "name": "hash_funcs", + "type_name": "dict or None", + "is_optional": false, + "description": "

Mapping of types or fully qualified names to hash functions. This is used to override\nthe behavior of the hasher inside Streamlit's caching mechanism: when the hasher\nencounters an object, it will first check to see if its type matches a key in this\ndict and, if so, will use the provided function to generate a hash for it. See below\nfor an example of how this can be used.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None" + }, + { + "name": "ttl", + "type_name": "float or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep an entry in the cache, or\nNone if cache entries should not expire. The default is None.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/runtime/legacy_caching/caching.py#L486" + }, + "streamlit.cache_data": { + "name": "cache_data", + "signature": "st.cache_data(func=None, *, ttl, max_entries, show_spinner, persist, experimental_allow_widgets, hash_funcs=None)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\nimport streamlit as st\n\n@st.cache_data(persist="disk")\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

By default, all parameters to a cached function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nconnection = make_database_connection()\nd1 = fetch_and_clean_data(connection, num_rows=10)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nanother_connection = make_database_connection()\nd2 = fetch_and_clean_data(another_connection, num_rows=10)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _database_connection parameter was different\n# in both calls.\n
\n

A cached function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nfetch_and_clean_data.clear()\n# Clear all cached entries for this function.\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. datetime.datetime) to a hash\nfunction (lambda dt: dt.isoformat()) like this:

\n
\nimport streamlit as st\nimport datetime\n\n@st.cache_data(hash_funcs={datetime.datetime: lambda dt: dt.isoformat()})\ndef convert_to_utc(dt: datetime.datetime):\n    return dt.astimezone(datetime.timezone.utc)\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "datetime.datetime") to the hash function instead:

\n
\nimport streamlit as st\nimport datetime\n\n@st.cache_data(hash_funcs={"datetime.datetime": lambda dt: dt.isoformat()})\ndef convert_to_utc(dt: datetime.datetime):\n    return dt.astimezone(datetime.timezone.utc)\n
\n
\n", + "description": "

Decorator to cache functions that return data (e.g. dataframe transforms, database queries, ML inference).

\n

Cached objects are stored in "pickled" form, which means that the return\nvalue of a cached function must be pickleable. Each caller of the cached\nfunction gets its own copy of the cached data.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_data.clear().

\n

To cache global resources, use st.cache_resource instead. Learn more\nabout caching at https://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to cache. Streamlit hashes the function's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float, timedelta, str, or None", + "is_optional": false, + "description": "

The maximum time to keep an entry in the cache. Can be one of:

\n\n

Note that ttl will be ignored if persist="disk" or persist=True.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. When a new entry is added to a full cache,\nthe oldest cached entry will be removed. Defaults to None.

\n", + "default": "None" + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached data is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "persist", + "type_name": "\"disk\", boolean, or None", + "is_optional": false, + "description": "

Optional location to persist cached data to. Passing "disk" (or True)\nwill persist the cached data to the local disk. None (or False) will disable\npersistence. The default is None.

\n", + "default": "None" + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False" + }, + { + "name": "hash_funcs", + "type_name": "dict or None", + "is_optional": false, + "description": "

Mapping of types or fully qualified names to hash functions.\nThis is used to override the behavior of the hasher inside Streamlit's\ncaching mechanism: when the hasher encounters an object, it will first\ncheck to see if its type matches a key in this dict and, if so, will use\nthe provided function to generate a hash for it. See below for an example\nof how this can be used.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/runtime/caching/cache_data_api.py#L384" + }, + "streamlit.cache_resource": { + "name": "cache_resource", + "signature": "st.cache_resource(func, *, ttl, max_entries, show_spinner, validate, experimental_allow_widgets, hash_funcs=None)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(url):\n    # Create a database session object that points to the URL.\n    return session\n\ns1 = get_database_session(SESSION_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(SESSION_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the connection object in s1 is the same as in s2.\n\ns3 = get_database_session(SESSION_URL_2)\n# This is a different URL, so the function executes.\n
\n

By default, all parameters to a cache_resource function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\ns1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _sessionmaker parameter was different\n# in both calls.\n
\n

A cache_resource function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\nget_database_session.clear()\n# Clear all cached entries for this function.\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. Person) to a hash\nfunction (str) like this:

\n
\nimport streamlit as st\nfrom pydantic import BaseModel\n\nclass Person(BaseModel):\n    name: str\n\n@st.cache_resource(hash_funcs={Person: str})\ndef get_person_name(person: Person):\n    return person.name\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "__main__.Person") to the hash function instead:

\n
\nimport streamlit as st\nfrom pydantic import BaseModel\n\nclass Person(BaseModel):\n    name: str\n\n@st.cache_resource(hash_funcs={"__main__.Person": str})\ndef get_person_name(person: Person):\n    return person.name\n
\n
\n", + "description": "

Decorator to cache functions that return global resources (e.g. database connections, ML models).

\n

Cached objects are shared across all users, sessions, and reruns. They\nmust be thread-safe because they can be accessed from multiple threads\nconcurrently. If thread safety is an issue, consider using st.session_state\nto store resources per session instead.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_resource.clear().

\n

To cache data, use st.cache_data instead. Learn more about caching at\nhttps://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function that creates the cached resource. Streamlit hashes the\nfunction's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float, timedelta, str, or None", + "is_optional": false, + "description": "

The maximum time to keep an entry in the cache. Can be one of:

\n\n

Note that ttl will be ignored if persist="disk" or persist=True.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. When a new entry is added to a full cache,\nthe oldest cached entry will be removed. Defaults to None.

\n", + "default": "None" + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached resource is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "validate", + "type_name": "callable or None", + "is_optional": false, + "description": "

An optional validation function for cached data. validate is called\neach time the cached value is accessed. It receives the cached value as\nits only parameter and it must return a boolean. If validate returns\nFalse, the current cached value is discarded, and the decorated function\nis called to compute a new value. This is useful e.g. to check the\nhealth of database connections.

\n", + "default": null + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False" + }, + { + "name": "hash_funcs", + "type_name": "dict or None", + "is_optional": false, + "description": "

Mapping of types or fully qualified names to hash functions.\nThis is used to override the behavior of the hasher inside Streamlit's\ncaching mechanism: when the hasher encounters an object, it will first\ncheck to see if its type matches a key in this dict and, if so, will use\nthe provided function to generate a hash for it. See below for an example\nof how this can be used.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/runtime/caching/cache_resource_api.py#L264" + }, + "streamlit.camera_input": { + "name": "camera_input", + "signature": "st.camera_input(label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", + "description": "

Display a widget that returns pictures from the user's webcam.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this widget is used for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the camera input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this camera_input's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the camera input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile", + "is_generator": false, + "description": "

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/camera_input.py#L109" + }, + "streamlit.caption": { + "name": "caption", + "signature": "st.caption(body, unsafe_allow_html=False, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.caption('This is a string that explains something above.')\nst.caption('A caption with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the caption.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/markdown.py#L132" + }, + "streamlit.chat_input": { + "name": "chat_input", + "signature": "st.chat_input(placeholder=\"Your message\", *, key=None, max_chars=None, disabled=False, on_submit=None, args=None, kwargs=None)", + "examples": "
\n
\nimport streamlit as st\n\nprompt = st.chat_input("Say something")\nif prompt:\n    st.write(f"User has sent the following prompt: {prompt}")\n
\n\n \n
\n", + "description": "

Display a chat input widget.

\n
\n

Warning

\n

Chat input can only be used once per app page and inside the main area of the app.\nIt cannot be used in the sidebar, columns, expanders, forms or tabs.\nWe plan to support this in the future.

\n
\n", + "args": [ + { + "name": "placeholder", + "type_name": "str", + "is_optional": false, + "description": "

A placeholder text shown when the chat input is empty. Defaults to\n"Your message". For accessibility reasons, you should not use an\nempty string.

\n", + "default": "s" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget based on\nits content. Multiple widgets of the same type may not share the same key.

\n", + "default": null + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of characters that can be entered. If None\n(default), there will be no maximum.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

Whether the chat input should be disabled. Defaults to False.

\n", + "default": "False" + }, + { + "name": "on_submit", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when the chat input's value is submitted.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "str or None", + "is_generator": false, + "description": "

The current (non-empty) value of the text input widget on the last\nrun of the app, None otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/chat.py#L208" + }, + "streamlit.chat_message": { + "name": "chat_message", + "signature": "st.chat_message(name, *, avatar=None)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\nimport numpy as np\n\nwith st.chat_message("user"):\n    st.write("Hello \ud83d\udc4b")\n    st.line_chart(np.random.randn(30, 3))\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\nmessage = st.chat_message("assistant")\nmessage.write("Hello human")\nmessage.bar_chart(np.random.randn(30, 3))\n
\n\n \n
\n", + "description": "

Insert a chat message container.

\n

To add elements to the returned container, you can use with notation\n(preferred) or just call methods directly on the returned object. See the\nexamples below.

\n", + "args": [ + { + "name": "name", + "type_name": "\"user\", \"assistant\", or str", + "is_optional": false, + "description": "

The name of the message author. Can be \u201cuser\u201d or \u201cassistant\u201d to\nenable preset styling and avatars.

\n

Currently, the name is not shown in the UI but is only set as an\naccessibility label. For accessibility reasons, you should not use\nan empty string.

\n", + "default": null + }, + { + "name": "avatar", + "type_name": "str, numpy.ndarray, or BytesIO", + "is_optional": false, + "description": "

The avatar shown next to the message. Can be one of:

\n
    \n
  • A single emoji, e.g. "\ud83e\uddd1\u200d\ud83d\udcbb", "\ud83e\udd16", "\ud83e\udd96". Shortcodes are not supported.
  • \n
  • \n
    An image using one of the formats allowed for st.image: path of a local
    \n
    image file; URL to fetch the image from; array of shape (w,h) or (w,h,1)\nfor a monochrome image, (w,h,3) for a color image, or (w,h,4) for an RGBA image.
    \n
    \n
  • \n
\n

If None (default), uses default icons if name is "user" or\n"assistant", or the first letter of the name value.

\n", + "default": "icons" + } + ], + "returns": [ + { + "type_name": "Container", + "is_generator": false, + "description": "

A single container that can hold multiple elements.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/chat.py#L112" + }, + "streamlit.checkbox": { + "name": "checkbox", + "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n
\n", + "description": "

Display a checkbox widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this checkbox is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "value", + "type_name": "bool", + "is_optional": false, + "description": "

Preselect the checkbox when it first renders. This will be\ncast to bool internally.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the checkbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this checkbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the checkbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

Whether or not the checkbox is checked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/checkbox.py#L52" + }, + "streamlit.code": { + "name": "code", + "signature": "st.code(body, language=\"python\", line_numbers=False)", + "example": "
\n
\nimport streamlit as st\n\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", + "description": "

Display a code block with optional syntax highlighting.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as code.

\n", + "default": null + }, + { + "name": "language", + "type_name": "str or None", + "is_optional": false, + "description": "

The language that the code is written in, for syntax highlighting.\nIf None, the code will be unstyled. Defaults to "python".

\n

For a list of available language values, see:

\n

https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

\n", + "default": "s" + }, + { + "name": "line_numbers", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean indicating whether to show line numbers to the\nleft of the code block. Defaults to False.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/code.py#L27" + }, + "streamlit.color_picker": { + "name": "color_picker", + "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n
\n", + "description": "

Display a color picker widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "str", + "is_optional": false, + "description": "

The hex value of this widget when it first renders. If None,\ndefaults to black.

\n", + "default": "black" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the color picker.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this color_picker's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the color picker if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn\u2019t show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The selected color as a hex string.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/color_picker.py#L52" + }, + "streamlit.columns": { + "name": "columns", + "signature": "st.columns(spec, *, gap=\"small\")", + "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n
\n", + "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", + "args": [ + { + "name": "spec", + "type_name": "int or iterable of numbers", + "is_optional": false, + "description": "

Controls the number and width of columns to insert. Can be one of:

\n
    \n
  • An integer that specifies the number of columns. All columns have equal\nwidth in this case.
  • \n
  • An iterable of numbers (int or float) that specify the relative width of\neach column. E.g. [0.7, 0.3] creates two columns where the first\none takes up 70% of the available with and the second one takes up 30%.\nOr [1, 2, 3] creates three columns where the second one is two times\nthe width of the first one, and the third one is three times that width.
  • \n
\n", + "default": null + }, + { + "name": "gap", + "type_name": "\"small\", \"medium\", or \"large\"", + "is_optional": false, + "description": "

The size of the gap between the columns. Defaults to "small". This\nargument can only be supplied by keyword.

\n", + "default": "s" + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/layouts.py#L75" + }, + "streamlit.container": { + "name": "container", + "signature": "st.container()", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n
\n", + "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/layouts.py#L27" + }, + "streamlit.data_editor": { + "name": "data_editor", + "signature": "st.data_editor(data, *, width=None, height=None, use_container_width=False, hide_index=None, column_order=None, column_config=None, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

Or you can customize the data editor via column_config, hide_index, column_order, or disabled:

\n
\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    [\n        {"command": "st.selectbox", "rating": 4, "is_widget": True},\n        {"command": "st.balloons", "rating": 5, "is_widget": False},\n        {"command": "st.time_input", "rating": 3, "is_widget": True},\n    ]\n)\nedited_df = st.data_editor(\n    df,\n    column_config={\n        "command": "Streamlit Command",\n        "rating": st.column_config.NumberColumn(\n            "Your rating",\n            help="How much do you like this command (1-5)?",\n            min_value=1,\n            max_value=5,\n            step=1,\n            format="%d \u2b50",\n        ),\n        "is_widget": "Widget ?",\n    },\n    disabled=["command", "is_widget"],\n    hide_index=True,\n)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n
\n", + "description": "

Display a data editor widget.

\n

The data editor widget allows you to edit dataframes and many other data structures in a table-like UI.

\n
\n

Warning

\n

When going from st.experimental_data_editor to st.data_editor in\n1.23.0, the data editor's representation in st.session_state was changed.\nThe edited_cells dictionary is now called edited_rows and uses a\ndifferent format ({0: {"column name": "edited value"}} instead of\n{"0:1": "edited value"}). You may need to adjust the code if your app uses\nst.experimental_data_editor in combination with st.session_state."

\n
\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None", + "is_optional": false, + "description": "

The data to edit in the data editor.

\n
\n

Note

\n
    \n
  • Styles from pandas.Styler will only be applied to non-editable columns.
  • \n
  • Mixing data types within a column can make the column uneditable.
  • \n
  • Additionally, the following data types are not yet supported for editing:\ncomplex, list, tuple, bytes, bytearray, memoryview, dict, set, frozenset,\ndatetime.timedelta, decimal.Decimal, fractions.Fraction, pandas.Interval,\npandas.Period, pandas.Timedelta.
  • \n
\n
\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the data editor expressed in pixels. If None, the width will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the data editor expressed in pixels. If None, the height will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the data editor width to the width of the parent container.\nThis takes precedence over the width argument. Defaults to False.

\n", + "default": "False" + }, + { + "name": "hide_index", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether to hide the index column(s). If None (default), the visibility of\nindex columns is automatically determined based on the data.

\n", + "default": null + }, + { + "name": "column_order", + "type_name": "iterable of str or None", + "is_optional": false, + "description": "

Specifies the display order of columns. This also affects which columns are\nvisible. For example, column_order=("col2", "col1") will display 'col2'\nfirst, followed by 'col1', and will hide all other non-index columns. If\nNone (default), the order is inherited from the original data structure.

\n", + "default": null + }, + { + "name": "column_config", + "type_name": "dict or None", + "is_optional": false, + "description": "

Configures how columns are displayed, e.g. their title, visibility, type, or\nformat, as well as editing properties such as min/max value or step.\nThis needs to be a dictionary where each key is a column name and the value\nis one of:

\n
    \n
  • None to hide the column.
  • \n
  • A string to set the display label of the column.
  • \n
  • One of the column types defined under st.column_config, e.g.\nst.column_config.NumberColumn("Dollar values\u201d, format=\u201d$ %d") to show\na column as dollar amounts. See more info on the available column types\nand config options here.
  • \n
\n

To configure the index column(s), use _index as the column name.

\n", + "default": null + }, + { + "name": "num_rows", + "type_name": "\"fixed\" or \"dynamic\"", + "is_optional": false, + "description": "

Specifies if the user can add and delete rows in the data editor.\nIf "fixed", the user cannot add or delete rows. If "dynamic", the user can\nadd and delete rows in the data editor, but column sorting is disabled.\nDefaults to "fixed".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool or iterable of str", + "is_optional": false, + "description": "

Controls the editing of columns. If True, editing is disabled for all columns.\nIf an iterable of column names is provided (e.g., disabled=("col1", "col2")),\nonly the specified columns will be disabled for editing. If False (default),\nall columns that support editing are editable.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the unique key for this widget. If this\nis omitted, a key will be generated for the widget based on its\ncontent. Multiple widgets of the same type may not share the same\nkey.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this data_editor's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "pandas.DataFrame, pandas.Series, pyarrow.Table, numpy.ndarray, list, set, tuple, or dict.", + "is_generator": false, + "description": "

The edited data. The edited data is returned in its original data type if\nit corresponds to any of the supported return types. All other data types\nare returned as a pd.DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/data_editor.py#L528" + }, + "streamlit.dataframe": { + "name": "dataframe", + "signature": "st.dataframe(data=None, width=None, height=None, *, use_container_width=False, hide_index=None, column_order=None, column_config=None)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n

Or you can customize the dataframe via column_config, hide_index, or column_order:

\n
\nimport random\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    {\n        "name": ["Roadmap", "Extras", "Issues"],\n        "url": ["https://roadmap.streamlit.app", "https://extras.streamlit.app", "https://issues.streamlit.app"],\n        "stars": [random.randint(0, 1000) for _ in range(3)],\n        "views_history": [[random.randint(0, 5000) for _ in range(30)] for _ in range(3)],\n    }\n)\nst.dataframe(\n    df,\n    column_config={\n        "name": "App name",\n        "stars": st.column_config.NumberColumn(\n            "Github Stars",\n            help="Number of stars on GitHub",\n            format="%d \u2b50",\n        ),\n        "url": st.column_config.LinkColumn("App URL"),\n        "views_history": st.column_config.LineChartColumn(\n            "Views (past 30 days)", y_min=0, y_max=5000\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Display a dataframe as an interactive table.

\n

This command works with dataframes from Pandas, PyArrow, Snowpark, and PySpark.\nIt can also display several other types that can be converted to dataframes,\ne.g. numpy arrays, lists, sets and dictionaries.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to display.

\n

If 'data' is a pandas.Styler, it will be used to style its\nunderlying DataFrame. Streamlit supports custom cell\nvalues and colors. It does not support some of the more exotic\npandas styling features, like bar charts, hovering, and captions.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the dataframe expressed in pixels. If None, the width\nwill be automatically calculated based on the column content.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the dataframe expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the dataframe width to the width of the parent container.\nThis takes precedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "hide_index", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether to hide the index column(s). If None (default), the visibility of\nindex columns is automatically determined based on the data.

\n", + "default": null + }, + { + "name": "column_order", + "type_name": "iterable of str or None", + "is_optional": false, + "description": "

Specifies the display order of columns. This also affects which columns are\nvisible. For example, column_order=("col2", "col1") will display 'col2'\nfirst, followed by 'col1', and will hide all other non-index columns. If\nNone (default), the order is inherited from the original data structure.

\n", + "default": null + }, + { + "name": "column_config", + "type_name": "dict or None", + "is_optional": false, + "description": "

Configures how columns are displayed, e.g. their title, visibility, type, or\nformat. This needs to be a dictionary where each key is a column name and\nthe value is one of:

\n
    \n
  • None to hide the column.
  • \n
  • A string to set the display label of the column.
  • \n
  • One of the column types defined under st.column_config, e.g.\nst.column_config.NumberColumn("Dollar values\u201d, format=\u201d$ %d") to show\na column as dollar amounts. See more info on the available column types\nand config options here.
  • \n
\n

To configure the index column(s), use _index as the column name.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/dataframe_selector.py#L43" + }, + "streamlit.date_input": { + "name": "date_input", + "signature": "st.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, format=\"YYYY/MM/DD\", disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport datetime\nimport streamlit as st\n\nd = st.date_input("When's your birthday", datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n
\nimport datetime\nimport streamlit as st\n\ntoday = datetime.datetime.now()\nnext_year = today.year + 1\njan_1 = datetime.date(next_year, 1, 1)\ndec_31 = datetime.date(next_year, 12, 31)\n\nd = st.date_input(\n    "Select your vacation for next year",\n    (jan_1, datetime.date(next_year, 1, 7)),\n    jan_1,\n    dec_31,\n    format="MM.DD.YYYY",\n)\nd\n
\n\n \n
\n", + "description": "

Display a date input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this date input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None", + "is_optional": false, + "description": "

The value of this widget when it first renders. If a list/tuple with\n0 to 2 date/datetime values is provided, the datepicker will allow\nusers to provide a range. Defaults to today as a single-date picker.

\n", + "default": "today" + }, + { + "name": "min_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The minimum selectable date. If value is a date, defaults to value - 10 years.\nIf value is the interval [start, end], defaults to start - 10 years.

\n", + "default": "value" + }, + { + "name": "max_value", + "type_name": "datetime.date or datetime.datetime", + "is_optional": false, + "description": "

The maximum selectable date. If value is a date, defaults to value + 10 years.\nIf value is the interval [start, end], defaults to end + 10 years.

\n", + "default": "value" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this date_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

A format string controlling how the interface should display dates.\nSupports \u201cYYYY/MM/DD\u201d (default), \u201cDD/MM/YYYY\u201d, or \u201cMM/DD/YYYY\u201d.\nYou may also use a period (.) or hyphen (-) as separators.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the date input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "datetime.date or a tuple with 0-2 dates", + "is_generator": false, + "description": "

The current value of the date input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/time_widgets.py#L402" + }, + "streamlit.divider": { + "name": "divider", + "signature": "st.divider()", + "example": "
\n
\nimport streamlit as st\n\nst.divider()\n
\n
\n", + "description": "

Display a horizontal rule.

\n
\n

Note

\n

You can achieve the same effect with st.write("---") or\neven just "---" in your script (via magic).

\n
\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/markdown.py#L244" + }, + "streamlit.download_button": { + "name": "download_button", + "signature": "st.download_button(label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False, use_container_width=False)", + "examples": "
\n

Download a large DataFrame as a CSV:

\n
\nimport streamlit as st\n\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\nimport streamlit as st\n\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nimport streamlit as st\n\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nimport streamlit as st\n\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n
\n", + "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "data", + "type_name": "str or bytes or file", + "is_optional": false, + "description": "

The contents of the file to be downloaded. See example below for\ncaching techniques to avoid recomputing this data unnecessarily.

\n", + "default": null + }, + { + "name": "file_name", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the name of the file to be downloaded,\nsuch as 'my_file.csv'. If not specified, the name will be\nautomatically generated.

\n", + "default": null + }, + { + "name": "mime", + "type_name": "str or None", + "is_optional": false, + "description": "

The MIME type of the data. If None, defaults to "text/plain"\n(if data is of type str or is a textual file) or\n"application/octet-stream" (if data is of type bytes or is a\nbinary file).

\n", + "default": "s" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when the button is\nhovered over.

\n", + "default": null + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the download button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked on the last run of the app,\nFalse otherwise.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/button.py#L169" + }, + "streamlit.echo": { + "name": "echo", + "signature": "st.echo(code_location=\"above\")", + "example": "
\n
\nimport streamlit as st\n\nwith st.echo():\n    st.write('This code will be printed')\n
\n
\n", + "description": "

Use in a with block to draw some code on the app, then execute it.

\n", + "args": [ + { + "name": "code_location", + "type_name": "\"above\" or \"below\"", + "is_optional": false, + "description": "

Whether to show the echoed code before or after the results of the\nexecuted code block.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/echo.py#L28" + }, + "streamlit.empty": { + "name": "empty", + "signature": "st.empty()", + "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport streamlit as st\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nimport streamlit as st\n\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", + "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/empty.py#L24" + }, + "streamlit.error": { + "name": "error", + "signature": "st.error(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", + "description": "

Display error message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The error text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/alert.py#L27" + }, + "streamlit.exception": { + "name": "exception", + "signature": "st.exception(exception)", + "example": "
\n
\nimport streamlit as st\n\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", + "description": "

Display an exception.

\n", + "args": [ + { + "name": "exception", + "type_name": "Exception", + "is_optional": false, + "description": "

The exception to display.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/exception.py#L50" + }, + "streamlit.expander": { + "name": "expander", + "signature": "st.expander(label, expanded=False)", + "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n
\n", + "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

If True, initializes the expander in "expanded" state. Defaults to\nFalse (collapsed).

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/layouts.py#L315" + }, + "streamlit.experimental_connection": { + "name": "experimental_connection", + "signature": "st.experimental_connection(name, type=None, max_entries=None, ttl=None, **kwargs)", + "examples": "
\n

The easiest way to create a first-party (SQL or Snowpark) connection is to use their\ndefault names and define corresponding sections in your secrets.toml file.

\n
\nimport streamlit as st\nconn = st.experimental_connection("sql") # Config section defined in [connections.sql] in secrets.toml.\n
\n

Creating a SQLConnection with a custom name requires you to explicitly specify the\ntype. If type is not passed as a kwarg, it must be set in the appropriate section of\nsecrets.toml.

\n
\nimport streamlit as st\nconn1 = st.experimental_connection("my_sql_connection", type="sql") # Config section defined in [connections.my_sql_connection].\nconn2 = st.experimental_connection("my_other_sql_connection") # type must be set in [connections.my_other_sql_connection].\n
\n

Passing the full module path to the connection class that you want to use can be\nuseful, especially when working with a custom connection:

\n
\nimport streamlit as st\nconn = st.experimental_connection("my_sql_connection", type="streamlit.connections.SQLConnection")\n
\n

Finally, you can pass the connection class to use directly to this function. Doing\nso allows static type checking tools such as mypy to infer the exact return\ntype of st.experimental_connection.

\n
\nimport streamlit as st\nfrom streamlit.connections import SQLConnection\nconn = st.experimental_connection("my_sql_connection", type=SQLConnection)\n
\n
\n", + "description": "

Create a new connection to a data store or API, or return an existing one.

\n

Config options, credentials, secrets, etc. for connections are taken from various\nsources:

\n
    \n
  • Any connection-specific configuration files.
  • \n
  • An app's secrets.toml files.
  • \n
  • The kwargs passed to this function.
  • \n
\n", + "args": [ + { + "name": "name", + "type_name": "str", + "is_optional": false, + "description": "

The connection name used for secrets lookup in [connections.<name>].\nType will be inferred from passing "sql" or "snowpark".

\n", + "default": null + }, + { + "name": "type", + "type_name": "str, connection class, or None", + "is_optional": false, + "description": "

The type of connection to create. It can be a keyword ("sql" or "snowpark"),\na path to an importable class, or an imported class reference. All classes\nmust extend st.connections.ExperimentalBaseConnection and implement the\n_connect() method. If the type kwarg is None, a type field must be set\nin the connection's section in secrets.toml.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of connections to keep in the cache, or None\nfor an unbounded cache. (When a new entry is added to a full cache,\nthe oldest cached entry will be removed.) The default is None.

\n", + "default": "None" + }, + { + "name": "ttl", + "type_name": "float, timedelta, or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep results in the cache, or\nNone if cached results should not expire. The default is None.

\n", + "default": "None" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Additional connection specific kwargs that are passed to the Connection's\n_connect() method. Learn more from the specific Connection's documentation.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "Connection object", + "is_generator": false, + "description": "

An initialized Connection object of the specified type.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/runtime/connection_factory.py#L170" + }, + "streamlit.experimental_data_editor": { + "name": "experimental_data_editor", + "signature": "st.experimental_data_editor(data, *, width=None, height=None, use_container_width=False, hide_index=None, column_order=None, column_config=None, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

Or you can customize the data editor via column_config, hide_index, column_order, or disabled:

\n
\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    [\n        {"command": "st.selectbox", "rating": 4, "is_widget": True},\n        {"command": "st.balloons", "rating": 5, "is_widget": False},\n        {"command": "st.time_input", "rating": 3, "is_widget": True},\n    ]\n)\nedited_df = st.data_editor(\n    df,\n    column_config={\n        "command": "Streamlit Command",\n        "rating": st.column_config.NumberColumn(\n            "Your rating",\n            help="How much do you like this command (1-5)?",\n            min_value=1,\n            max_value=5,\n            step=1,\n            format="%d \u2b50",\n        ),\n        "is_widget": "Widget ?",\n    },\n    disabled=["command", "is_widget"],\n    hide_index=True,\n)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n
\n", + "description": "

Display a data editor widget.

\n

The data editor widget allows you to edit dataframes and many other data structures in a table-like UI.

\n
\n

Warning

\n

When going from st.experimental_data_editor to st.data_editor in\n1.23.0, the data editor's representation in st.session_state was changed.\nThe edited_cells dictionary is now called edited_rows and uses a\ndifferent format ({0: {"column name": "edited value"}} instead of\n{"0:1": "edited value"}). You may need to adjust the code if your app uses\nst.experimental_data_editor in combination with st.session_state."

\n
\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None", + "is_optional": false, + "description": "

The data to edit in the data editor.

\n
\n

Note

\n
    \n
  • Styles from pandas.Styler will only be applied to non-editable columns.
  • \n
  • Mixing data types within a column can make the column uneditable.
  • \n
  • Additionally, the following data types are not yet supported for editing:\ncomplex, list, tuple, bytes, bytearray, memoryview, dict, set, frozenset,\ndatetime.timedelta, decimal.Decimal, fractions.Fraction, pandas.Interval,\npandas.Period, pandas.Timedelta.
  • \n
\n
\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired width of the data editor expressed in pixels. If None, the width will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the data editor expressed in pixels. If None, the height will\nbe automatically determined.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the data editor width to the width of the parent container.\nThis takes precedence over the width argument. Defaults to False.

\n", + "default": "False" + }, + { + "name": "hide_index", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether to hide the index column(s). If None (default), the visibility of\nindex columns is automatically determined based on the data.

\n", + "default": null + }, + { + "name": "column_order", + "type_name": "iterable of str or None", + "is_optional": false, + "description": "

Specifies the display order of columns. This also affects which columns are\nvisible. For example, column_order=("col2", "col1") will display 'col2'\nfirst, followed by 'col1', and will hide all other non-index columns. If\nNone (default), the order is inherited from the original data structure.

\n", + "default": null + }, + { + "name": "column_config", + "type_name": "dict or None", + "is_optional": false, + "description": "

Configures how columns are displayed, e.g. their title, visibility, type, or\nformat, as well as editing properties such as min/max value or step.\nThis needs to be a dictionary where each key is a column name and the value\nis one of:

\n
    \n
  • None to hide the column.
  • \n
  • A string to set the display label of the column.
  • \n
  • One of the column types defined under st.column_config, e.g.\nst.column_config.NumberColumn("Dollar values\u201d, format=\u201d$ %d") to show\na column as dollar amounts. See more info on the available column types\nand config options here.
  • \n
\n

To configure the index column(s), use _index as the column name.

\n", + "default": null + }, + { + "name": "num_rows", + "type_name": "\"fixed\" or \"dynamic\"", + "is_optional": false, + "description": "

Specifies if the user can add and delete rows in the data editor.\nIf "fixed", the user cannot add or delete rows. If "dynamic", the user can\nadd and delete rows in the data editor, but column sorting is disabled.\nDefaults to "fixed".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool or iterable of str", + "is_optional": false, + "description": "

Controls the editing of columns. If True, editing is disabled for all columns.\nIf an iterable of column names is provided (e.g., disabled=("col1", "col2")),\nonly the specified columns will be disabled for editing. If False (default),\nall columns that support editing are editable.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

An optional string to use as the unique key for this widget. If this\nis omitted, a key will be generated for the widget based on its\ncontent. Multiple widgets of the same type may not share the same\nkey.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this data_editor's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "pandas.DataFrame, pandas.Series, pyarrow.Table, numpy.ndarray, list, set, tuple, or dict.", + "is_generator": false, + "description": "

The edited data. The edited data is returned in its original data type if\nit corresponds to any of the supported return types. All other data types\nare returned as a pd.DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/data_editor.py#L528" + }, + "streamlit.experimental_get_query_params": { + "name": "experimental_get_query_params", + "signature": "st.experimental_get_query_params()", + "example": "
\n

Let's say the user's web browser is at\nhttp://localhost:8501/?show_map=True&selected=asia&selected=america.\nThen, you can get the query parameters using the following:

\n
\nimport streamlit as st\n\nst.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\n

Note that the values in the returned dict are always lists. This is\nbecause we internally use Python's urllib.parse.parse_qs(), which behaves\nthis way. And this behavior makes sense when you consider that every item\nin a query string is potentially a 1-element array.

\n
\n", + "description": "

Return the query parameters that is currently showing in the browser's URL bar.

\n", + "args": [], + "returns": [ + { + "type_name": "dict", + "is_generator": false, + "description": "

The current query parameters as a dict. "Query parameters" are the part of the URL that comes\nafter the first "?".

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/commands/query_params.py#L29" + }, + "streamlit.experimental_memo": { + "name": "experimental_memo", + "signature": "st.experimental_memo(func=None, *, ttl, max_entries, show_spinner, persist, experimental_allow_widgets, hash_funcs=None)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n\nd1 = fetch_and_clean_data(DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nd2 = fetch_and_clean_data(DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the data in d1 is the same as in d2.\n\nd3 = fetch_and_clean_data(DATA_URL_2)\n# This is a different URL, so the function executes.\n
\n

To set the persist parameter, use this command as follows:

\n
\nimport streamlit as st\n\n@st.cache_data(persist="disk")\ndef fetch_and_clean_data(url):\n    # Fetch data from URL here, and then clean it up.\n    return data\n
\n

By default, all parameters to a cached function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nconnection = make_database_connection()\nd1 = fetch_and_clean_data(connection, num_rows=10)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\nanother_connection = make_database_connection()\nd2 = fetch_and_clean_data(another_connection, num_rows=10)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _database_connection parameter was different\n# in both calls.\n
\n

A cached function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_data\ndef fetch_and_clean_data(_db_connection, num_rows):\n    # Fetch data from _db_connection here, and then clean it up.\n    return data\n\nfetch_and_clean_data.clear()\n# Clear all cached entries for this function.\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. datetime.datetime) to a hash\nfunction (lambda dt: dt.isoformat()) like this:

\n
\nimport streamlit as st\nimport datetime\n\n@st.cache_data(hash_funcs={datetime.datetime: lambda dt: dt.isoformat()})\ndef convert_to_utc(dt: datetime.datetime):\n    return dt.astimezone(datetime.timezone.utc)\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "datetime.datetime") to the hash function instead:

\n
\nimport streamlit as st\nimport datetime\n\n@st.cache_data(hash_funcs={"datetime.datetime": lambda dt: dt.isoformat()})\ndef convert_to_utc(dt: datetime.datetime):\n    return dt.astimezone(datetime.timezone.utc)\n
\n
\n", + "description": "

Decorator to cache functions that return data (e.g. dataframe transforms, database queries, ML inference).

\n

Cached objects are stored in "pickled" form, which means that the return\nvalue of a cached function must be pickleable. Each caller of the cached\nfunction gets its own copy of the cached data.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_data.clear().

\n

To cache global resources, use st.cache_resource instead. Learn more\nabout caching at https://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function to cache. Streamlit hashes the function's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float, timedelta, str, or None", + "is_optional": false, + "description": "

The maximum time to keep an entry in the cache. Can be one of:

\n\n

Note that ttl will be ignored if persist="disk" or persist=True.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. When a new entry is added to a full cache,\nthe oldest cached entry will be removed. Defaults to None.

\n", + "default": "None" + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached data is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "persist", + "type_name": "\"disk\", boolean, or None", + "is_optional": false, + "description": "

Optional location to persist cached data to. Passing "disk" (or True)\nwill persist the cached data to the local disk. None (or False) will disable\npersistence. The default is None.

\n", + "default": "None" + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False" + }, + { + "name": "hash_funcs", + "type_name": "dict or None", + "is_optional": false, + "description": "

Mapping of types or fully qualified names to hash functions.\nThis is used to override the behavior of the hasher inside Streamlit's\ncaching mechanism: when the hasher encounters an object, it will first\ncheck to see if its type matches a key in this dict and, if so, will use\nthe provided function to generate a hash for it. See below for an example\nof how this can be used.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/runtime/caching/cache_data_api.py#L384" + }, + "streamlit.experimental_rerun": { + "name": "experimental_rerun", + "signature": "st.experimental_rerun()", + "description": "

Rerun the script immediately.

\n

When st.experimental_rerun() is called, the script is halted - no\nmore statements will be run, and the script will be queued to re-run\nfrom the top.

\n

If this function is called outside of Streamlit, it will raise an\nException.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/commands/execution_control.py#L46" + }, + "streamlit.experimental_set_query_params": { + "name": "experimental_set_query_params", + "signature": "st.experimental_set_query_params(**query_params)", + "example": "
\n

To point the user's web browser to something like\n"http://localhost:8501/?show_map=True&selected=asia&selected=america",\nyou would do the following:

\n
\nimport streamlit as st\n\nst.experimental_set_query_params(\n    show_map=True,\n    selected=["asia", "america"],\n)\n
\n
\n", + "description": "

Set the query parameters that are shown in the browser's URL bar.

\n
\n

Warning

\n

Query param embed cannot be set using this method.

\n
\n", + "args": [ + { + "name": "**query_params", + "type_name": "dict", + "is_optional": false, + "description": "

The query parameters to set, as key-value pairs.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/commands/query_params.py#L65" + }, + "streamlit.experimental_singleton": { + "name": "experimental_singleton", + "signature": "st.experimental_singleton(func, *, ttl, max_entries, show_spinner, validate, experimental_allow_widgets, hash_funcs=None)", + "example": "
\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(url):\n    # Create a database session object that points to the URL.\n    return session\n\ns1 = get_database_session(SESSION_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(SESSION_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value. This means that now the connection object in s1 is the same as in s2.\n\ns3 = get_database_session(SESSION_URL_2)\n# This is a different URL, so the function executes.\n
\n

By default, all parameters to a cache_resource function must be hashable.\nAny parameter whose name begins with _ will not be hashed. You can use\nthis as an "escape hatch" for parameters that are not hashable:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\ns1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Actually executes the function, since this is the first time it was\n# encountered.\n\ns2 = get_database_session(create_sessionmaker(), DATA_URL_1)\n# Does not execute the function. Instead, returns its previously computed\n# value - even though the _sessionmaker parameter was different\n# in both calls.\n
\n

A cache_resource function's cache can be procedurally cleared:

\n
\nimport streamlit as st\n\n@st.cache_resource\ndef get_database_session(_sessionmaker, url):\n    # Create a database connection object that points to the URL.\n    return connection\n\nget_database_session.clear()\n# Clear all cached entries for this function.\n
\n

To override the default hashing behavior, pass a custom hash function.\nYou can do that by mapping a type (e.g. Person) to a hash\nfunction (str) like this:

\n
\nimport streamlit as st\nfrom pydantic import BaseModel\n\nclass Person(BaseModel):\n    name: str\n\n@st.cache_resource(hash_funcs={Person: str})\ndef get_person_name(person: Person):\n    return person.name\n
\n

Alternatively, you can map the type's fully-qualified name\n(e.g. "__main__.Person") to the hash function instead:

\n
\nimport streamlit as st\nfrom pydantic import BaseModel\n\nclass Person(BaseModel):\n    name: str\n\n@st.cache_resource(hash_funcs={"__main__.Person": str})\ndef get_person_name(person: Person):\n    return person.name\n
\n
\n", + "description": "

Decorator to cache functions that return global resources (e.g. database connections, ML models).

\n

Cached objects are shared across all users, sessions, and reruns. They\nmust be thread-safe because they can be accessed from multiple threads\nconcurrently. If thread safety is an issue, consider using st.session_state\nto store resources per session instead.

\n

You can clear a function's cache with func.clear() or clear the entire\ncache with st.cache_resource.clear().

\n

To cache data, use st.cache_data instead. Learn more about caching at\nhttps://docs.streamlit.io/library/advanced-features/caching.

\n", + "args": [ + { + "name": "func", + "type_name": "callable", + "is_optional": false, + "description": "

The function that creates the cached resource. Streamlit hashes the\nfunction's source code.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float, timedelta, str, or None", + "is_optional": false, + "description": "

The maximum time to keep an entry in the cache. Can be one of:

\n\n

Note that ttl will be ignored if persist="disk" or persist=True.

\n", + "default": null + }, + { + "name": "max_entries", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of entries to keep in the cache, or None\nfor an unbounded cache. When a new entry is added to a full cache,\nthe oldest cached entry will be removed. Defaults to None.

\n", + "default": "None" + }, + { + "name": "show_spinner", + "type_name": "boolean or string", + "is_optional": false, + "description": "

Enable the spinner. Default is True to show a spinner when there is\na "cache miss" and the cached resource is being created. If string,\nvalue of show_spinner param will be used for spinner text.

\n", + "default": "True" + }, + { + "name": "validate", + "type_name": "callable or None", + "is_optional": false, + "description": "

An optional validation function for cached data. validate is called\neach time the cached value is accessed. It receives the cached value as\nits only parameter and it must return a boolean. If validate returns\nFalse, the current cached value is discarded, and the decorated function\nis called to compute a new value. This is useful e.g. to check the\nhealth of database connections.

\n", + "default": null + }, + { + "name": "experimental_allow_widgets", + "type_name": "boolean", + "is_optional": false, + "description": "

Allow widgets to be used in the cached function. Defaults to False.\nSupport for widgets in cached functions is currently experimental.\nSetting this parameter to True may lead to excessive memory use since the\nwidget value is treated as an additional input parameter to the cache.\nWe may remove support for this option at any time without notice.

\n", + "default": "False" + }, + { + "name": "hash_funcs", + "type_name": "dict or None", + "is_optional": false, + "description": "

Mapping of types or fully qualified names to hash functions.\nThis is used to override the behavior of the hasher inside Streamlit's\ncaching mechanism: when the hasher encounters an object, it will first\ncheck to see if its type matches a key in this dict and, if so, will use\nthe provided function to generate a hash for it. See below for an example\nof how this can be used.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/runtime/caching/cache_resource_api.py#L264" + }, + "streamlit.file_uploader": { + "name": "file_uploader", + "signature": "st.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nimport streamlit as st\nimport pandas as pd\nfrom io import StringIO\n\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nimport streamlit as st\n\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n
\n", + "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this file uploader is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "type", + "type_name": "str or list of str or None", + "is_optional": false, + "description": "

Array of allowed extensions. ['png', 'jpg']\nThe default is None, which means all extensions are allowed.

\n", + "default": "None" + }, + { + "name": "accept_multiple_files", + "type_name": "bool", + "is_optional": false, + "description": "

If True, allows the user to upload multiple files at the same time,\nin which case the return value will be a list of files.\nDefault: False

\n", + "default": "False" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

A tooltip that gets displayed next to the file uploader.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this file_uploader's value\nchanges.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the file uploader if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "None or UploadedFile or list of UploadedFile", + "is_generator": false, + "description": "
    \n
  • If accept_multiple_files is False, returns either None or\nan UploadedFile object.
  • \n
  • If accept_multiple_files is True, returns a list with the\nuploaded files as UploadedFile objects. If no files were\nuploaded, returns an empty list.
  • \n
\n

The UploadedFile class is a subclass of BytesIO, and therefore\nit is "file-like". This means you can pass them anywhere where\na file is expected.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/file_uploader.py#L214" + }, + "streamlit.form": { + "name": "form", + "signature": "st.form(key, clear_on_submit=False)", + "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n\n \n
\n", + "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
  • Within a form, the only widget that can have a callback function is\nst.form_submit_button.
  • \n
\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

A string that identifies the form. Each form must have its own\nkey. (This key is not displayed to the user in the interface.)

\n", + "default": null + }, + { + "name": "clear_on_submit", + "type_name": "bool", + "is_optional": false, + "description": "

If True, all widgets inside the form will be reset to their default\nvalues after the user presses the Submit button. Defaults to False.\n(Note that Custom Components are unaffected by this flag, and\nwill not be reset to their defaults on form submission.)

\n", + "default": "values" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/form.py#L118" + }, + "streamlit.form_submit_button": { + "name": "form_submit_button", + "signature": "st.form_submit_button(label=\"Submit\", help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this button is for.\nDefaults to "Submit".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

A tooltip that gets displayed when the button is hovered over.\nDefaults to None.

\n", + "default": "None" + }, + { + "name": "on_click", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this button is clicked.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"secondary\" or \"primary\"", + "is_optional": false, + "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the button if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which makes the button stretch its width to match the parent container.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "bool", + "is_generator": false, + "description": "

True if the button was clicked.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/form.py#L218" + }, + "streamlit.get_option": { + "name": "get_option", + "signature": "st.get_option(key)", + "description": "

Return the current value of a given Streamlit config option.

\n

Run streamlit config show in the terminal to see all available options.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

The config option key of the form "section.optionName". To see all\navailable options, run streamlit config show on a terminal.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/config.py#L131" + }, + "streamlit.graphviz_chart": { + "name": "graphviz_chart", + "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\nimport graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n
\n", + "description": "

Display a graph using the dagre-d3 library.

\n", + "args": [ + { + "name": "figure_or_dot", + "type_name": "graphviz.dot.Graph, graphviz.dot.Digraph, str", + "is_optional": false, + "description": "

The Graphlib graph object or dot string to display

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/graphviz_chart.py#L39" + }, + "streamlit.header": { + "name": "header", + "signature": "st.header(body, anchor=None, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.header('This is a header')\nst.header('A header with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in header formatting.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str or False", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the header.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/heading.py#L40" + }, + "streamlit.help": { + "name": "help", + "signature": "st.help(obj=)", + "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nimport streamlit as st\nimport pandas\n\nst.help(pandas.DataFrame)\n
\n\n \n

Want to quickly check what data type is output by a certain function?\nTry:

\n
\nimport streamlit as st\n\nx = my_poorly_documented_function()\nst.help(x)\n
\n

Want to quickly inspect an object? No sweat:

\n
\nclass Dog:\n  '''A typical dog.'''\n\n  def __init__(self, breed, color):\n    self.breed = breed\n    self.color = color\n\n  def bark(self):\n    return 'Woof!'\n\n\nfido = Dog('poodle', 'white')\n\nst.help(fido)\n
\n\n \n

And if you're using Magic, you can get help for functions, classes,\nand modules without even typing st.help:

\n
\nimport streamlit as st\nimport pandas\n\n# Get help for Pandas read_csv:\npandas.read_csv\n\n# Get help for Streamlit itself:\nst\n
\n\n \n
\n", + "description": "

Display help and other information for a given object.

\n

Depending on the type of object that is passed in, this displays the\nobject's name, type, value, signature, docstring, and member variables,\nmethods \u2014 as well as the values/docstring of members and methods.

\n", + "args": [ + { + "name": "obj", + "type_name": "any", + "is_optional": false, + "description": "

The object whose information should be displayed. If left\nunspecified, this call will display help for Streamlit itself.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/doc_string.py#L48" + }, + "streamlit.image": { + "name": "image", + "signature": "st.image(image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", + "example": "
\n
\nimport streamlit as st\nfrom PIL import Image\n\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n
\n", + "description": "

Display an image or list of images.

\n", + "args": [ + { + "name": "image", + "type_name": "numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]", + "is_optional": false, + "description": "

Monochrome image of shape (w,h) or (w,h,1)\nOR a color image of shape (w,h,3)\nOR an RGBA image of shape (w,h,4)\nOR a URL to fetch the image from\nOR a path of a local image file\nOR an SVG XML string like <svg xmlns=...</svg>\nOR a list of one of the above, to display multiple images.

\n", + "default": null + }, + { + "name": "caption", + "type_name": "str or list of str", + "is_optional": false, + "description": "

Image caption. If displaying multiple images, caption should be a\nlist of captions (one for each image).

\n", + "default": null + }, + { + "name": "width", + "type_name": "int or None", + "is_optional": false, + "description": "

Image width. None means use the image width,\nbut do not exceed the width of the column.\nShould be set for SVG images, as they have no default image width.

\n", + "default": "image" + }, + { + "name": "use_column_width", + "type_name": "\"auto\", \"always\", \"never\", or bool", + "is_optional": false, + "description": "

If "auto", set the image's width to its natural size,\nbut do not exceed the width of the column.\nIf "always" or True, set the image's width to the column width.\nIf "never" or False, set the image's width to its natural size.\nNote: if set, use_column_width takes precedence over the width parameter.

\n", + "default": null + }, + { + "name": "clamp", + "type_name": "bool", + "is_optional": false, + "description": "

Clamp image pixel values to a valid range ([0-255] per channel).\nThis is only meaningful for byte array images; the parameter is\nignored for image URLs. If this is not set, and an image has an\nout-of-range value, an error will be thrown.

\n", + "default": null + }, + { + "name": "channels", + "type_name": "\"RGB\" or \"BGR\"", + "is_optional": false, + "description": "

If image is an nd.array, this parameter denotes the format used to\nrepresent color information. Defaults to "RGB", meaning\nimage[:, :, 0] is the red channel, image[:, :, 1] is green, and\nimage[:, :, 2] is blue. For images coming from libraries like\nOpenCV you should set this to "BGR", instead.

\n", + "default": "s" + }, + { + "name": "output_format", + "type_name": "\"JPEG\", \"PNG\", or \"auto\"", + "is_optional": false, + "description": "

This parameter specifies the format to use when transferring the\nimage data. Photos should use the JPEG format for lossy compression\nwhile diagrams should use the PNG format for lossless compression.\nDefaults to "auto" which identifies the compression type based\non the type and format of the image argument.

\n", + "default": "s" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/image.py#L88" + }, + "streamlit.info": { + "name": "info", + "signature": "st.info(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", + "description": "

Display an informational message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The info text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/alert.py#L91" + }, + "streamlit.json": { + "name": "json", + "signature": "st.json(body, *, expanded=True)", + "example": "
\n
\nimport streamlit as st\n\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n
\n", + "description": "

Display object or string as a pretty-printed JSON string.

\n", + "args": [ + { + "name": "body", + "type_name": "object or str", + "is_optional": false, + "description": "

The object to print as JSON. All referenced objects should be\nserializable to JSON as well. If object is a string, we assume it\ncontains serialized JSON.

\n", + "default": null + }, + { + "name": "expanded", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean that allows the user to set whether the initial\nstate of this json element should be expanded. Defaults to True.\nThis argument can only be supplied by keyword.

\n", + "default": "True" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/json.py#L35" + }, + "streamlit.latex": { + "name": "latex", + "signature": "st.latex(body, *, help=None)", + "example": "
\n
\nimport streamlit as st\n\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", + "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", + "args": [ + { + "name": "body", + "type_name": "str or SymPy expression", + "is_optional": false, + "description": "

The string or SymPy expression to display as LaTeX. If str, it's\na good idea to use raw Python strings since LaTeX uses backslashes\na lot.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the LaTeX expression.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/markdown.py#L196" + }, + "streamlit.line_chart": { + "name": "line_chart", + "signature": "st.line_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\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 \n
\n", + "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict or None", + "is_optional": false, + "description": "

Data to be plotted.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "x", + "type_name": "str or None", + "is_optional": false, + "description": "

Column name to use for the x-axis. If None, uses the data index for the x-axis.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "y", + "type_name": "str, sequence of str, or None", + "is_optional": false, + "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "width", + "type_name": "int", + "is_optional": false, + "description": "

The chart width in pixels. If 0, selects the width automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int", + "is_optional": false, + "description": "

The chart height in pixels. If 0, selects the height automatically.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/dataframe_selector.py#L230" + }, + "streamlit.map": { + "name": "map", + "signature": "st.map(data=None, *, latitude=None, longitude=None, color=None, size=None, zoom=None, use_container_width=True)", + "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n

You can also customize the size and color of the datapoints:

\n
\nst.map(df, size=20, color='#0044ff')\n
\n

And finally, you can choose different columns to use for the latitude\nand longitude components, as well as set size and color of each\ndatapoint dynamically based on other columns:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame({\n    "col1": np.random.randn(1000) / 50 + 37.76,\n    "col2": np.random.randn(1000) / 50 + -122.4,\n    "col3": np.random.randn(1000) * 100,\n    "col4": np.random.rand(1000, 4).tolist(),\n})\n\nst.map(df,\n    latitude='col1',\n    longitude='col2',\n    size='col3',\n    color='col4')\n
\n\n \n
\n", + "description": "

Display a map with a scatterplot overlaid onto it.

\n

This is a wrapper around st.pydeck_chart to quickly create\nscatterplot charts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The data to be plotted.

\n", + "default": null + }, + { + "name": "latitude", + "type_name": "str or None", + "is_optional": false, + "description": "

The name of the column containing the latitude coordinates of\nthe datapoints in the chart. This argument can only be supplied\nby keyword.

\n

If None, the latitude data will come from any column named 'lat',\n'latitude', 'LAT', or 'LATITUDE'.

\n", + "default": null + }, + { + "name": "longitude", + "type_name": "str or None", + "is_optional": false, + "description": "

The name of the column containing the longitude coordinates of\nthe datapoints in the chart. This argument can only be supplied\nby keyword.

\n

If None, the longitude data will come from any column named 'lon',\n'longitude', 'LON', or 'LONGITUDE'.

\n", + "default": null + }, + { + "name": "color", + "type_name": "str or tuple or None", + "is_optional": false, + "description": "

The color of the circles representing each datapoint. This argument\ncan only be supplied by keyword.

\n

Can be:

\n
    \n
  • None, to use the default color.
  • \n
  • A hex string like "#ffaa00" or "#ffaa0088".
  • \n
  • An RGB or RGBA tuple with the red, green, blue, and alpha\ncomponents specified as ints from 0 to 255 or floats from 0.0 to\n1.0.
  • \n
  • The name of the column to use for the color. Cells in this column\nshould contain colors represented as a hex string or color tuple,\nas described above.
  • \n
\n", + "default": "color" + }, + { + "name": "size", + "type_name": "str or float or None", + "is_optional": false, + "description": "

The size of the circles representing each point, in meters. This\nargument can only be supplied by keyword.

\n

This can be:

\n
    \n
  • None, to use the default size.
  • \n
  • A number like 100, to specify a single size to use for all\ndatapoints.
  • \n
  • The name of the column to use for the size. This allows each\ndatapoint to be represented by a circle of a different size.
  • \n
\n", + "default": "size" + }, + { + "name": "zoom", + "type_name": "int", + "is_optional": false, + "description": "

Zoom level as specified in\nhttps://wiki.openstreetmap.org/wiki/Zoom_levels.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the width argument.\nThis argument can only be supplied by keyword.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/map.py#L91" + }, + "streamlit.markdown": { + "name": "markdown", + "signature": "st.markdown(body, unsafe_allow_html=False, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.markdown('Streamlit is **_really_ cool**.')\nst.markdown("This text is :red[colored red], and this is **:blue[colored]** and bold.")\nst.markdown(":green[$\\sqrt{x^2+y^2}=1$] is a Pythagorean identity. :pencil:")\n
\n
\n", + "description": "

Display string formatted as Markdown.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the Markdown.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/markdown.py#L31" + }, + "streamlit.metric": { + "name": "metric", + "signature": "st.metric(label, value, delta=None, delta_color=\"normal\", help=None, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n

st.metric looks especially nice in combination with st.columns:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n

The delta indicator color can also be inverted or turned off:

\n
\nimport streamlit as st\n\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n
\n", + "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

The header or title for the metric. The label can optionally contain\nMarkdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Value of the metric. None is rendered as a long dash.

\n", + "default": null + }, + { + "name": "delta", + "type_name": "int, float, str, or None", + "is_optional": false, + "description": "

Indicator of how the metric changed, rendered with an arrow below\nthe metric. If delta is negative (int/float) or starts with a minus\nsign (str), the arrow points down and the text is red; else the\narrow points up and the text is green. If None (default), no delta\nindicator is shown.

\n", + "default": null + }, + { + "name": "delta_color", + "type_name": "\"normal\", \"inverse\", or \"off\"", + "is_optional": false, + "description": "

If "normal" (default), the delta indicator is shown as described\nabove. If "inverse", it is red when positive and green when\nnegative. This is useful when a negative change is considered\ngood, e.g. if cost decreased. If "off", delta is shown in gray\nregardless of its value.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the metric label.

\n", + "default": null + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/metric.py#L46" + }, + "streamlit.multiselect": { + "name": "multiselect", + "signature": "st.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, max_selections=None, placeholder=\"Choose an option\", disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n
\n", + "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence[V], numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null + }, + { + "name": "default", + "type_name": "[V], V, or None", + "is_optional": false, + "description": "

List of default values. Can also be a single value.

\n", + "default": "values" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of selectbox options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe multiselect.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the multiselect.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this multiselect's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "max_selections", + "type_name": "int", + "is_optional": false, + "description": "

The max selections that can be selected at a time.\nThis argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str", + "is_optional": false, + "description": "

A string to display when no options are selected. Defaults to 'Choose an option'.

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the multiselect widget if set\nto True. The default is False. This argument can only be supplied\nby keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "list", + "is_generator": false, + "description": "

A list with the selected options

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/multiselect.py#L145" + }, + "streamlit.number_input": { + "name": "number_input", + "signature": "st.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n
\n", + "description": "

Display a numeric input widget.

\n
\n

Note

\n

Integer values exceeding +/- (1<<53) - 1 cannot be accurately\nstored or returned by the widget due to serialization contstraints\nbetween the Python server and JavaScript client. You must handle\nsuch numbers as floats, leading to a loss in precision.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The minimum permitted value.\nIf None, there will be no minimum.

\n", + "default": null + }, + { + "name": "max_value", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The maximum permitted value.\nIf None, there will be no maximum.

\n", + "default": null + }, + { + "name": "value", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The value of this widget when it first renders.\nDefaults to min_value, or 0.0 if min_value is None

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 otherwise.\nIf the value is not specified, the format parameter will be used.

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. Output must be purely numeric. This does not impact\nthe return value. Valid formatters: %d %e %f %g %i %u

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this number_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the number input if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int or float", + "is_generator": false, + "description": "

The current value of the numeric input widget. The return type\nwill match the data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/number_input.py#L66" + }, + "streamlit.plotly_chart": { + "name": "plotly_chart", + "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", theme=\"streamlit\", **kwargs)", + "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport numpy as np\nimport plotly.figure_factory as ff\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n        hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n
\n", + "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", + "args": [ + { + "name": "figure_or_data", + "type_name": "plotly.graph_objs.Figure, plotly.graph_objs.Data,", + "is_optional": false, + "description": "

dict/list of plotly.graph_objs.Figure/Data

\n

See https://plot.ly/python/ for examples of graph descriptions.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over the figure's native width value.

\n", + "default": null + }, + { + "name": "sharing", + "type_name": "\"streamlit\", \"private\", \"secret\", or \"public\"", + "is_optional": false, + "description": "

Use "streamlit" to insert the plot and all its dependencies\ndirectly in the Streamlit app using plotly's offline mode (default).\nUse any other sharing mode to send the chart to Plotly chart studio, which\nrequires an account. See https://plot.ly/python/chart-studio/ for more information.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": null, + "is_optional": null, + "description": "

Any argument accepted by Plotly's plot() function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/plotly_chart.py#L81" + }, + "streamlit.progress": { + "name": "progress", + "signature": "st.progress(value, text=None)", + "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport streamlit as st\nimport time\n\nprogress_text = "Operation in progress. Please wait."\nmy_bar = st.progress(0, text=progress_text)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1, text=progress_text)\n
\n
\n", + "description": "

Display a progress bar.

\n", + "args": [ + { + "name": "value", + "type_name": "int or float", + "is_optional": false, + "description": "

0 <= value <= 100 for int

\n

0.0 <= value <= 1.0 for float

\n", + "default": null + }, + { + "name": "text", + "type_name": "str or None", + "is_optional": false, + "description": "

A message to display above the progress bar. The text can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/progress.py#L66" + }, + "streamlit.pydeck_chart": { + "name": "pydeck_chart", + "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)", + "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport pydeck as pdk\n\nchart_data = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=chart_data,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=chart_data,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", + "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", + "args": [ + { + "name": "pydeck_obj", + "type_name": "pydeck.Deck or None", + "is_optional": false, + "description": "

Object specifying the PyDeck chart to draw.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/deck_gl_json_chart.py#L36" + }, + "streamlit.pyplot": { + "name": "pyplot", + "signature": "st.pyplot(fig=None, clear_figure=None, use_container_width=True, **kwargs)", + "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", + "example": "
\n
\nimport streamlit as st\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n
\n", + "description": "

Display a matplotlib.pyplot figure.

\n", + "args": [ + { + "name": "fig", + "type_name": "Matplotlib Figure", + "is_optional": false, + "description": "

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

\n", + "default": null + }, + { + "name": "clear_figure", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n
    \n
  • If fig is set, defaults to False.
  • \n
  • If fig is not set, defaults to True. This simulates Jupyter's\napproach to matplotlib rendering.
  • \n
\n", + "default": "based" + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

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

\n", + "default": "s" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Arguments to pass to Matplotlib's savefig function.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/pyplot.py#L38" + }, + "streamlit.radio": { + "name": "radio", + "signature": "st.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ngenre = st.radio(\n    "What\\'s your favorite movie genre",\n    ('Comedy', 'Drama', 'Documentary'))\n\nif genre == 'Comedy':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn\\'t select comedy.")\n
\n\n \n
\n", + "description": "

Display a radio button widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this radio group is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the radio options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of radio options. It receives\nthe raw option as an argument and should output the label to be\nshown for that option. This has no impact on the return value of\nthe radio.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the radio.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this radio's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the radio button if set to\nTrue. The default is False. This argument can only be supplied by\nkeyword.

\n", + "default": "False" + }, + { + "name": "horizontal", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", + "default": "false" + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/radio.py#L75" + }, + "streamlit.select_slider": { + "name": "select_slider", + "signature": "st.select_slider(label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\nimport streamlit as st\n\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nimport streamlit as st\n\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n ", + "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the slider options. All options will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", + "default": null + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to first option.

\n", + "default": "first" + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels from the options.\nargument. It receives the option as an argument and its output\nwill be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the select slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this select_slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the select slider if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any value or tuple of any value", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/select_slider.py#L106" + }, + "streamlit.selectbox": { + "name": "selectbox", + "signature": "st.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=\"Select...\", disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n
\n", + "description": "

Display a select widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "options", + "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", + "is_optional": false, + "description": "

Labels for the select options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", + "default": null + }, + { + "name": "index", + "type_name": "int", + "is_optional": false, + "description": "

The index of the preselected option on first render.

\n", + "default": null + }, + { + "name": "format_func", + "type_name": "function", + "is_optional": false, + "description": "

Function to modify the display of the labels. It receives the option\nas an argument and its output will be cast to str.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the selectbox.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this selectbox's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str", + "is_optional": false, + "description": "

A string to display when no options are selected. Defaults to 'Select...'.

\n

A selectbox can't be empty, so a placeholder only displays while a\nuser's cursor is in a selectbox after manually deleting the current\nselection. A future update will allow selectboxes to be empty.

\n", + "default": "s" + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the selectbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "any", + "is_generator": false, + "description": "

The selected option

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/selectbox.py#L71" + }, + "streamlit.set_option": { + "name": "set_option", + "signature": "st.set_option(key, value)", + "description": "

Set config option.

\n
\n
Currently, only the following config options can be set within the script itself:
\n
    \n
  • client.caching
  • \n
  • client.displayEnabled
  • \n
  • deprecation.*
  • \n
\n
\n
\n

Calling with any other options will raise StreamlitAPIException.

\n

Run streamlit config show in the terminal to see all available options.

\n", + "args": [ + { + "name": "key", + "type_name": "str", + "is_optional": false, + "description": "

The config option key of the form "section.optionName". To see all\navailable options, run streamlit config show on a terminal.

\n", + "default": null + }, + { + "name": "value", + "type_name": null, + "is_optional": null, + "description": "

The new value to assign to this config option.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/config.py#L92" + }, + "streamlit.set_page_config": { + "name": "set_page_config", + "signature": "st.set_page_config(page_title=None, page_icon=None, layout=\"centered\", initial_sidebar_state=\"auto\", menu_items=None)", + "example": "
\nimport streamlit as st\n\nst.set_page_config(\n    page_title="Ex-stream-ly Cool App",\n    page_icon="\ud83e\uddca",\n    layout="wide",\n    initial_sidebar_state="expanded",\n    menu_items={\n        'Get Help': 'https://www.extremelycoolapp.com/help',\n        'Report a bug': "https://www.extremelycoolapp.com/bug",\n        'About': "# This is a header. This is an *extremely* cool app!"\n    }\n)\n
\n", + "description": "

Configures the default settings of the page.

\n
\n

Note

\n

This must be the first Streamlit command used on an app page, and must only\nbe set once per page.

\n
\n", + "args": [ + { + "name": "page_title", + "type_name": "str or None", + "is_optional": false, + "description": "

The page title, shown in the browser tab. If None, defaults to the\nfilename of the script ("app.py" would show "app \u2022 Streamlit").

\n", + "default": "the" + }, + { + "name": "page_icon", + "type_name": "Anything supported by st.image or str or None", + "is_optional": false, + "description": "

The page favicon.\nBesides the types supported by st.image (like URLs or numpy arrays),\nyou can pass in an emoji as a string ("\ud83e\udd88") or a shortcode (":shark:").\nIf you're feeling lucky, try "random" for a random emoji!\nEmoji icons are courtesy of Twemoji and loaded from MaxCDN.

\n", + "default": null + }, + { + "name": "layout", + "type_name": "\"centered\" or \"wide\"", + "is_optional": false, + "description": "

How the page content should be laid out. Defaults to "centered",\nwhich constrains the elements into a centered column of fixed width;\n"wide" uses the entire screen.

\n", + "default": "s" + }, + { + "name": "initial_sidebar_state", + "type_name": "\"auto\", \"expanded\", or \"collapsed\"", + "is_optional": false, + "description": "

How the sidebar should start out. Defaults to "auto",\nwhich hides the sidebar on mobile-sized devices, and shows it otherwise.\n"expanded" shows the sidebar initially; "collapsed" hides it.

\n", + "default": "s" + }, + { + "name": "menu_items", + "type_name": "dict", + "is_optional": false, + "description": "

Configure the menu that appears on the top-right side of this app.\nThe keys in this dict denote the menu item you'd like to configure:

\n
    \n
  • \n
    "Get help": str or None
    \n
    The URL this menu item should point to.\nIf None, hides this menu item.
    \n
    \n
  • \n
  • \n
    "Report a Bug": str or None
    \n
    The URL this menu item should point to.\nIf None, hides this menu item.
    \n
    \n
  • \n
  • \n
    "About": str or None
    \n
    A markdown string to show in the About dialog.\nIf None, only shows Streamlit's default About text.
    \n
    \n
  • \n
\n

The URL may also refer to an email address e.g. mailto:john@example.com.

\n", + "default": "About" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/commands/page_config.py#L114" + }, + "streamlit.slider": { + "name": "slider", + "signature": "st.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "examples": "
\n
\nimport streamlit as st\n\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nimport streamlit as st\n\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nimport streamlit as st\nfrom datetime import time\n\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nimport streamlit as st\nfrom datetime import datetime\n\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n
\n", + "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n
\n

Note

\n

Integer values exceeding +/- (1<<53) - 1 cannot be accurately\nstored or returned by the widget due to serialization contstraints\nbetween the Python server and JavaScript client. You must handle\nsuch numbers as floats, leading to a loss in precision.

\n
\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "min_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The minimum permitted value.\nDefaults to 0 if the value is an int, 0.0 if a float,\nvalue - timedelta(days=14) if a date/datetime, time.min if a time

\n", + "default": "0" + }, + { + "name": "max_value", + "type_name": "a supported type or None", + "is_optional": false, + "description": "

The maximum permitted value.\nDefaults to 100 if the value is an int, 1.0 if a float,\nvalue + timedelta(days=14) if a date/datetime, time.max if a time

\n", + "default": "100" + }, + { + "name": "value", + "type_name": "a supported type or a tuple/list of supported types or None", + "is_optional": false, + "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to min_value.

\n", + "default": "min_value" + }, + { + "name": "step", + "type_name": "int, float, timedelta, or None", + "is_optional": false, + "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", + "default": "1" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. This does not impact the return value.\nFormatter for int/float supports: %d %e %f %g %i\nFormatter for date/time/datetime uses Moment.js notation:\nhttps://momentjs.com/docs/#/displaying/format/

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the slider.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this slider's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the slider if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "int/float/date/time/datetime or tuple of int/float/date/time/datetime", + "is_generator": false, + "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/slider.py#L172" + }, + "streamlit.snow": { + "name": "snow", + "signature": "st.snow()", + "example": "
\n
\nimport streamlit as st\n\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", + "description": "

Draw celebratory snowfall.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/snow.py#L25" + }, + "streamlit.spinner": { + "name": "spinner", + "signature": "st.spinner(text=\"In progress...\")", + "example": "
\n
\nimport time\nimport streamlit as st\n\nwith st.spinner('Wait for it...'):\n    time.sleep(5)\nst.success('Done!')\n
\n
\n", + "description": "

Temporarily displays a message while executing a block of code.

\n", + "args": [ + { + "name": "text", + "type_name": "str", + "is_optional": false, + "description": "

A message to display while executing that block

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/spinner.py#L23" + }, + "streamlit.stop": { + "name": "stop", + "signature": "st.stop()", + "example": "
\n
\nimport streamlit as st\n\nname = st.text_input('Name')\nif not name:\n  st.warning('Please input a name.')\n  st.stop()\nst.success('Thank you for inputting a name.')\n
\n
\n", + "description": "

Stops execution immediately.

\n

Streamlit will not run any statements after st.stop().\nWe recommend rendering a message to explain why the script has stopped.\nWhen run outside of Streamlit, this will raise an Exception.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/commands/execution_control.py#L25" + }, + "streamlit.subheader": { + "name": "subheader", + "signature": "st.subheader(body, anchor=None, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.subheader('This is a subheader')\nst.subheader('A subheader with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in subheader formatting.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str or False", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the subheader.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/heading.py#L93" + }, + "streamlit.success": { + "name": "success", + "signature": "st.success(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", + "description": "

Display a success message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The success text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/alert.py#L124" + }, + "streamlit.table": { + "name": "table", + "signature": "st.table(data=None)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n
\n", + "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "is_optional": false, + "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/dataframe_selector.py#L192" + }, + "streamlit.tabs": { + "name": "tabs", + "signature": "st.tabs(tabs)", + "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\nimport streamlit as st\n\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n
\n", + "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", + "args": [ + { + "name": "tabs", + "type_name": "list of strings", + "is_optional": false, + "description": "

Creates a tab for each string in the list. The first tab is selected by default.\nThe string is used as the name of the tab and can optionally contain Markdown,\nsupporting the following elements: Bold, Italics, Strikethroughs, Inline Code,\nEmojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "list of containers", + "is_generator": false, + "description": "

A list of container objects.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/layouts.py#L203" + }, + "streamlit.text": { + "name": "text", + "signature": "st.text(body, *, help=None)", + "example": "
\n
\nimport streamlit as st\n\nst.text('This is some text.')\n
\n
\n", + "description": "

Write fixed-width and preformatted text.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the text.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/text.py#L27" + }, + "streamlit.text_area": { + "name": "text_area", + "signature": "st.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", + "description": "

Display a multi-line text input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "height", + "type_name": "int or None", + "is_optional": false, + "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", + "default": "height" + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Maximum number of characters allowed in text area.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the textarea.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text_area's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text area is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text area if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/text_widgets.py#L274" + }, + "streamlit.text_input": { + "name": "text_input", + "signature": "st.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n
\n", + "description": "

Display a single-line text input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "object", + "is_optional": false, + "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "default": null + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

Max number of characters allowed in text input.

\n", + "default": null + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "type", + "type_name": "\"default\" or \"password\"", + "is_optional": false, + "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", + "default": "s" + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "autocomplete", + "type_name": "str", + "is_optional": false, + "description": "

An optional value that will be passed to the <input> element's\nautocomplete property. If unspecified, this value will be set to\n"new-password" for "password" inputs, and the empty string for\n"default" inputs. For more details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this text input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "placeholder", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional string displayed when the text input is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the text input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + } + ], + "returns": [ + { + "type_name": "str", + "is_generator": false, + "description": "

The current value of the text input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/text_widgets.py#L71" + }, + "streamlit.time_input": { + "name": "time_input", + "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", step=0:15:00)", + "example": "
\n
\nimport datetime\nimport streamlit as st\n\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n
\n", + "description": "

Display a time input widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str", + "is_optional": false, + "description": "

A short label explaining to the user what this time input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "default": null + }, + { + "name": "value", + "type_name": "datetime.time/datetime.datetime", + "is_optional": false, + "description": "

The value of this widget when it first renders. This will be\ncast to str internally. Defaults to the current time.

\n", + "default": "the" + }, + { + "name": "key", + "type_name": "str or int", + "is_optional": false, + "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the input.

\n", + "default": null + }, + { + "name": "on_change", + "type_name": "callable", + "is_optional": false, + "description": "

An optional callback invoked when this time_input's value changes.

\n", + "default": null + }, + { + "name": "args", + "type_name": "tuple", + "is_optional": false, + "description": "

An optional tuple of args to pass to the callback.

\n", + "default": null + }, + { + "name": "kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

An optional dict of kwargs to pass to the callback.

\n", + "default": null + }, + { + "name": "disabled", + "type_name": "bool", + "is_optional": false, + "description": "

An optional boolean, which disables the time input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "default": "False" + }, + { + "name": "label_visibility", + "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "is_optional": false, + "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", + "default": "is" + }, + { + "name": "step", + "type_name": "int or timedelta", + "is_optional": false, + "description": "

The stepping interval in seconds. Defaults to 900, i.e. 15 minutes.\nYou can also pass a datetime.timedelta object.

\n", + "default": "900" + } + ], + "returns": [ + { + "type_name": "datetime.time", + "is_generator": false, + "description": "

The current value of the time input widget.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/time_widgets.py#L217" + }, + "streamlit.title": { + "name": "title", + "signature": "st.title(body, anchor=None, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.title('This is a title')\nst.title('A title with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", + "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "anchor", + "type_name": "str or False", + "is_optional": false, + "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str", + "is_optional": false, + "description": "

An optional tooltip that gets displayed next to the title.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/heading.py#L146" + }, + "streamlit.toast": { + "name": "toast", + "signature": "st.toast(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.toast('Your edited image was saved!', icon='\ud83d\ude0d')\n
\n
\n", + "description": "

Display a short message, known as a notification "toast".

\n

The toast appears in the app's bottom-right corner and disappears after four seconds.

\n
\n

Warning

\n

st.toast is not compatible with Streamlit's caching and\ncannot be called within a cached function.

\n
\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the toast. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/toast.py#L37" + }, + "streamlit.vega_lite_chart": { + "name": "vega_lite_chart", + "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, theme=\"streamlit\", **kwargs)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(chart_data, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", + "description": "

Display a chart using the Vega-Lite library.

\n", + "args": [ + { + "name": "data", + "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", + "is_optional": false, + "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "default": null + }, + { + "name": "spec", + "type_name": "dict or None", + "is_optional": false, + "description": "

The Vega-Lite spec for the chart. If the spec was already passed in\nthe previous argument, this must be set to None. See\nhttps://vega.github.io/vega-lite/docs/ for more info.

\n", + "default": null + }, + { + "name": "use_container_width", + "type_name": "bool", + "is_optional": false, + "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", + "default": null + }, + { + "name": "theme", + "type_name": "\"streamlit\" or None", + "is_optional": false, + "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", + "default": "behavior" + }, + { + "name": "**kwargs", + "type_name": "any", + "is_optional": false, + "description": "

Same as spec, but as keywords.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/dataframe_selector.py#L545" + }, + "streamlit.video": { + "name": "video", + "signature": "st.video(data, format=\"video/mp4\", start_time=0)", + "example": "
\n
\nimport streamlit as st\n\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", + "description": "

Display a video player.

\n", + "args": [ + { + "name": "data", + "type_name": "str, bytes, BytesIO, numpy.ndarray, or file", + "is_optional": false, + "description": "

Raw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "default": null + }, + { + "name": "format", + "type_name": "str", + "is_optional": false, + "description": "

The mime type for the video file. Defaults to 'video/mp4'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", + "default": "s" + }, + { + "name": "start_time", + "type_name": "int", + "is_optional": false, + "description": "

The time from which this element should start playing.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/media.py#L115" + }, + "streamlit.warning": { + "name": "warning", + "signature": "st.warning(body, *, icon=None)", + "example": "
\n
\nimport streamlit as st\n\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", + "description": "

Display warning message.

\n", + "args": [ + { + "name": "body", + "type_name": "str", + "is_optional": false, + "description": "

The warning text to display.

\n", + "default": null + }, + { + "name": "icon", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", + "default": "None" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/alert.py#L59" + }, + "streamlit.write": { + "name": "write", + "signature": "st.write(*args, unsafe_allow_html=False, **kwargs)", + "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nimport streamlit as st\n\nst.write('Hello, *World!* :sunglasses:')\n
\n\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nimport streamlit as st\nimport pandas as pd\n\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nimport streamlit as st\n\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n
\n", + "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", + "args": [ + { + "name": "*args", + "type_name": "any", + "is_optional": false, + "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression, emoji shortcodes, and colored text.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(class) : Displays information about a class.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", + "default": null + }, + { + "name": "unsafe_allow_html", + "type_name": "bool", + "is_optional": false, + "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "default": "False" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/write.py#L49" + }, + "streamlit.experimental_memo.clear": { + "name": "experimental_memo.clear", + "signature": "st.experimental_memo.clear()", + "description": "

Clear all in-memory and on-disk data caches.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/runtime/caching/cache_data_api.py#L587" + }, + "streamlit.cache_data.clear": { + "name": "cache_data.clear", + "signature": "st.cache_data.clear()", + "description": "

Clear all in-memory and on-disk data caches.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/runtime/caching/cache_data_api.py#L587" + }, + "streamlit.experimental_singleton.clear": { + "name": "experimental_singleton.clear", + "signature": "st.experimental_singleton.clear()", + "description": "

Clear all cache_resource caches.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/runtime/caching/cache_resource_api.py#L449" + }, + "streamlit.cache_resource.clear": { + "name": "cache_resource.clear", + "signature": "st.cache_resource.clear()", + "description": "

Clear all cache_resource caches.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/runtime/caching/cache_resource_api.py#L449" + }, + "streamlit.connections.ExperimentalBaseConnection": { + "name": "ExperimentalBaseConnection", + "signature": "st.connections.ExperimentalBaseConnection(connection_name, **kwargs)", + "is_class": true, + "methods": [ + { + "name": "reset", + "signature": "st.connections.reset.reset()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", + "description": "

Reset this connection so that it gets reinitialized the next time it's used.

", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/connections/base_connection.py#L137" + } + ], + "properties": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/connections/base_connection.py#L25", + "description": "

The abstract base class that all Streamlit Connections must inherit from.

\n

This base class provides connection authors with a standardized way to hook into the\nst.experimental_connection() factory function: connection authors are required to\nprovide an implementation for the abstract method _connect in their subclasses.

\n

Additionally, it also provides a few methods/properties designed to make\nimplementation of connections more convenient. See the docstrings for each of the\nmethods of this class for more information

\n
\n

Note

\n

While providing an implementation of _connect is technically all that's\nrequired to define a valid connection, connections should also provide the user\nwith context-specific ways of interacting with the underlying connection object.\nFor example, the first-party SQLConnection provides a query() method for\nreads and a session property for more complex operations.

\n
\n", + "args": [], + "returns": [] + }, + "streamlit.connections.SQLConnection": { + "name": "SQLConnection", + "signature": "st.connections.SQLConnection(connection_name, **kwargs)", + "is_class": true, + "methods": [ + { + "name": "query", + "signature": "st.connections.query.query(sql, *, ttl=None, index_col=None, chunksize=None, params=None, **kwargs)", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("sql")\ndf = conn.query("select * from pet_owners where owner = :owner", ttl=3600, params={"owner":"barbara"})\nst.dataframe(df)\n
\n
\n", + "description": "

Run a read-only query.

", + "args": [ + { + "name": "sql", + "type_name": "str", + "is_optional": false, + "description": "

The read-only SQL query to execute.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float, int, timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep results in the cache, or\nNone if cached results should not expire. The default is None.

\n", + "default": "None" + }, + { + "name": "index_col", + "type_name": "str, list of str, or None", + "is_optional": false, + "description": "

Column(s) to set as index(MultiIndex). Default is None.

\n", + "default": "None" + }, + { + "name": "chunksize", + "type_name": "int or None", + "is_optional": false, + "description": "

If specified, return an iterator where chunksize is the number of\nrows to include in each chunk. Default is None.

\n", + "default": "None" + }, + { + "name": "params", + "type_name": "list, tuple, dict or None", + "is_optional": false, + "description": "

List of parameters to pass to the execute method. The syntax used to pass\nparameters is database driver dependent. Check your database driver\ndocumentation for which of the five syntax styles, described in PEP 249\nparamstyle, is supported.\nDefault is None.

\n", + "default": "None" + }, + { + "name": "**kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

Additional keyword arguments are passed to pd.read_sql.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "pd.DataFrame", + "is_generator": false, + "description": "

The result of running the query, formatted as a pandas DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/connections/sql_connection.py#L121" + }, + { + "name": "reset", + "signature": "st.connections.reset.reset()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", + "description": "

Reset this connection so that it gets reinitialized the next time it's used.

", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/connections/base_connection.py#L137" + } + ], + "properties": [ + { + "name": "session", + "signature": "st.connections.session.session", + "example": "
\n
\nimport streamlit as st\nconn = st.experimental_connection("sql")\nn = st.slider("Pick a number")\nif st.button("Add the number!"):\n    with conn.session as session:\n        session.execute("INSERT INTO numbers (val) VALUES (:n);", {"n": n})\n        session.commit()\n
\n
\n", + "description": "

Return a SQLAlchemy Session.

", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/connections/sql_connection.py#L226" + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/connections/sql_connection.py#L45", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("sql")\ndf = conn.query("select * from pet_owners")\nst.dataframe(df)\n
\n
\n", + "description": "

A connection to a SQL database using a SQLAlchemy Engine. Initialize using st.experimental_connection("<name>", type="sql").

\n

SQLConnection provides the query() convenience method, which can be used to\nrun simple read-only queries with both caching and simple error handling/retries.\nMore complex DB interactions can be performed by using the .session property\nto receive a regular SQLAlchemy Session.

\n

SQLConnections should always be created using st.experimental_connection(),\nnot initialized directly. Connection parameters for a SQLConnection can be\nspecified using either st.secrets or **kwargs. Some frequently used\nparameters include:

\n
    \n
  • url or arguments for sqlalchemy.engine.URL.create().\nMost commonly it includes a dialect, host, database, username and password.
  • \n
  • create_engine_kwargs can be passed via st.secrets, such as for\nsnowflake-sqlalchemy\nor Google BigQuery.\nThese can also be passed directly as **kwargs to experimental_connection().
  • \n
  • autocommit=True to run with isolation level AUTOCOMMIT. Default is False.
  • \n
\n", + "args": [], + "returns": [] + }, + "streamlit.connections.SnowparkConnection": { + "name": "SnowparkConnection", + "signature": "st.connections.SnowparkConnection(connection_name, **kwargs)", + "is_class": true, + "methods": [ + { + "name": "query", + "signature": "st.connections.query.query(sql, ttl=None)", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("snowpark")\ndf = conn.query("select * from pet_owners")\nst.dataframe(df)\n
\n
\n", + "description": "

Run a read-only SQL query.

", + "args": [ + { + "name": "sql", + "type_name": "str", + "is_optional": false, + "description": "

The read-only SQL query to execute.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float, int, timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep results in the cache, or\nNone if cached results should not expire. The default is None.

\n", + "default": "None" + } + ], + "returns": [ + { + "type_name": "pd.DataFrame", + "is_generator": false, + "description": "

The result of running the query, formatted as a pandas DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/connections/snowpark_connection.py#L123" + }, + { + "name": "reset", + "signature": "st.connections.reset.reset()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", + "description": "

Reset this connection so that it gets reinitialized the next time it's used.

", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/connections/base_connection.py#L137" + }, + { + "name": "safe_session", + "signature": "st.connections.safe_session.safe_session()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("snowpark")\nwith conn.safe_session() as session:\n    df = session.table("mytable").limit(10).to_pandas()\n\nst.dataframe(df)\n
\n
\n", + "description": "

Grab the underlying Snowpark session in a thread-safe manner.

", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/connections/snowpark_connection.py#L207" + } + ], + "properties": [ + { + "name": "session", + "signature": "st.connections.session.session", + "example": "
\n
\nimport streamlit as st\n\nsession = st.experimental_connection("snowpark").session\ndf = session.table("mytable").limit(10).to_pandas()\nst.dataframe(df)\n
\n
\n", + "description": "

Access the underlying Snowpark session.

", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/connections/snowpark_connection.py#L184" + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/connections/snowpark_connection.py#L70", + "description": "

A connection to Snowpark using snowflake.snowpark.session.Session. Initialize using

\n

st.experimental_connection("<name>", type="snowpark").

\n

In addition to accessing the Snowpark Session, SnowparkConnection supports direct SQL querying using\nquery("...") and thread safe access using with conn.safe_session():. See methods\nbelow for more information. SnowparkConnections should always be created using\nst.experimental_connection(), not initialized directly.

\n
\n

Note

\n

We don't expect this iteration of SnowparkConnection to be able to scale\nwell in apps with many concurrent users due to the lock contention that will occur\nover the single underlying Session object under high load.

\n
\n", + "args": [], + "returns": [] + }, + "streamlit.connections.SQLConnection.query": { + "name": "query", + "signature": "SQLConnection.query(sql, *, ttl=None, index_col=None, chunksize=None, params=None, **kwargs)", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("sql")\ndf = conn.query("select * from pet_owners where owner = :owner", ttl=3600, params={"owner":"barbara"})\nst.dataframe(df)\n
\n
\n", + "description": "

Run a read-only query.

\n

This method implements both query result caching (with caching behavior\nidentical to that of using @st.cache_data) as well as simple error handling/retries.

\n
\n

Note

\n

Queries that are run without a specified ttl are cached indefinitely.

\n
\n

Aside from the ttl kwarg, all kwargs passed to this function are passed down\nto pd.read_sql\nand have the behavior described in the pandas documentation.

\n", + "args": [ + { + "name": "sql", + "type_name": "str", + "is_optional": false, + "description": "

The read-only SQL query to execute.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float, int, timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep results in the cache, or\nNone if cached results should not expire. The default is None.

\n", + "default": "None" + }, + { + "name": "index_col", + "type_name": "str, list of str, or None", + "is_optional": false, + "description": "

Column(s) to set as index(MultiIndex). Default is None.

\n", + "default": "None" + }, + { + "name": "chunksize", + "type_name": "int or None", + "is_optional": false, + "description": "

If specified, return an iterator where chunksize is the number of\nrows to include in each chunk. Default is None.

\n", + "default": "None" + }, + { + "name": "params", + "type_name": "list, tuple, dict or None", + "is_optional": false, + "description": "

List of parameters to pass to the execute method. The syntax used to pass\nparameters is database driver dependent. Check your database driver\ndocumentation for which of the five syntax styles, described in PEP 249\nparamstyle, is supported.\nDefault is None.

\n", + "default": "None" + }, + { + "name": "**kwargs", + "type_name": "dict", + "is_optional": false, + "description": "

Additional keyword arguments are passed to pd.read_sql.

\n", + "default": null + } + ], + "returns": [ + { + "type_name": "pd.DataFrame", + "is_generator": false, + "description": "

The result of running the query, formatted as a pandas DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/connections/sql_connection.py#L121" + }, + "streamlit.connections.SQLConnection.reset": { + "name": "reset", + "signature": "SQLConnection.reset()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", + "description": "

Reset this connection so that it gets reinitialized the next time it's used.

\n

This method can be useful when a connection has become stale, an auth token has\nexpired, or in similar scenarios where a broken connection might be fixed by\nreinitializing it. Note that some connection methods may already use reset()\nin their error handling code.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/connections/base_connection.py#L137" + }, + "streamlit.connections.SQLConnection.session": { + "name": "session", + "signature": "SQLConnection.session", + "example": "
\n
\nimport streamlit as st\nconn = st.experimental_connection("sql")\nn = st.slider("Pick a number")\nif st.button("Add the number!"):\n    with conn.session as session:\n        session.execute("INSERT INTO numbers (val) VALUES (:n);", {"n": n})\n        session.commit()\n
\n
\n", + "description": "

Return a SQLAlchemy Session.

\n

Users of this connection should use the contextmanager pattern for writes,\ntransactions, and anything more complex than simple read queries.

\n

See the usage example below, which assumes we have a table numbers with a\nsingle integer column val. The SQLAlchemy docs also contain\nmuch more information on the usage of sessions.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/connections/sql_connection.py#L226" + }, + "streamlit.connections.SnowparkConnection.query": { + "name": "query", + "signature": "SnowparkConnection.query(sql, ttl=None)", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("snowpark")\ndf = conn.query("select * from pet_owners")\nst.dataframe(df)\n
\n
\n", + "description": "

Run a read-only SQL query.

\n

This method implements both query result caching (with caching behavior\nidentical to that of using @st.cache_data) as well as simple error handling/retries.

\n
\n

Note

\n

Queries that are run without a specified ttl are cached indefinitely.

\n
\n", + "args": [ + { + "name": "sql", + "type_name": "str", + "is_optional": false, + "description": "

The read-only SQL query to execute.

\n", + "default": null + }, + { + "name": "ttl", + "type_name": "float, int, timedelta or None", + "is_optional": false, + "description": "

The maximum number of seconds to keep results in the cache, or\nNone if cached results should not expire. The default is None.

\n", + "default": "None" + } + ], + "returns": [ + { + "type_name": "pd.DataFrame", + "is_generator": false, + "description": "

The result of running the query, formatted as a pandas DataFrame.

\n", + "return_name": null + } + ], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/connections/snowpark_connection.py#L123" + }, + "streamlit.connections.SnowparkConnection.reset": { + "name": "reset", + "signature": "SnowparkConnection.reset()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", + "description": "

Reset this connection so that it gets reinitialized the next time it's used.

\n

This method can be useful when a connection has become stale, an auth token has\nexpired, or in similar scenarios where a broken connection might be fixed by\nreinitializing it. Note that some connection methods may already use reset()\nin their error handling code.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/connections/base_connection.py#L137" + }, + "streamlit.connections.SnowparkConnection.safe_session": { + "name": "safe_session", + "signature": "SnowparkConnection.safe_session()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("snowpark")\nwith conn.safe_session() as session:\n    df = session.table("mytable").limit(10).to_pandas()\n\nst.dataframe(df)\n
\n
\n", + "description": "

Grab the underlying Snowpark session in a thread-safe manner.

\n

As operations on a Snowpark session are not thread safe, we need to take care\nwhen using a session in the context of a Streamlit app where each script run\noccurs in its own thread. Using the contextmanager pattern to do this ensures\nthat access on this connection's underlying Session is done in a thread-safe\nmanner.

\n

Information on how to use Snowpark sessions can be found in the Snowpark documentation.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/connections/snowpark_connection.py#L207" + }, + "streamlit.connections.SnowparkConnection.session": { + "name": "session", + "signature": "SnowparkConnection.session", + "example": "
\n
\nimport streamlit as st\n\nsession = st.experimental_connection("snowpark").session\ndf = session.table("mytable").limit(10).to_pandas()\nst.dataframe(df)\n
\n
\n", + "description": "

Access the underlying Snowpark session.

\n
\n

Note

\n

Snowpark sessions are not thread safe. Users of this method are\nresponsible for ensuring that access to the session returned by this method is\ndone in a thread-safe manner. For most users, we recommend using the thread-safe\nsafe_session() method and a with block.

\n
\n

Information on how to use Snowpark sessions can be found in the Snowpark documentation.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/connections/snowpark_connection.py#L184" + }, + "streamlit.connections.ExperimentalBaseConnection.reset": { + "name": "reset", + "signature": "ExperimentalBaseConnection.reset()", + "example": "
\n
\nimport streamlit as st\n\nconn = st.experimental_connection("my_conn")\n\n# Reset the connection before using it if it isn't healthy\n# Note: is_healthy() isn't a real method and is just shown for example here.\nif not conn.is_healthy():\n    conn.reset()\n\n# Do stuff with conn...\n
\n
\n", + "description": "

Reset this connection so that it gets reinitialized the next time it's used.

\n

This method can be useful when a connection has become stale, an auth token has\nexpired, or in similar scenarios where a broken connection might be fixed by\nreinitializing it. Note that some connection methods may already use reset()\nin their error handling code.

\n", + "args": [], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/connections/base_connection.py#L137" + }, + "streamlit.column_config.BarChartColumn": { + "name": "BarChartColumn", + "signature": "st.column_config.BarChartColumn(label=None, *, width=None, help=None, y_min=None, y_max=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "sales": [\n            [0, 4, 26, 80, 100, 40],\n            [80, 20, 80, 35, 40, 100],\n            [10, 20, 80, 80, 70, 0],\n            [10, 100, 20, 100, 30, 100],\n        ],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "sales": st.column_config.BarChartColumn(\n            "Sales (last 6 months)",\n            help="The sales volume in the last 6 months",\n            y_min=0,\n            y_max=100,\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a bar chart column in st.dataframe or st.data_editor.

\n

Cells need to contain a list of numbers. Chart columns are not editable\nat the moment. This command needs to be used in the column_config parameter\nof st.dataframe or st.data_editor.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", + "default": null + }, + { + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", + "is_optional": false, + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null + }, + { + "name": "y_min", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The minimum value on the y-axis for all cells in the column.\nIf None (default), every cell will use the minimum of its data.

\n", + "default": null + }, + { + "name": "y_max", + "type_name": "int, float, or None", + "is_optional": false, + "description": "

The maximum value on the y-axis for all cells in the column. If None (default),\nevery cell will use the maximum of its data.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/lib/column_types.py#L745" + }, + "streamlit.column_config.CheckboxColumn": { + "name": "CheckboxColumn", + "signature": "st.column_config.CheckboxColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "widgets": ["st.selectbox", "st.number_input", "st.text_area", "st.button"],\n        "favorite": [True, False, False, True],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "favorite": st.column_config.CheckboxColumn(\n            "Your favorite?",\n            help="Select your **favorite** widgets",\n            default=False,\n        )\n    },\n    disabled=["widgets"],\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a checkbox column in st.dataframe or st.data_editor.

\n

This is the default column type for boolean values. This command needs to be used in\nthe column_config parameter of st.dataframe or st.data_editor.\nWhen used with st.data_editor, editing will be enabled with a checkbox widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", "default": null }, { - "name": "args", - "type_name": "tuple", + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", "is_optional": false, - "description": "

An optional tuple of args to pass to the callback.

\n", + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", "default": null }, { - "name": "kwargs", - "type_name": "dict", + "name": "help", + "type_name": "str or None", "is_optional": false, - "description": "

An optional dict of kwargs to pass to the callback.

\n", + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", "default": null }, { - "name": "placeholder", - "type_name": "str", + "name": "disabled", + "type_name": "bool or None", "is_optional": false, - "description": "

A string to display when no options are selected. Defaults to 'Select...'.

\n

A selectbox can't be empty, so a placeholder only displays while a\nuser's cursor is in a selectbox after manually deleting the current\nselection. A future update will allow selectboxes to be empty.

\n", - "default": "s" + "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", + "default": "False" }, { - "name": "disabled", - "type_name": "bool", + "name": "required", + "type_name": "bool or None", "is_optional": false, - "description": "

An optional boolean, which disables the selectbox if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", "default": "False" }, { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "name": "default", + "type_name": "bool or None", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" - } - ], - "returns": [ - { - "type_name": "any", - "is_generator": false, - "description": "

The selected option

\n", - "return_name": null + "description": "

Specifies the default value in this column when a new row is added by the user.

\n", + "default": "value" } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/selectbox.py#L72" + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/lib/column_types.py#L565" }, - "DeltaGenerator.slider": { - "name": "slider", - "signature": "element.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "examples": "
\n
\nimport streamlit as st\n\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nimport streamlit as st\n\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nimport streamlit as st\nfrom datetime import time\n\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nimport streamlit as st\nfrom datetime import datetime\n\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n
\n", - "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n
\n

Note

\n

Integer values exceeding +/- (1<<53) - 1 cannot be accurately\nstored or returned by the widget due to serialization contstraints\nbetween the Python server and JavaScript client. You must handle\nsuch numbers as floats, leading to a loss in precision.

\n
\n", + "streamlit.column_config.Column": { + "name": "Column", + "signature": "st.column_config.Column(label=None, *, width=None, help=None, disabled=None, required=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "widgets": ["st.selectbox", "st.number_input", "st.text_area", "st.button"],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "widgets": st.column_config.Column(\n            "Streamlit Widgets",\n            help="Streamlit **widget** commands \ud83c\udf88",\n            width="medium",\n            required=True,\n        )\n    },\n    hide_index=True,\n    num_rows="dynamic",\n)\n
\n\n \n
\n", + "description": "

Configure a generic column in st.dataframe or st.data_editor.

\n

The type of the column will be automatically inferred from the data type.\nThis command needs to be used in the column_config parameter of st.dataframe\nor st.data_editor.

\n

To change the type of the column and enable type-specific configuration options,\nuse one of the column types in the st.column_config namespace,\ne.g. st.column_config.NumberColumn.

\n", "args": [ { "name": "label", - "type_name": "str", + "type_name": "str or None", "is_optional": false, - "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", "default": null }, { - "name": "min_value", - "type_name": "a supported type or None", + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", "is_optional": false, - "description": "

The minimum permitted value.\nDefaults to 0 if the value is an int, 0.0 if a float,\nvalue - timedelta(days=14) if a date/datetime, time.min if a time

\n", - "default": "0" + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null }, { - "name": "max_value", - "type_name": "a supported type or None", + "name": "help", + "type_name": "str or None", "is_optional": false, - "description": "

The maximum permitted value.\nDefaults to 100 if the value is an int, 1.0 if a float,\nvalue + timedelta(days=14) if a date/datetime, time.max if a time

\n", - "default": "100" + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null }, { - "name": "value", - "type_name": "a supported type or a tuple/list of supported types or None", + "name": "disabled", + "type_name": "bool or None", "is_optional": false, - "description": "

The value of the slider when it first renders. If a tuple/list\nof two values is passed here, then a range slider with those lower\nand upper bounds is rendered. For example, if set to (1, 10) the\nslider will have a selectable range between 1 and 10.\nDefaults to min_value.

\n", - "default": "min_value" + "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", + "default": "False" }, { - "name": "step", - "type_name": "int, float, timedelta, or None", + "name": "required", + "type_name": "bool or None", "is_optional": false, - "description": "

The stepping interval.\nDefaults to 1 if the value is an int, 0.01 if a float,\ntimedelta(days=1) if a date/datetime, timedelta(minutes=15) if a time\n(or if max_value - min_value < 1 day)

\n", - "default": "1" - }, + "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", + "default": "False" + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/lib/column_types.py#L187" + }, + "streamlit.column_config.DateColumn": { + "name": "DateColumn", + "signature": "st.column_config.DateColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, format=None, min_value=None, max_value=None, step=None)", + "examples": "
\n
\nfrom datetime import date\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "birthday": [\n            date(1980, 1, 1),\n            date(1990, 5, 3),\n            date(1974, 5, 19),\n            date(2001, 8, 17),\n        ]\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "birthday": st.column_config.DateColumn(\n            "Birthday",\n            min_value=date(1900, 1, 1),\n            max_value=date(2005, 1, 1),\n            format="DD.MM.YYYY",\n            step=1,\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a date column in st.dataframe or st.data_editor.

\n

This is the default column type for date values. This command needs to be used in\nthe column_config parameter of st.dataframe or st.data_editor. When used\nwith st.data_editor, editing will be enabled with a date picker widget.

\n", + "args": [ { - "name": "format", + "name": "label", "type_name": "str or None", "is_optional": false, - "description": "

A printf-style format string controlling how the interface should\ndisplay numbers. This does not impact the return value.\nFormatter for int/float supports: %d %e %f %g %i\nFormatter for date/time/datetime uses Moment.js notation:\nhttps://momentjs.com/docs/#/displaying/format/

\n", + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", "default": null }, { - "name": "key", - "type_name": "str or int", + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", "is_optional": false, - "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", "default": null }, { "name": "help", - "type_name": "str", + "type_name": "str or None", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the slider.

\n", + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", "default": null }, { - "name": "on_change", - "type_name": "callable", + "name": "disabled", + "type_name": "bool or None", "is_optional": false, - "description": "

An optional callback invoked when this slider's value changes.

\n", - "default": null + "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", + "default": "False" }, { - "name": "args", - "type_name": "tuple", + "name": "required", + "type_name": "bool or None", "is_optional": false, - "description": "

An optional tuple of args to pass to the callback.

\n", - "default": null + "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", + "default": "False" }, { - "name": "kwargs", - "type_name": "dict", + "name": "default", + "type_name": "datetime.date or None", "is_optional": false, - "description": "

An optional dict of kwargs to pass to the callback.

\n", + "description": "

Specifies the default value in this column when a new row is added by the user.

\n", + "default": "value" + }, + { + "name": "format", + "type_name": "str or None", + "is_optional": false, + "description": "

A momentJS format string controlling how times are displayed. See\nmomentJS docs for available\nformats. If None (default), uses YYYY-MM-DD.

\n", "default": null }, { - "name": "disabled", - "type_name": "bool", + "name": "min_value", + "type_name": "datetime.date or None", "is_optional": false, - "description": "

An optional boolean, which disables the slider if set to True. The\ndefault is False. This argument can only be supplied by keyword.

\n", - "default": "False" + "description": "

The minimum date that can be entered.\nIf None (default), there will be no minimum.

\n", + "default": null }, { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "name": "max_value", + "type_name": "datetime.date or None", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" - } - ], - "returns": [ + "description": "

The maximum date that can be entered.\nIf None (default), there will be no maximum.

\n", + "default": null + }, { - "type_name": "int/float/date/time/datetime or tuple of int/float/date/time/datetime", - "is_generator": false, - "description": "

The current value of the slider widget. The return type will match\nthe data type of the value parameter.

\n", - "return_name": null + "name": "step", + "type_name": "int or None", + "is_optional": false, + "description": "

The stepping interval in days. If None (default), the step will be 1 day.

\n", + "default": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/slider.py#L173" - }, - "DeltaGenerator.snow": { - "name": "snow", - "signature": "element.snow()", - "example": "
\n
\nimport streamlit as st\n\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", - "description": "

Draw celebratory snowfall.

\n", - "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/snow.py#L25" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/lib/column_types.py#L1277" }, - "DeltaGenerator.status": { - "name": "status", - "signature": "element.status(label, *, expanded=False, state=\"running\")", - "examples": "
\n

You can use with notation to insert any element into an status container:

\n
\nimport time\nimport streamlit as st\n\nwith st.status("Downloading data..."):\n    st.write("Searching for data...")\n    time.sleep(2)\n    st.write("Found URL.")\n    time.sleep(1)\n    st.write("Downloading data...")\n    time.sleep(1)\n\nst.button('Rerun')\n
\n\n \n

You can also use .update() on the container to change the label, state,\nor expanded state:

\n
\nimport time\nimport streamlit as st\n\nwith st.status("Downloading data...", expanded=True) as status:\n    st.write("Searching for data...")\n    time.sleep(2)\n    st.write("Found URL.")\n    time.sleep(1)\n    st.write("Downloading data...")\n    time.sleep(1)\n    status.update(label="Download complete!", state="complete", expanded=False)\n\nst.button('Rerun')\n
\n\n \n
\n", - "description": "

Insert a status container to display output from long-running tasks.

\n

Inserts a container into your app that is typically used to show the status and\ndetails of a process or task. The container can hold multiple elements and can\nbe expanded or collapsed by the user similar to st.expander.\nWhen collapsed, all that is visible is the status icon and label.

\n

The label, state, and expanded state can all be updated by calling .update()\non the returned object. To add elements to the returned container, you can\nuse "with" notation (preferred) or just call methods directly on the returned\nobject.

\n

By default, st.status() initializes in the "running" state. When called using\n"with" notation, it automatically updates to the "complete" state at the end\nof the "with" block. See examples below for more details.

\n", + "streamlit.column_config.DatetimeColumn": { + "name": "DatetimeColumn", + "signature": "st.column_config.DatetimeColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, format=None, min_value=None, max_value=None, step=None, timezone=None)", + "examples": "
\n
\nfrom datetime import datetime\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "appointment": [\n            datetime(2024, 2, 5, 12, 30),\n            datetime(2023, 11, 10, 18, 0),\n            datetime(2024, 3, 11, 20, 10),\n            datetime(2023, 9, 12, 3, 0),\n        ]\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "appointment": st.column_config.DatetimeColumn(\n            "Appointment",\n            min_value=datetime(2023, 6, 1),\n            max_value=datetime(2025, 1, 1),\n            format="D MMM YYYY, h:mm a",\n            step=60,\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a datetime column in st.dataframe or st.data_editor.

\n

This is the default column type for datetime values. This command needs to be\nused in the column_config parameter of st.dataframe or\nst.data_editor. When used with st.data_editor, editing will be enabled\nwith a datetime picker widget.

\n", "args": [ { "name": "label", - "type_name": "str", + "type_name": "str or None", "is_optional": false, - "description": "

The initial label of the status container. The label can optionally\ncontain Markdown and supports the following elements: Bold,\nItalics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents)\nrender. Display unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", "default": null }, { - "name": "expanded", - "type_name": "bool", + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", "is_optional": false, - "description": "

If True, initializes the status container in "expanded" state. Defaults to\nFalse (collapsed).

\n", - "default": "s" + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null }, { - "name": "state", - "type_name": "\"running\", \"complete\", or \"error\"", + "name": "help", + "type_name": "str or None", "is_optional": false, - "description": "

The initial state of the status container which determines which icon is\nshown:

\n
    \n
  • running (default): A spinner icon is shown.
  • \n
  • complete: A checkmark icon is shown.
  • \n
  • error: An error icon is shown.
  • \n
\n", + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", "default": null - } - ], - "returns": [ + }, { - "type_name": "StatusContainer", - "is_generator": false, - "description": "

A mutable status container that can hold multiple elements. The label, state,\nand expanded state can be updated after creation via .update().

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/layouts.py#L414" - }, - "DeltaGenerator.subheader": { - "name": "subheader", - "signature": "element.subheader(body, anchor=None, *, help=None, divider=False)", - "examples": "
\n
\nimport streamlit as st\n\nst.subheader('This is a subheader with a divider', divider='rainbow')\nst.subheader('_Streamlit_ is :blue[cool] :sunglasses:')\n
\n\n \n
\n", - "description": "

Display text in subheader formatting.

\n", - "args": [ + "name": "disabled", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", + "default": "False" + }, { - "name": "body", - "type_name": "str", + "name": "required", + "type_name": "bool or None", "is_optional": false, - "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", - "default": null + "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", + "default": "False" }, { - "name": "anchor", - "type_name": "str or False", + "name": "default", + "type_name": "datetime.datetime or None", "is_optional": false, - "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", - "default": null + "description": "

Specifies the default value in this column when a new row is added by the user.

\n", + "default": "value" }, { - "name": "help", - "type_name": "str", + "name": "format", + "type_name": "str or None", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the subheader.

\n", + "description": "

A momentJS format string controlling how datetimes are displayed. See\nmomentJS docs for available\nformats. If None (default), uses YYYY-MM-DD HH:mm:ss.

\n", "default": null }, { - "name": "divider", - "type_name": "bool or \u201cblue\u201d, \u201cgreen\u201d, \u201corange\u201d, \u201cred\u201d, \u201cviolet\u201d, \u201cgray\u201d/\"grey\", or \u201crainbow\u201d", + "name": "min_value", + "type_name": "datetime.datetime or None", "is_optional": false, - "description": "

Shows a colored divider below the header. If True, successive\nheaders will cycle through divider colors. That is, the first\nheader will have a blue line, the second header will have a\ngreen line, and so on. If a string, the color can be set to one of\nthe following: blue, green, orange, red, violet, gray/grey, or\nrainbow.

\n", + "description": "

The minimum datetime that can be entered.\nIf None (default), there will be no minimum.

\n", "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/heading.py#L111" - }, - "DeltaGenerator.success": { - "name": "success", - "signature": "element.success(body, *, icon=None)", - "example": "
\n
\nimport streamlit as st\n\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", - "description": "

Display a success message.

\n", - "args": [ + }, { - "name": "body", - "type_name": "str", + "name": "max_value", + "type_name": "datetime.datetime or None", "is_optional": false, - "description": "

The success text to display.

\n", + "description": "

The maximum datetime that can be entered.\nIf None (default), there will be no maximum.

\n", "default": null }, { - "name": "icon", - "type_name": "str or None", + "name": "step", + "type_name": "int, float, datetime.timedelta, or None", "is_optional": false, - "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", - "default": "None" - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/alert.py#L124" - }, - "DeltaGenerator.table": { - "name": "table", - "signature": "element.table(data=None)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n
\n", - "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", - "args": [ + "description": "

The stepping interval in seconds. If None (default), the step will be 1 second.

\n", + "default": null + }, { - "name": "data", - "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, snowflake.snowpark.table.Table, Iterable, dict, or None", + "name": "timezone", + "type_name": "str or None", "is_optional": false, - "description": "

The table data.\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "description": "

The timezone of this column. If None (default),\nthe timezone is inferred from the underlying data.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L193" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/lib/column_types.py#L1042" }, - "DeltaGenerator.tabs": { - "name": "tabs", - "signature": "element.tabs(tabs)", - "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\nimport streamlit as st\n\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n
\n", - "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", + "streamlit.column_config.ImageColumn": { + "name": "ImageColumn", + "signature": "st.column_config.ImageColumn(label=None, *, width=None, help=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "apps": [\n            "https://storage.googleapis.com/s4a-prod-share-preview/default/st_app_screenshot_image/5435b8cb-6c6c-490b-9608-799b543655d3/Home_Page.png",\n            "https://storage.googleapis.com/s4a-prod-share-preview/default/st_app_screenshot_image/ef9a7627-13f2-47e5-8f65-3f69bb38a5c2/Home_Page.png",\n            "https://storage.googleapis.com/s4a-prod-share-preview/default/st_app_screenshot_image/31b99099-8eae-4ff8-aa89-042895ed3843/Home_Page.png",\n            "https://storage.googleapis.com/s4a-prod-share-preview/default/st_app_screenshot_image/6a399b09-241e-4ae7-a31f-7640dc1d181e/Home_Page.png",\n        ],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "apps": st.column_config.ImageColumn(\n            "Preview Image", help="Streamlit app preview screenshots"\n        )\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure an image column in st.dataframe or st.data_editor.

\n

The cell values need to be one of:

\n
    \n
  • A URL to fetch the image from. This can also be a relative URL of an image\ndeployed via static file serving.\nNote that you can NOT use an arbitrary local image if it is not available through\na public URL.
  • \n
  • A data URL containing an SVG XML like data:image/svg+xml;utf8,<svg xmlns=...</svg>.
  • \n
  • A data URL containing a Base64 encoded image like data:image/png;base64,iVBO....
  • \n
\n

Image columns are not editable at the moment. This command needs to be used in the\ncolumn_config parameter of st.dataframe or st.data_editor.

\n", "args": [ { - "name": "tabs", - "type_name": "list of strings", + "name": "label", + "type_name": "str or None", "is_optional": false, - "description": "

Creates a tab for each string in the list. The first tab is selected by default.\nThe string is used as the name of the tab and can optionally contain Markdown,\nsupporting the following elements: Bold, Italics, Strikethroughs, Inline Code,\nEmojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", "default": null - } - ], - "returns": [ - { - "type_name": "list of containers", - "is_generator": false, - "description": "

A list of container objects.

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/layouts.py#L207" - }, - "DeltaGenerator.text": { - "name": "text", - "signature": "element.text(body, *, help=None)", - "example": "
\n
\nimport streamlit as st\n\nst.text('This is some text.')\n
\n
\n", - "description": "

Write fixed-width and preformatted text.

\n", - "args": [ + }, { - "name": "body", - "type_name": "str", + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", "is_optional": false, - "description": "

The string to display.

\n", + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", "default": null }, { "name": "help", - "type_name": "str", + "type_name": "str or None", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the text.

\n", + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/text.py#L27" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/lib/column_types.py#L906" }, - "DeltaGenerator.text_area": { - "name": "text_area", - "signature": "element.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", - "description": "

Display a multi-line text input widget.

\n", + "streamlit.column_config.LineChartColumn": { + "name": "LineChartColumn", + "signature": "st.column_config.LineChartColumn(label=None, *, width=None, help=None, y_min=None, y_max=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "sales": [\n            [0, 4, 26, 80, 100, 40],\n            [80, 20, 80, 35, 40, 100],\n            [10, 20, 80, 80, 70, 0],\n            [10, 100, 20, 100, 30, 100],\n        ],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "sales": st.column_config.LineChartColumn(\n            "Sales (last 6 months)",\n            width="medium",\n            help="The sales volume in the last 6 months",\n            y_min=0,\n            y_max=100,\n         ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a line chart column in st.dataframe or st.data_editor.

\n

Cells need to contain a list of numbers. Chart columns are not editable\nat the moment. This command needs to be used in the column_config parameter\nof st.dataframe or st.data_editor.

\n", "args": [ { "name": "label", - "type_name": "str", + "type_name": "str or None", "is_optional": false, - "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", "default": null }, { - "name": "value", - "type_name": "object", + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", "is_optional": false, - "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", "default": null }, { - "name": "height", - "type_name": "int or None", + "name": "help", + "type_name": "str or None", "is_optional": false, - "description": "

Desired height of the UI element expressed in pixels. If None, a\ndefault height is used.

\n", - "default": "height" + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", + "default": null }, { - "name": "max_chars", - "type_name": "int or None", + "name": "y_min", + "type_name": "int, float, or None", "is_optional": false, - "description": "

Maximum number of characters allowed in text area.

\n", + "description": "

The minimum value on the y-axis for all cells in the column.\nIf None (default), every cell will use the minimum of its data.

\n", "default": null }, { - "name": "key", - "type_name": "str or int", + "name": "y_max", + "type_name": "int, float, or None", "is_optional": false, - "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "description": "

The maximum value on the y-axis for all cells in the column. If None (default),\nevery cell will use the maximum of its data.

\n", "default": null - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/lib/column_types.py#L825" + }, + "streamlit.column_config.LinkColumn": { + "name": "LinkColumn", + "signature": "st.column_config.LinkColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, max_chars=None, validate=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "apps": [\n            "https://roadmap.streamlit.app",\n            "https://extras.streamlit.app",\n            "https://issues.streamlit.app",\n            "https://30days.streamlit.app",\n        ],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "apps": st.column_config.LinkColumn(\n            "Trending apps",\n            help="The top trending Streamlit apps",\n            validate="^https://[a-z]+\\.streamlit\\.app$",\n            max_chars=100,\n        )\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a link column in st.dataframe or st.data_editor.

\n

The cell values need to be string and will be shown as clickable links.\nThis command needs to be used in the column_config parameter of st.dataframe\nor st.data_editor. When used with st.data_editor, editing will be enabled\nwith a text input widget.

\n", + "args": [ { - "name": "help", - "type_name": "str", + "name": "label", + "type_name": "str or None", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the textarea.

\n", + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", "default": null }, { - "name": "on_change", - "type_name": "callable", + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", "is_optional": false, - "description": "

An optional callback invoked when this text_area's value changes.

\n", + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", "default": null }, { - "name": "args", - "type_name": "tuple", + "name": "help", + "type_name": "str or None", "is_optional": false, - "description": "

An optional tuple of args to pass to the callback.

\n", + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", "default": null }, { - "name": "kwargs", - "type_name": "dict", + "name": "disabled", + "type_name": "bool or None", "is_optional": false, - "description": "

An optional dict of kwargs to pass to the callback.

\n", - "default": null + "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", + "default": "False" }, { - "name": "placeholder", - "type_name": "str or None", + "name": "required", + "type_name": "bool or None", "is_optional": false, - "description": "

An optional string displayed when the text area is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", - "default": null + "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", + "default": "False" }, { - "name": "disabled", - "type_name": "bool", + "name": "default", + "type_name": "str or None", "is_optional": false, - "description": "

An optional boolean, which disables the text area if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", - "default": "False" + "description": "

Specifies the default value in this column when a new row is added by the user.

\n", + "default": "value" }, { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "name": "max_chars", + "type_name": "int or None", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" - } - ], - "returns": [ + "description": "

The maximum number of characters that can be entered. If None (default),\nthere will be no maximum.

\n", + "default": null + }, { - "type_name": "str", - "is_generator": false, - "description": "

The current value of the text input widget.

\n", - "return_name": null + "name": "validate", + "type_name": "str or None", + "is_optional": false, + "description": "

A regular expression (JS flavor, e.g. "^https://.+$") that edited values are validated against.\nIf the input is invalid, it will not be submitted.

\n", + "default": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/text_widgets.py#L288" + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/lib/column_types.py#L466" }, - "DeltaGenerator.text_input": { - "name": "text_input", - "signature": "element.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n
\n", - "description": "

Display a single-line text input widget.

\n", + "streamlit.column_config.ListColumn": { + "name": "ListColumn", + "signature": "st.column_config.ListColumn(label=None, *, width=None, help=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "sales": [\n            [0, 4, 26, 80, 100, 40],\n            [80, 20, 80, 35, 40, 100],\n            [10, 20, 80, 80, 70, 0],\n            [10, 100, 20, 100, 30, 100],\n        ],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "sales": st.column_config.ListColumn(\n            "Sales (last 6 months)",\n            help="The sales volume in the last 6 months",\n            width="medium",\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a list column in st.dataframe or st.data_editor.

\n

This is the default column type for list-like values. List columns are not editable\nat the moment. This command needs to be used in the column_config parameter of\nst.dataframe or st.data_editor.

\n", "args": [ { "name": "label", - "type_name": "str", + "type_name": "str or None", "is_optional": false, - "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", "default": null }, { - "name": "value", - "type_name": "object", + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", "is_optional": false, - "description": "

The text value of this widget when it first renders. This will be\ncast to str internally.

\n", + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", "default": null }, { - "name": "max_chars", - "type_name": "int or None", + "name": "help", + "type_name": "str or None", "is_optional": false, - "description": "

Max number of characters allowed in text input.

\n", + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", "default": null - }, + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/lib/column_types.py#L977" + }, + "streamlit.column_config.NumberColumn": { + "name": "NumberColumn", + "signature": "st.column_config.NumberColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, format=None, min_value=None, max_value=None, step=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "price": [20, 950, 250, 500],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "price": st.column_config.NumberColumn(\n            "Price (in USD)",\n            help="The price of the product in USD",\n            min_value=0,\n            max_value=1000,\n            step=1,\n            format="$%d",\n        )\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a number column in st.dataframe or st.data_editor.

\n

This is the default column type for integer and float values. This command needs to\nbe used in the column_config parameter of st.dataframe or st.data_editor.\nWhen used with st.data_editor, editing will be enabled with a numeric input widget.

\n", + "args": [ { - "name": "key", - "type_name": "str or int", + "name": "label", + "type_name": "str or None", "is_optional": false, - "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", "default": null }, { - "name": "type", - "type_name": "\"default\" or \"password\"", + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", "is_optional": false, - "description": "

The type of the text input. This can be either "default" (for\na regular text input), or "password" (for a text input that\nmasks the user's typed value). Defaults to "default".

\n", - "default": "s" + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null }, { "name": "help", - "type_name": "str", + "type_name": "str or None", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the input.

\n", + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", "default": null }, { - "name": "autocomplete", - "type_name": "str", + "name": "disabled", + "type_name": "bool or None", "is_optional": false, - "description": "

An optional value that will be passed to the <input> element's\nautocomplete property. If unspecified, this value will be set to\n"new-password" for "password" inputs, and the empty string for\n"default" inputs. For more details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

\n", - "default": null + "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", + "default": "False" }, { - "name": "on_change", - "type_name": "callable", + "name": "required", + "type_name": "bool or None", "is_optional": false, - "description": "

An optional callback invoked when this text input's value changes.

\n", - "default": null + "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", + "default": "False" }, { - "name": "args", - "type_name": "tuple", + "name": "default", + "type_name": "int, float, or None", "is_optional": false, - "description": "

An optional tuple of args to pass to the callback.

\n", - "default": null + "description": "

Specifies the default value in this column when a new row is added by the user.

\n", + "default": "value" }, { - "name": "kwargs", - "type_name": "dict", + "name": "format", + "type_name": "str or None", "is_optional": false, - "description": "

An optional dict of kwargs to pass to the callback.

\n", + "description": "

A printf-style format string controlling how numbers are displayed.\nThis does not impact the return value. Valid formatters: %d %e %f %g %i %u.\nYou can also add prefixes and suffixes, e.g. "$ %.2f" to show a dollar prefix.

\n", "default": null }, { - "name": "placeholder", - "type_name": "str or None", + "name": "min_value", + "type_name": "int, float, or None", "is_optional": false, - "description": "

An optional string displayed when the text input is empty. If None,\nno text is displayed. This argument can only be supplied by keyword.

\n", + "description": "

The minimum value that can be entered.\nIf None (default), there will be no minimum.

\n", "default": null }, { - "name": "disabled", - "type_name": "bool", + "name": "max_value", + "type_name": "int, float, or None", "is_optional": false, - "description": "

An optional boolean, which disables the text input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", - "default": "False" + "description": "

The maximum value that can be entered.\nIf None (default), there will be no maximum.

\n", + "default": null }, { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "name": "step", + "type_name": "int, float, or None", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" - } - ], - "returns": [ - { - "type_name": "str", - "is_generator": false, - "description": "

The current value of the text input widget.

\n", - "return_name": null + "description": "

The stepping interval. Specifies the precision of numbers that can be entered.\nIf None (default), uses 1 for integers and unrestricted precision for floats.

\n", + "default": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/text_widgets.py#L72" + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/lib/column_types.py#L262" }, - "DeltaGenerator.time_input": { - "name": "time_input", - "signature": "element.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", step=0:15:00)", - "example": "
\n
\nimport datetime\nimport streamlit as st\n\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n
\n", - "description": "

Display a time input widget.

\n", + "streamlit.column_config.ProgressColumn": { + "name": "ProgressColumn", + "signature": "st.column_config.ProgressColumn(label=None, *, width=None, help=None, format=None, min_value=None, max_value=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "sales": [200, 550, 1000, 80],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "sales": st.column_config.ProgressColumn(\n            "Sales volume",\n            help="The sales volume in USD",\n            format="$%f",\n            min_value=0,\n            max_value=1000,\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a progress column in st.dataframe or st.data_editor.

\n

Cells need to contain a number. Progress columns are not editable at the moment.\nThis command needs to be used in the column_config parameter of st.dataframe\nor st.data_editor.

\n", "args": [ { "name": "label", - "type_name": "str", + "type_name": "str or None", "is_optional": false, - "description": "

A short label explaining to the user what this time input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", "default": null }, { - "name": "value", - "type_name": "datetime.time/datetime.datetime", + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", "is_optional": false, - "description": "

The value of this widget when it first renders. This will be\ncast to str internally. Defaults to the current time.

\n", - "default": "the" + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null }, { - "name": "key", - "type_name": "str or int", + "name": "help", + "type_name": "str or None", "is_optional": false, - "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", "default": null }, { - "name": "help", - "type_name": "str", + "name": "format", + "type_name": "str or None", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the input.

\n", + "description": "

A printf-style format string controlling how numbers are displayed.\nValid formatters: %d %e %f %g %i %u. You can also add prefixes and suffixes,\ne.g. "$ %.2f" to show a dollar prefix.

\n", "default": null }, { - "name": "on_change", - "type_name": "callable", + "name": "min_value", + "type_name": "int, float, or None", "is_optional": false, - "description": "

An optional callback invoked when this time_input's value changes.

\n", + "description": "

The minimum value of the progress bar.\nIf None (default), will be 0.

\n", "default": null }, { - "name": "args", - "type_name": "tuple", + "name": "max_value", + "type_name": "int, float, or None", "is_optional": false, - "description": "

An optional tuple of args to pass to the callback.

\n", + "description": "

The minimum value of the progress bar. If None (default), will be 100 for\ninteger values and 1 for float values.

\n", + "default": null + } + ], + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/lib/column_types.py#L1390" + }, + "streamlit.column_config.SelectboxColumn": { + "name": "SelectboxColumn", + "signature": "st.column_config.SelectboxColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, options=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "category": [\n            "\ud83d\udcca Data Exploration",\n            "\ud83d\udcc8 Data Visualization",\n            "\ud83e\udd16 LLM",\n            "\ud83d\udcca Data Exploration",\n        ],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "category": st.column_config.SelectboxColumn(\n            "App Category",\n            help="The category of the app",\n            width="medium",\n            options=[\n                "\ud83d\udcca Data Exploration",\n                "\ud83d\udcc8 Data Visualization",\n                "\ud83e\udd16 LLM",\n            ],\n        )\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a selectbox column in st.dataframe or st.data_editor.

\n

This is the default column type for Pandas categorical values. This command needs to\nbe used in the column_config parameter of st.dataframe or st.data_editor.\nWhen used with st.data_editor, editing will be enabled with a selectbox widget.

\n", + "args": [ + { + "name": "label", + "type_name": "str or None", + "is_optional": false, + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", "default": null }, { - "name": "kwargs", - "type_name": "dict", + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", "is_optional": false, - "description": "

An optional dict of kwargs to pass to the callback.

\n", + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", + "default": null + }, + { + "name": "help", + "type_name": "str or None", + "is_optional": false, + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", "default": null }, { "name": "disabled", - "type_name": "bool", + "type_name": "bool or None", "is_optional": false, - "description": "

An optional boolean, which disables the time input if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", + "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", "default": "False" }, { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "name": "required", + "type_name": "bool or None", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it above the widget (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" + "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", + "default": "False" }, { - "name": "step", - "type_name": "int or timedelta", + "name": "default", + "type_name": "str, int, float, bool, or None", "is_optional": false, - "description": "

The stepping interval in seconds. Defaults to 900, i.e. 15 minutes.\nYou can also pass a datetime.timedelta object.

\n", - "default": "900" - } - ], - "returns": [ + "description": "

Specifies the default value in this column when a new row is added by the user.

\n", + "default": "value" + }, { - "type_name": "datetime.time", - "is_generator": false, - "description": "

The current value of the time input widget.

\n", - "return_name": null + "name": "options", + "type_name": "iterable of str or None", + "is_optional": false, + "description": "

The options that can be selected during editing. If None (default), this will be\ninferred from the underlying dataframe column if its dtype is \u201ccategory\u201d\n(see Pandas docs on categorical data).

\n", + "default": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/time_widgets.py#L219" + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/lib/column_types.py#L647" }, - "DeltaGenerator.title": { - "name": "title", - "signature": "element.title(body, anchor=None, *, help=None)", - "examples": "
\n
\nimport streamlit as st\n\nst.title('This is a title')\nst.title('_Streamlit_ is :blue[cool] :sunglasses:')\n
\n\n \n
\n", - "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", + "streamlit.column_config.TextColumn": { + "name": "TextColumn", + "signature": "st.column_config.TextColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, max_chars=None, validate=None)", + "examples": "
\n
\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "widgets": ["st.selectbox", "st.number_input", "st.text_area", "st.button"],\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "widgets": st.column_config.TextColumn(\n            "Widgets",\n            help="Streamlit **widget** commands \ud83c\udf88",\n            default="st.",\n            max_chars=50,\n            validate="^st\\.[a-z_]+$",\n        )\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a text column in st.dataframe or st.data_editor.

\n

This is the default column type for string values. This command needs to be used in the\ncolumn_config parameter of st.dataframe or st.data_editor. When used with\nst.data_editor, editing will be enabled with a text input widget.

\n", "args": [ { - "name": "body", - "type_name": "str", + "name": "label", + "type_name": "str or None", "is_optional": false, - "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", "default": null }, { - "name": "anchor", - "type_name": "str or False", + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", "is_optional": false, - "description": "

The anchor name of the header that can be accessed with #anchor\nin the URL. If omitted, it generates an anchor using the body.\nIf False, the anchor is not shown in the UI.

\n", + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", "default": null }, { "name": "help", - "type_name": "str", + "type_name": "str or None", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the title.

\n", + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/heading.py#L181" - }, - "DeltaGenerator.toast": { - "name": "toast", - "signature": "element.toast(body, *, icon=None)", - "example": "
\n
\nimport streamlit as st\n\nst.toast('Your edited image was saved!', icon='\ud83d\ude0d')\n
\n
\n", - "description": "

Display a short message, known as a notification "toast".

\n

The toast appears in the app's bottom-right corner and disappears after four seconds.

\n
\n

Warning

\n

st.toast is not compatible with Streamlit's caching and\ncannot be called within a cached function.

\n
\n", - "args": [ + }, { - "name": "body", - "type_name": "str", + "name": "disabled", + "type_name": "bool or None", "is_optional": false, - "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", + "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", + "default": "False" + }, + { + "name": "required", + "type_name": "bool or None", + "is_optional": false, + "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", + "default": "False" + }, + { + "name": "default", + "type_name": "str or None", + "is_optional": false, + "description": "

Specifies the default value in this column when a new row is added by the user.

\n", + "default": "value" + }, + { + "name": "max_chars", + "type_name": "int or None", + "is_optional": false, + "description": "

The maximum number of characters that can be entered. If None (default),\nthere will be no maximum.

\n", "default": null }, { - "name": "icon", + "name": "validate", "type_name": "str or None", "is_optional": false, - "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the toast. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", - "default": "None" + "description": "

A regular expression (JS flavor, e.g. "^[a-z]+$") that edited values are validated against.\nIf the input is invalid, it will not be submitted.

\n", + "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/toast.py#L37" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/lib/column_types.py#L372" }, - "DeltaGenerator.toggle": { - "name": "toggle", - "signature": "element.toggle(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\non = st.toggle('Activate feature')\n\nif on:\n    st.write('Feature activated!')\n
\n\n \n
\n", - "description": "

Display a toggle widget.

\n", + "streamlit.column_config.TimeColumn": { + "name": "TimeColumn", + "signature": "st.column_config.TimeColumn(label=None, *, width=None, help=None, disabled=None, required=None, default=None, format=None, min_value=None, max_value=None, step=None)", + "examples": "
\n
\nfrom datetime import time\nimport pandas as pd\nimport streamlit as st\n\ndata_df = pd.DataFrame(\n    {\n        "appointment": [\n            time(12, 30),\n            time(18, 0),\n            time(9, 10),\n            time(16, 25),\n        ]\n    }\n)\n\nst.data_editor(\n    data_df,\n    column_config={\n        "appointment": st.column_config.TimeColumn(\n            "Appointment",\n            min_value=time(8, 0, 0),\n            max_value=time(19, 0, 0),\n            format="hh:mm a",\n            step=60,\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", + "description": "

Configure a time column in st.dataframe or st.data_editor.

\n

This is the default column type for time values. This command needs to be used in\nthe column_config parameter of st.dataframe or st.data_editor. When\nused with st.data_editor, editing will be enabled with a time picker widget.

\n", "args": [ { "name": "label", - "type_name": "str", + "type_name": "str or None", "is_optional": false, - "description": "

A short label explaining to the user what this toggle is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

The label shown at the top of the column. If None (default),\nthe column name is used.

\n", "default": null }, { - "name": "value", - "type_name": "bool", + "name": "width", + "type_name": "\"small\", \"medium\", \"large\", or None", "is_optional": false, - "description": "

Preselect the toggle when it first renders. This will be\ncast to bool internally.

\n", + "description": "

The display width of the column. Can be one of \u201csmall\u201d, \u201cmedium\u201d, or \u201clarge\u201d.\nIf None (default), the column will be sized to fit the cell contents.

\n", "default": null }, { - "name": "key", - "type_name": "str or int", + "name": "help", + "type_name": "str or None", "is_optional": false, - "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", + "description": "

An optional tooltip that gets displayed when hovering over the column label.

\n", "default": null }, { - "name": "help", - "type_name": "str", + "name": "disabled", + "type_name": "bool or None", "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the toggle.

\n", - "default": null + "description": "

Whether editing should be disabled for this column. Defaults to False.

\n", + "default": "False" }, { - "name": "on_change", - "type_name": "callable", + "name": "required", + "type_name": "bool or None", "is_optional": false, - "description": "

An optional callback invoked when this toggle's value changes.

\n", - "default": null + "description": "

Whether edited cells in the column need to have a value. If True, an edited cell\ncan only be submitted if it has a value other than None. Defaults to False.

\n", + "default": "False" }, { - "name": "args", - "type_name": "tuple", + "name": "default", + "type_name": "datetime.time or None", "is_optional": false, - "description": "

An optional tuple of args to pass to the callback.

\n", - "default": null + "description": "

Specifies the default value in this column when a new row is added by the user.

\n", + "default": "value" }, { - "name": "kwargs", - "type_name": "dict", + "name": "format", + "type_name": "str or None", "is_optional": false, - "description": "

An optional dict of kwargs to pass to the callback.

\n", + "description": "

A momentJS format string controlling how times are displayed. See\nmomentJS docs for available\nformats. If None (default), uses HH:mm:ss.

\n", "default": null }, { - "name": "disabled", - "type_name": "bool", + "name": "min_value", + "type_name": "datetime.time or None", "is_optional": false, - "description": "

An optional boolean, which disables the toggle if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", - "default": "False" + "description": "

The minimum time that can be entered.\nIf None (default), there will be no minimum.

\n", + "default": null }, { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", + "name": "max_value", + "type_name": "datetime.time or None", "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" - } - ], - "returns": [ + "description": "

The maximum time that can be entered.\nIf None (default), there will be no maximum.

\n", + "default": null + }, { - "type_name": "bool", - "is_generator": false, - "description": "

Whether or not the toggle is checked.

\n", - "return_name": null + "name": "step", + "type_name": "int, float, datetime.timedelta, or None", + "is_optional": false, + "description": "

The stepping interval in seconds. If None (default), the step will be 1 second.

\n", + "default": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/checkbox.py#L156" + "returns": [], + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/lib/column_types.py#L1163" }, - "DeltaGenerator.vega_lite_chart": { - "name": "vega_lite_chart", - "signature": "element.vega_lite_chart(data=None, spec=None, use_container_width=False, theme=\"streamlit\", **kwargs)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(chart_data, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", - "description": "

Display a chart using the Vega-Lite library.

\n", + "streamlit.components.v1.declare_component": { + "name": "declare_component", + "signature": "st.components.v1.declare_component(name, path=None, url=None)", + "description": "

Create and register a custom component.

\n", "args": [ { - "name": "data", - "type_name": "pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None", + "name": "name", + "type_name": "str", "is_optional": false, - "description": "

Either the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).\nPyarrow tables are not supported by Streamlit's legacy DataFrame serialization\n(i.e. with config.dataFrameSerialization = "legacy").\nTo use pyarrow tables, please enable pyarrow by changing the config setting,\nconfig.dataFrameSerialization = "arrow".

\n", + "description": "

A short, descriptive name for the component. Like, "slider".

\n", "default": null }, { - "name": "spec", - "type_name": "dict or None", + "name": "path", + "type_name": "str or None", "is_optional": false, - "description": "

The Vega-Lite spec for the chart. If the spec was already passed in\nthe previous argument, this must be set to None. See\nhttps://vega.github.io/vega-lite/docs/ for more info.

\n", + "description": "

The path to serve the component's frontend files from. Either\npath or url must be specified, but not both.

\n", "default": null }, { - "name": "use_container_width", - "type_name": "bool", + "name": "url", + "type_name": "str or None", "is_optional": false, - "description": "

If True, set the chart width to the column width. This takes\nprecedence over Vega-Lite's native width value.

\n", + "description": "

The URL that the component is served from. Either path or url\nmust be specified, but not both.

\n", "default": null - }, - { - "name": "theme", - "type_name": "\"streamlit\" or None", - "is_optional": false, - "description": "

The theme of the chart. Currently, we only support "streamlit" for the Streamlit\ndefined design or None to fallback to the default behavior of the library.

\n", - "default": "behavior" - }, + } + ], + "returns": [ { - "name": "**kwargs", - "type_name": "any", - "is_optional": false, - "description": "

Same as spec, but as keywords.

\n", - "default": null + "type_name": "CustomComponent", + "is_generator": false, + "description": "

A CustomComponent that can be called like a function.\nCalling the component will create a new instance of the component\nin the Streamlit app.

\n", + "return_name": null } ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L819" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/components/v1/components.py#L246" }, - "DeltaGenerator.video": { - "name": "video", - "signature": "element.video(data, format=\"video/mp4\", start_time=0)", - "example": "
\n
\nimport streamlit as st\n\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", - "description": "

Display a video player.

\n", + "streamlit.components.v1.html": { + "name": "html", + "signature": "st.components.v1.html(html, width=None, height=None, scrolling=False)", + "description": "

Display an HTML string in an iframe.

\n", "args": [ { - "name": "data", - "type_name": "str, bytes, BytesIO, numpy.ndarray, or file", + "name": "html", + "type_name": "str", "is_optional": false, - "description": "

Raw video data, filename, or URL pointing to a video to load.\nIncludes support for YouTube URLs.\nNumpy arrays and raw data formats must include all necessary file\nheaders to match specified file format.

\n", + "description": "

The HTML string to embed in the iframe.

\n", "default": null }, { - "name": "format", - "type_name": "str", + "name": "width", + "type_name": "int", "is_optional": false, - "description": "

The mime type for the video file. Defaults to 'video/mp4'.\nSee https://tools.ietf.org/html/rfc4281 for more info.

\n", - "default": "s" + "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", + "default": "the" }, { - "name": "start_time", + "name": "height", "type_name": "int", "is_optional": false, - "description": "

The time from which this element should start playing.

\n", - "default": null + "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", + "default": "150" + }, + { + "name": "scrolling", + "type_name": "bool", + "is_optional": false, + "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", + "default": "False" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/media.py#L115" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/iframe.py#L59" }, - "DeltaGenerator.warning": { - "name": "warning", - "signature": "element.warning(body, *, icon=None)", - "example": "
\n
\nimport streamlit as st\n\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", - "description": "

Display warning message.

\n", + "streamlit.components.v1.iframe": { + "name": "iframe", + "signature": "st.components.v1.iframe(src, width=None, height=None, scrolling=False)", + "description": "

Load a remote URL in an iframe.

\n", "args": [ { - "name": "body", + "name": "src", "type_name": "str", "is_optional": false, - "description": "

The warning text to display.

\n", + "description": "

The URL of the page to embed.

\n", "default": null }, { - "name": "icon", - "type_name": "str or None", + "name": "width", + "type_name": "int", "is_optional": false, - "description": "

An optional, keyword-only argument that specifies an emoji to use as\nthe icon for the alert. Shortcodes are not allowed, please use a\nsingle character instead. E.g. "\ud83d\udea8", "\ud83d\udd25", "\ud83e\udd16", etc.\nDefaults to None, which means no icon is displayed.

\n", - "default": "None" - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/alert.py#L59" - }, - "DeltaGenerator.write": { - "name": "write", - "signature": "element.write(*args, unsafe_allow_html=False, **kwargs)", - "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nimport streamlit as st\n\nst.write('Hello, *World!* :sunglasses:')\n
\n\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nimport streamlit as st\nimport pandas as pd\n\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nimport streamlit as st\n\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n
\n", - "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", - "args": [ + "description": "

The width of the frame in CSS pixels. Defaults to the app's\ndefault element width.

\n", + "default": "the" + }, { - "name": "*args", - "type_name": "any", + "name": "height", + "type_name": "int", "is_optional": false, - "description": "

One or many objects to print to the App.

\n

Arguments are handled as follows:

\n
    \n
  • \n
    write(string) : Prints the formatted Markdown string, with
    \n
    support for LaTeX expression, emoji shortcodes, and colored text.\nSee docs for st.markdown for more.
    \n
    \n
  • \n
  • write(data_frame) : Displays the DataFrame as a table.
  • \n
  • write(error) : Prints an exception specially.
  • \n
  • write(func) : Displays information about a function.
  • \n
  • write(module) : Displays information about the module.
  • \n
  • write(class) : Displays information about a class.
  • \n
  • write(dict) : Displays dict in an interactive widget.
  • \n
  • write(mpl_fig) : Displays a Matplotlib figure.
  • \n
  • write(altair) : Displays an Altair chart.
  • \n
  • write(keras) : Displays a Keras model.
  • \n
  • write(graphviz) : Displays a Graphviz graph.
  • \n
  • write(plotly_fig) : Displays a Plotly figure.
  • \n
  • write(bokeh_fig) : Displays a Bokeh figure.
  • \n
  • write(sympy_expr) : Prints SymPy expression using LaTeX.
  • \n
  • write(htmlable) : Prints _repr_html_() for the object if available.
  • \n
  • write(obj) : Prints str(obj) if otherwise unknown.
  • \n
\n", - "default": null + "description": "

The height of the frame in CSS pixels. Defaults to 150.

\n", + "default": "150" }, { - "name": "unsafe_allow_html", + "name": "scrolling", "type_name": "bool", "is_optional": false, - "description": "

This is a keyword-only argument that defaults to False.

\n

By default, any HTML tags found in strings will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.

\n

That said, we strongly advise against it. It is hard to write secure\nHTML, so by using this argument you may be compromising your users'\nsecurity. For more information, see:

\n

https://github.com/streamlit/streamlit/issues/152

\n", + "description": "

If True, show a scrollbar when the content is larger than the iframe.\nOtherwise, do not show a scrollbar. Defaults to False.

\n", "default": "False" } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/write.py#L49" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/iframe.py#L25" }, - "StatusContainer.add_rows": { + "DeltaGenerator.add_rows": { "name": "add_rows", - "signature": "StatusContainer.add_rows(data=None, **kwargs)", + "signature": "element.add_rows(data=None, **kwargs)", "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf1 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table = st.table(df1)\n\ndf2 = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nmy_table.add_rows(df2)\n# Now the table shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

You can do the same thing with plots. For example, if you want to add\nmore data to a line chart:

\n
\n# Assuming df1 and df2 from the example above still exist...\nmy_chart = st.line_chart(df1)\nmy_chart.add_rows(df2)\n# Now the chart shown in the Streamlit app contains the data for\n# df1 followed by the data for df2.\n
\n

And for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:

\n
\nmy_chart = st.vega_lite_chart({\n    'mark': 'line',\n    'encoding': {'x': 'a', 'y': 'b'},\n    'datasets': {\n      'some_fancy_name': df1,  # <-- named dataset\n     },\n    'data': {'name': 'some_fancy_name'},\n}),\nmy_chart.add_rows(some_fancy_name=df2)  # <-- name used as keyword\n
\n
\n", "description": "

Concatenate a dataframe to the bottom of the current one.

\n", "args": [ @@ -20648,11 +94725,11 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L894" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/dataframe_selector.py#L620" }, - "StatusContainer.altair_chart": { + "DeltaGenerator.altair_chart": { "name": "altair_chart", - "signature": "StatusContainer.altair_chart(altair_chart, use_container_width=False, theme=\"streamlit\")", + "signature": "element.altair_chart(altair_chart, use_container_width=False, theme=\"streamlit\")", "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(chart_data).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.altair_chart(c, use_container_width=True)\n
\n

Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.

\n\n \n
\n", "description": "

Display a chart using the Altair library.

\n", "args": [ @@ -20679,12 +94756,12 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L766" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/dataframe_selector.py#L492" }, - "StatusContainer.area_chart": { + "DeltaGenerator.area_chart": { "name": "area_chart", - "signature": "StatusContainer.area_chart(data=None, *, x=None, y=None, color=None, width=0, height=0, use_container_width=True)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns = ['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n

You can also choose different columns to use for x and y, as well as set\nthe color dynamically based on a 3rd column (assuming your dataframe is in\nlong format):

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame({\n    'col1' : np.random.randn(20),\n    'col2' : np.random.randn(20),\n    'col3' : np.random.choice(['A', 'B', 'C'], 20)\n})\n\nst.area_chart(\n    chart_data,\n    x = 'col1',\n    y = 'col2',\n    color = 'col3'\n)\n
\n\n \n

Finally, if your dataframe is in wide format, you can group multiple\ncolumns under the y argument to show multiple series with different\ncolors:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['col1', 'col2', 'col3'])\n\nst.area_chart(\n    chart_data,\n    x='col1',\n    y=['col2', 'col3'],\n    color=['#FF0000','#0000FF']  # Optional\n)\n
\n\n \n
\n", + "signature": "element.area_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['a', 'b', 'c'])\n\nst.area_chart(chart_data)\n
\n\n \n
\n", "description": "

Display an area chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.area_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", "args": [ { @@ -20708,13 +94785,6 @@ "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", "default": null }, - { - "name": "color", - "type_name": "str, tuple, sequence of str, sequence of tuple, or None", - "is_optional": false, - "description": "

The color to use for different series in this chart. This argument\ncan only be supplied by keyword.

\n

For an area chart with just 1 series, this can be:

\n
    \n
  • None, to use the default color.
  • \n
  • A hex string like "#ffaa00" or "#ffaa0088".
  • \n
  • An RGB or RGBA tuple with the red, green, blue, and alpha\ncomponents specified as ints from 0 to 255 or floats from 0.0 to\n1.0.
  • \n
\n

For an area chart with multiple series, where the dataframe is in\nlong format (that is, y is None or just one column), this can be:

\n
    \n
  • None, to use the default colors.

    \n
  • \n
  • The name of a column in the dataset. Data points will be grouped\ninto series of the same color based on the value of this column.\nIn addition, if the values in this column match one of the color\nformats above (hex string or color tuple), then that color will\nbe used.

    \n

    For example: if the dataset has 1000 rows, but this column can\nonly contains the values "adult", "child", "baby",\nthen those 1000 datapoints will be grouped into 3 series, whose\ncolors will be automatically selected from the default palette.

    \n

    But, if for the same 1000-row dataset, this column contained\nthe values "#ffaa00", "#f0f", "#0000ff", then then those 1000\ndatapoints would still be grouped into 3 series, but their\ncolors would be "#ffaa00", "#f0f", "#0000ff" this time around.

    \n
  • \n
\n

For an area chart with multiple series, where the dataframe is in\nwide format (that is, y is a sequence of columns), this can be:

\n
    \n
  • None, to use the default colors.
  • \n
  • A list of string colors or color tuples to be used for each of\nthe series in the chart. This list should have the same length\nas the number of y values (e.g. color=["#fd0", "#f0f", "#04f"]\nfor three lines).
  • \n
\n", - "default": "color" - }, { "name": "width", "type_name": "int", @@ -20738,11 +94808,11 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L409" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/dataframe_selector.py#L317" }, - "StatusContainer.audio": { + "DeltaGenerator.audio": { "name": "audio", - "signature": "StatusContainer.audio(data, format=\"audio/wav\", start_time=0, *, sample_rate=None)", + "signature": "element.audio(data, format=\"audio/wav\", start_time=0, *, sample_rate=None)", "example": "
\n
\nimport streamlit as st\nimport numpy as np\n\naudio_file = open('myaudio.ogg', 'rb')\naudio_bytes = audio_file.read()\n\nst.audio(audio_bytes, format='audio/ogg')\n\nsample_rate = 44100  # 44100 samples per second\nseconds = 2  # Note duration of 2 seconds\nfrequency_la = 440  # Our played note will be 440 Hz\n# Generate array with seconds*sample_rate steps, ranging between 0 and seconds\nt = np.linspace(0, seconds, seconds * sample_rate, False)\n# Generate a 440 Hz sine wave\nnote_la = np.sin(frequency_la * t * 2 * np.pi)\n\nst.audio(note_la, sample_rate=sample_rate)\n
\n\n \n
\n", "description": "

Display an audio player.

\n", "args": [ @@ -20776,21 +94846,21 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/media.py#L42" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/media.py#L42" }, - "StatusContainer.balloons": { + "DeltaGenerator.balloons": { "name": "balloons", - "signature": "StatusContainer.balloons()", + "signature": "element.balloons()", "example": "
\n
\nimport streamlit as st\n\nst.balloons()\n
\n

...then watch your app and get ready for a celebration!

\n
\n", "description": "

Draw celebratory balloons.

\n", "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/balloons.py#L25" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/balloons.py#L25" }, - "StatusContainer.bar_chart": { + "DeltaGenerator.bar_chart": { "name": "bar_chart", - "signature": "StatusContainer.bar_chart(data=None, *, x=None, y=None, color=None, width=0, height=0, use_container_width=True)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n

You can also choose different columns to use for x and y, as well as set\nthe color dynamically based on a 3rd column (assuming your dataframe is in\nlong format):

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame({\n    'col1' : np.random.randn(20),\n    'col2' : np.random.randn(20),\n    'col3' : np.random.choice(['A','B','C'],20)\n})\n\nst.bar_chart(\n    chart_data,\n    x='col1',\n    y='col2',\n    color='col3'\n)\n
\n\n \n

Finally, if your dataframe is in wide format, you can group multiple\ncolumns under the y argument to show multiple series with different\ncolors:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=['col1', 'col2', 'col3'])\n\nst.bar_chart(\n    chart_data,\n    x='col1',\n    y=['col2', 'col3'],\n    color=['#FF0000','#0000FF']  # Optional\n)\n
\n\n \n
\n", + "signature": "element.bar_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns=["a", "b", "c"])\n\nst.bar_chart(chart_data)\n
\n\n \n
\n", "description": "

Display a bar chart.

\n

This is just syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.bar_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", "args": [ { @@ -20814,13 +94884,6 @@ "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", "default": null }, - { - "name": "color", - "type_name": "str, tuple, sequence of str, sequence of tuple, or None", - "is_optional": false, - "description": "

The color to use for different series in this chart. This argument\ncan only be supplied by keyword.

\n

For a bar chart with just 1 series, this can be:

\n
    \n
  • None, to use the default color.
  • \n
  • A hex string like "#ffaa00" or "#ffaa0088".
  • \n
  • An RGB or RGBA tuple with the red, green, blue, and alpha\ncomponents specified as ints from 0 to 255 or floats from 0.0 to\n1.0.
  • \n
\n

For a bar chart with multiple series, where the dataframe is in\nlong format (that is, y is None or just one column), this can be:

\n
    \n
  • None, to use the default colors.

    \n
  • \n
  • The name of a column in the dataset. Data points will be grouped\ninto series of the same color based on the value of this column.\nIn addition, if the values in this column match one of the color\nformats above (hex string or color tuple), then that color will\nbe used.

    \n

    For example: if the dataset has 1000 rows, but this column can\nonly contains the values "adult", "child", "baby",\nthen those 1000 datapoints will be grouped into 3 series, whose\ncolors will be automatically selected from the default palette.

    \n

    But, if for the same 1000-row dataset, this column contained\nthe values "#ffaa00", "#f0f", "#0000ff", then then those 1000\ndatapoints would still be grouped into 3 series, but their\ncolors would be "#ffaa00", "#f0f", "#0000ff" this time around.

    \n
  • \n
\n

For a bar chart with multiple series, where the dataframe is in\nwide format (that is, y is a sequence of columns), this can be:

\n
    \n
  • None, to use the default colors.
  • \n
  • A list of string colors or color tuples to be used for each of\nthe series in the chart. This list should have the same length\nas the number of y values (e.g. color=["#fd0", "#f0f", "#04f"]\nfor three lines).
  • \n
\n", - "default": "color" - }, { "name": "width", "type_name": "int", @@ -20844,11 +94907,11 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L587" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/dataframe_selector.py#L404" }, - "StatusContainer.bokeh_chart": { + "DeltaGenerator.bokeh_chart": { "name": "bokeh_chart", - "signature": "StatusContainer.bokeh_chart(figure, use_container_width=False)", + "signature": "element.bokeh_chart(figure, use_container_width=False)", "example": "
\n
\nimport streamlit as st\nfrom bokeh.plotting import figure\n\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\np = figure(\n    title='simple line example',\n    x_axis_label='x',\n    y_axis_label='y')\n\np.line(x, y, legend_label='Trend', line_width=2)\n\nst.bokeh_chart(p, use_container_width=True)\n
\n\n \n
\n", "description": "

Display an interactive Bokeh chart.

\n

Bokeh is a charting library for Python. The arguments to this function\nclosely follow the ones for Bokeh's show function. You can find\nmore about Bokeh at https://bokeh.pydata.org.

\n

To show Bokeh charts in Streamlit, call st.bokeh_chart\nwherever you would call Bokeh's show.

\n", "args": [ @@ -20868,19 +94931,19 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/bokeh_chart.py#L36" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/bokeh_chart.py#L36" }, - "StatusContainer.button": { + "DeltaGenerator.button": { "name": "button", - "signature": "StatusContainer.button(label, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", - "example": "
\n
\nimport streamlit as st\n\nst.button("Reset", type="primary")\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n
\n", + "signature": "element.button(label, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "example": "
\n
\nimport streamlit as st\n\nif st.button('Say hello'):\n    st.write('Why hello there')\nelse:\n    st.write('Goodbye')\n
\n\n \n
\n", "description": "

Display a button widget.

\n", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", "default": null }, { @@ -20948,11 +95011,11 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/button.py#L61" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/button.py#L61" }, - "StatusContainer.camera_input": { + "DeltaGenerator.camera_input": { "name": "camera_input", - "signature": "StatusContainer.camera_input(label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "signature": "element.camera_input(label, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", "examples": "
\n
\nimport streamlit as st\n\npicture = st.camera_input("Take a picture")\n\nif picture:\n    st.image(picture)\n
\n
\n", "description": "

Display a widget that returns pictures from the user's webcam.

\n", "args": [ @@ -20960,7 +95023,7 @@ "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this widget is used for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this widget is used for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { @@ -21021,11 +95084,11 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/camera_input.py#L78" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/camera_input.py#L109" }, - "StatusContainer.caption": { + "DeltaGenerator.caption": { "name": "caption", - "signature": "StatusContainer.caption(body, unsafe_allow_html=False, *, help=None)", + "signature": "element.caption(body, unsafe_allow_html=False, *, help=None)", "examples": "
\n
\nimport streamlit as st\n\nst.caption('This is a string that explains something above.')\nst.caption('A caption with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", "description": "

Display text in small font.

\n

This should be used for captions, asides, footnotes, sidenotes, and\nother explanatory text.

\n", "args": [ @@ -21033,7 +95096,7 @@ "name": "body", "type_name": "str", "is_optional": false, - "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", "default": null }, { @@ -21052,11 +95115,11 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/markdown.py#L146" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/markdown.py#L132" }, - "StatusContainer.chat_input": { + "DeltaGenerator.chat_input": { "name": "chat_input", - "signature": "StatusContainer.chat_input(placeholder=\"Your message\", *, key=None, max_chars=None, disabled=False, on_submit=None, args=None, kwargs=None)", + "signature": "element.chat_input(placeholder=\"Your message\", *, key=None, max_chars=None, disabled=False, on_submit=None, args=None, kwargs=None)", "examples": "
\n
\nimport streamlit as st\n\nprompt = st.chat_input("Say something")\nif prompt:\n    st.write(f"User has sent the following prompt: {prompt}")\n
\n\n \n
\n", "description": "

Display a chat input widget.

\n
\n

Warning

\n

Chat input can only be used once per app page and inside the main area of the app.\nIt cannot be used in the sidebar, columns, expanders, forms or tabs.\nWe plan to support this in the future.

\n
\n", "args": [ @@ -21118,26 +95181,26 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/chat.py#L214" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/chat.py#L208" }, - "StatusContainer.chat_message": { + "DeltaGenerator.chat_message": { "name": "chat_message", - "signature": "StatusContainer.chat_message(name, *, avatar=None)", + "signature": "element.chat_message(name, *, avatar=None)", "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\nimport numpy as np\n\nwith st.chat_message("user"):\n    st.write("Hello \ud83d\udc4b")\n    st.line_chart(np.random.randn(30, 3))\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\nmessage = st.chat_message("assistant")\nmessage.write("Hello human")\nmessage.bar_chart(np.random.randn(30, 3))\n
\n\n \n
\n", "description": "

Insert a chat message container.

\n

To add elements to the returned container, you can use with notation\n(preferred) or just call methods directly on the returned object. See the\nexamples below.

\n", "args": [ { "name": "name", - "type_name": "\"user\", \"assistant\", \"ai\", \"human\", or str", + "type_name": "\"user\", \"assistant\", or str", "is_optional": false, - "description": "

The name of the message author. Can be "human"/"user" or\n"ai"/"assistant" to enable preset styling and avatars.

\n

Currently, the name is not shown in the UI but is only set as an\naccessibility label. For accessibility reasons, you should not use\nan empty string.

\n", + "description": "

The name of the message author. Can be \u201cuser\u201d or \u201cassistant\u201d to\nenable preset styling and avatars.

\n

Currently, the name is not shown in the UI but is only set as an\naccessibility label. For accessibility reasons, you should not use\nan empty string.

\n", "default": null }, { "name": "avatar", "type_name": "str, numpy.ndarray, or BytesIO", "is_optional": false, - "description": "

The avatar shown next to the message. Can be one of:

\n
    \n
  • A single emoji, e.g. "\ud83e\uddd1\u200d\ud83d\udcbb", "\ud83e\udd16", "\ud83e\udd96". Shortcodes are not supported.
  • \n
  • \n
    An image using one of the formats allowed for st.image: path of a local
    \n
    image file; URL to fetch the image from; array of shape (w,h) or (w,h,1)\nfor a monochrome image, (w,h,3) for a color image, or (w,h,4) for an RGBA image.
    \n
    \n
  • \n
\n

If None (default), uses default icons if name is "user",\n"assistant", "ai", "human" or the first letter of the name value.

\n", + "description": "

The avatar shown next to the message. Can be one of:

\n
    \n
  • A single emoji, e.g. "\ud83e\uddd1\u200d\ud83d\udcbb", "\ud83e\udd16", "\ud83e\udd96". Shortcodes are not supported.
  • \n
  • \n
    An image using one of the formats allowed for st.image: path of a local
    \n
    image file; URL to fetch the image from; array of shape (w,h) or (w,h,1)\nfor a monochrome image, (w,h,3) for a color image, or (w,h,4) for an RGBA image.
    \n
    \n
  • \n
\n

If None (default), uses default icons if name is "user" or\n"assistant", or the first letter of the name value.

\n", "default": "icons" } ], @@ -21149,11 +95212,11 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/chat.py#L121" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/chat.py#L112" }, - "StatusContainer.checkbox": { + "DeltaGenerator.checkbox": { "name": "checkbox", - "signature": "StatusContainer.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "signature": "element.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", "example": "
\n
\nimport streamlit as st\n\nagree = st.checkbox('I agree')\n\nif agree:\n    st.write('Great!')\n
\n\n \n
\n", "description": "

Display a checkbox widget.

\n", "args": [ @@ -21161,7 +95224,7 @@ "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this checkbox is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this checkbox is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", "default": null }, { @@ -21229,11 +95292,11 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/checkbox.py#L53" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/checkbox.py#L52" }, - "StatusContainer.code": { + "DeltaGenerator.code": { "name": "code", - "signature": "StatusContainer.code(body, language=\"python\", line_numbers=False)", + "signature": "element.code(body, language=\"python\", line_numbers=False)", "example": "
\n
\nimport streamlit as st\n\ncode = '''def hello():\n    print("Hello, Streamlit!")'''\nst.code(code, language='python')\n
\n
\n", "description": "

Display a code block with optional syntax highlighting.

\n", "args": [ @@ -21260,11 +95323,11 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/code.py#L27" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/code.py#L27" }, - "StatusContainer.color_picker": { + "DeltaGenerator.color_picker": { "name": "color_picker", - "signature": "StatusContainer.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "signature": "element.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", "example": "
\n
\nimport streamlit as st\n\ncolor = st.color_picker('Pick A Color', '#00f900')\nst.write('The current color is', color)\n
\n\n \n
\n", "description": "

Display a color picker widget.

\n", "args": [ @@ -21272,7 +95335,7 @@ "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { @@ -21340,11 +95403,11 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/color_picker.py#L53" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/color_picker.py#L52" }, - "StatusContainer.columns": { + "DeltaGenerator.columns": { "name": "columns", - "signature": "StatusContainer.columns(spec, *, gap=\"small\")", + "signature": "element.columns(spec, *, gap=\"small\")", "examples": "
\n

You can use with notation to insert any element into a column:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\n\nwith col1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg")\n\nwith col2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg")\n\nwith col3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ncol1, col2 = st.columns([3, 1])\ndata = np.random.randn(10, 1)\n\ncol1.subheader("A wide column with a chart")\ncol1.line_chart(data)\n\ncol2.subheader("A narrow column with the data")\ncol2.write(data)\n
\n\n \n
\n", "description": "

Insert containers laid out as side-by-side columns.

\n

Inserts a number of multi-element containers laid out side-by-side and\nreturns a list of container objects.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n

Columns can only be placed inside other columns up to one level of nesting.

\n
\n

Warning

\n

Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.

\n
\n", "args": [ @@ -21371,20 +95434,20 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/layouts.py#L79" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/layouts.py#L75" }, - "StatusContainer.container": { + "DeltaGenerator.container": { "name": "container", - "signature": "StatusContainer.container()", + "signature": "element.container()", "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.container():\n   st.write("This is inside the container")\n\n   # You can call any Streamlit command, including custom components:\n   st.bar_chart(np.random.randn(50, 3))\n\nst.write("This is outside the container")\n
\n\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\ncontainer = st.container()\ncontainer.write("This is inside the container")\nst.write("This is outside the container")\n\n# Now insert some more in the container\ncontainer.write("This is inside too")\n
\n\n \n
\n", "description": "

Insert a multi-element container.

\n

Inserts an invisible container into your app that can be used to hold\nmultiple elements. This allows you to, for example, insert multiple\nelements into your app out of order.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n", "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/layouts.py#L31" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/layouts.py#L27" }, - "StatusContainer.data_editor": { + "DeltaGenerator.data_editor": { "name": "data_editor", - "signature": "StatusContainer.data_editor(data, *, width=None, height=None, use_container_width=False, hide_index=None, column_order=None, column_config=None, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", + "signature": "element.data_editor(data, *, width=None, height=None, use_container_width=False, hide_index=None, column_order=None, column_config=None, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

Or you can customize the data editor via column_config, hide_index, column_order, or disabled:

\n
\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    [\n        {"command": "st.selectbox", "rating": 4, "is_widget": True},\n        {"command": "st.balloons", "rating": 5, "is_widget": False},\n        {"command": "st.time_input", "rating": 3, "is_widget": True},\n    ]\n)\nedited_df = st.data_editor(\n    df,\n    column_config={\n        "command": "Streamlit Command",\n        "rating": st.column_config.NumberColumn(\n            "Your rating",\n            help="How much do you like this command (1-5)?",\n            min_value=1,\n            max_value=5,\n            step=1,\n            format="%d \u2b50",\n        ),\n        "is_widget": "Widget ?",\n    },\n    disabled=["command", "is_widget"],\n    hide_index=True,\n)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n
\n", "description": "

Display a data editor widget.

\n

The data editor widget allows you to edit dataframes and many other data structures in a table-like UI.

\n
\n

Warning

\n

When going from st.experimental_data_editor to st.data_editor in\n1.23.0, the data editor's representation in st.session_state was changed.\nThe edited_cells dictionary is now called edited_rows and uses a\ndifferent format ({0: {"column name": "edited value"}} instead of\n{"0:1": "edited value"}). You may need to adjust the code if your app uses\nst.experimental_data_editor in combination with st.session_state."

\n
\n", "args": [ @@ -21488,11 +95551,11 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/data_editor.py#L529" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/data_editor.py#L528" }, - "StatusContainer.dataframe": { + "DeltaGenerator.dataframe": { "name": "dataframe", - "signature": "StatusContainer.dataframe(data=None, width=None, height=None, *, use_container_width=False, hide_index=None, column_order=None, column_config=None)", + "signature": "element.dataframe(data=None, width=None, height=None, *, use_container_width=False, hide_index=None, column_order=None, column_config=None)", "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(50, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df)  # Same as st.write(df)\n
\n\n \n

You can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 20),\n   columns=('col %d' % i for i in range(20)))\n\nst.dataframe(df.style.highlight_max(axis=0))\n
\n\n \n

Or you can customize the dataframe via column_config, hide_index, or column_order:

\n
\nimport random\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    {\n        "name": ["Roadmap", "Extras", "Issues"],\n        "url": ["https://roadmap.streamlit.app", "https://extras.streamlit.app", "https://issues.streamlit.app"],\n        "stars": [random.randint(0, 1000) for _ in range(3)],\n        "views_history": [[random.randint(0, 5000) for _ in range(30)] for _ in range(3)],\n    }\n)\nst.dataframe(\n    df,\n    column_config={\n        "name": "App name",\n        "stars": st.column_config.NumberColumn(\n            "Github Stars",\n            help="Number of stars on GitHub",\n            format="%d \u2b50",\n        ),\n        "url": st.column_config.LinkColumn("App URL"),\n        "views_history": st.column_config.LineChartColumn(\n            "Views (past 30 days)", y_min=0, y_max=5000\n        ),\n    },\n    hide_index=True,\n)\n
\n\n \n
\n", "description": "

Display a dataframe as an interactive table.

\n

This command works with dataframes from Pandas, PyArrow, Snowpark, and PySpark.\nIt can also display several other types that can be converted to dataframes,\ne.g. numpy arrays, lists, sets and dictionaries.

\n", "args": [ @@ -21547,11 +95610,11 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L44" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/dataframe_selector.py#L43" }, - "StatusContainer.date_input": { + "DeltaGenerator.date_input": { "name": "date_input", - "signature": "StatusContainer.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, format=\"YYYY/MM/DD\", disabled=False, label_visibility=\"visible\")", + "signature": "element.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, format=\"YYYY/MM/DD\", disabled=False, label_visibility=\"visible\")", "examples": "
\n
\nimport datetime\nimport streamlit as st\n\nd = st.date_input("When's your birthday", datetime.date(2019, 7, 6))\nst.write('Your birthday is:', d)\n
\n\n \n
\nimport datetime\nimport streamlit as st\n\ntoday = datetime.datetime.now()\nnext_year = today.year + 1\njan_1 = datetime.date(next_year, 1, 1)\ndec_31 = datetime.date(next_year, 12, 31)\n\nd = st.date_input(\n    "Select your vacation for next year",\n    (jan_1, datetime.date(next_year, 1, 7)),\n    jan_1,\n    dec_31,\n    format="MM.DD.YYYY",\n)\nd\n
\n\n \n
\n", "description": "

Display a date input widget.

\n", "args": [ @@ -21559,7 +95622,7 @@ "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this date input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this date input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { @@ -21648,28 +95711,28 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/time_widgets.py#L415" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/time_widgets.py#L402" }, - "StatusContainer.dg": { + "DeltaGenerator.dg": { "name": "dg", - "signature": "StatusContainer.dg", + "signature": "element.dg", "description": "

Get our DeltaGenerator.

\n", "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/alert.py#L156" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/alert.py#L156" }, - "StatusContainer.divider": { + "DeltaGenerator.divider": { "name": "divider", - "signature": "StatusContainer.divider()", + "signature": "element.divider()", "example": "
\n
\nimport streamlit as st\n\nst.divider()\n
\n
\n", "description": "

Display a horizontal rule.

\n
\n

Note

\n

You can achieve the same effect with st.write("---") or\neven just "---" in your script (via magic).

\n
\n", "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/markdown.py#L258" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/markdown.py#L244" }, - "StatusContainer.download_button": { + "DeltaGenerator.download_button": { "name": "download_button", - "signature": "StatusContainer.download_button(label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "signature": "element.download_button(label, data, file_name=None, mime=None, key=None, help=None, on_click=None, args=None, kwargs=None, *, disabled=False, use_container_width=False)", "examples": "
\n

Download a large DataFrame as a CSV:

\n
\nimport streamlit as st\n\n@st.cache\ndef convert_df(df):\n    # IMPORTANT: Cache the conversion to prevent computation on every rerun\n    return df.to_csv().encode('utf-8')\n\ncsv = convert_df(my_large_df)\n\nst.download_button(\n    label="Download data as CSV",\n    data=csv,\n    file_name='large_df.csv',\n    mime='text/csv',\n)\n
\n

Download a string as a file:

\n
\nimport streamlit as st\n\ntext_contents = '''This is some text'''\nst.download_button('Download some text', text_contents)\n
\n

Download a binary file:

\n
\nimport streamlit as st\n\nbinary_contents = b'example content'\n# Defaults to 'application/octet-stream'\nst.download_button('Download binary file', binary_contents)\n
\n

Download an image:

\n
\nimport streamlit as st\n\nwith open("flower.png", "rb") as file:\n    btn = st.download_button(\n            label="Download image",\n            data=file,\n            file_name="flower.png",\n            mime="image/png"\n          )\n
\n\n \n
\n", "description": "

Display a download button widget.

\n

This is useful when you would like to provide a way for your users\nto download a file directly from your app.

\n

Note that the data to be downloaded is stored in-memory while the\nuser is connected, so it's a good idea to keep file sizes under a\ncouple hundred megabytes to conserve memory.

\n", "args": [ @@ -21677,7 +95740,7 @@ "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "description": "

A short label explaining to the user what this button is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, and Emojis.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", "default": null }, { @@ -21736,13 +95799,6 @@ "description": "

An optional dict of kwargs to pass to the callback.

\n", "default": null }, - { - "name": "type", - "type_name": "\"secondary\" or \"primary\"", - "is_optional": false, - "description": "

An optional string that specifies the button type. Can be "primary" for a\nbutton with additional emphasis or "secondary" for a normal button. This\nargument can only be supplied by keyword. Defaults to "secondary".

\n", - "default": "s" - }, { "name": "disabled", "type_name": "bool", @@ -21766,20 +95822,20 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/button.py#L170" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/button.py#L169" }, - "StatusContainer.empty": { + "DeltaGenerator.empty": { "name": "empty", - "signature": "StatusContainer.empty()", + "signature": "element.empty()", "examples": "
\n

Overwriting elements in-place using "with" notation:

\n
\nimport streamlit as st\nimport time\n\nwith st.empty():\n    for seconds in range(60):\n        st.write(f"\u23f3 {seconds} seconds have passed")\n        time.sleep(1)\n    st.write("\u2714\ufe0f 1 minute over!")\n
\n

Replacing several elements, then clearing them:

\n
\nimport streamlit as st\n\nplaceholder = st.empty()\n\n# Replace the placeholder with some text:\nplaceholder.text("Hello")\n\n# Replace the text with a chart:\nplaceholder.line_chart({"data": [1, 5, 2, 6]})\n\n# Replace the chart with several elements:\nwith placeholder.container():\n    st.write("This is one element")\n    st.write("This is another")\n\n# Clear all those elements:\nplaceholder.empty()\n
\n
\n", "description": "

Insert a single-element container.

\n

Inserts a container into your app that can be used to hold a single element.\nThis allows you to, for example, remove elements at any point, or replace\nseveral elements at once (using a child multi-element container).

\n

To insert/replace/clear an element on the returned container, you can\nuse "with" notation or just call methods directly on the returned object.\nSee examples below.

\n", "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/empty.py#L24" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/empty.py#L24" }, - "StatusContainer.error": { + "DeltaGenerator.error": { "name": "error", - "signature": "StatusContainer.error(body, *, icon=None)", + "signature": "element.error(body, *, icon=None)", "example": "
\n
\nimport streamlit as st\n\nst.error('This is an error', icon="\ud83d\udea8")\n
\n
\n", "description": "

Display error message.

\n", "args": [ @@ -21799,11 +95855,11 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/alert.py#L27" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/alert.py#L27" }, - "StatusContainer.exception": { + "DeltaGenerator.exception": { "name": "exception", - "signature": "StatusContainer.exception(exception)", + "signature": "element.exception(exception)", "example": "
\n
\nimport streamlit as st\n\ne = RuntimeError('This is an exception of type RuntimeError')\nst.exception(e)\n
\n
\n", "description": "

Display an exception.

\n", "args": [ @@ -21816,11 +95872,11 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/exception.py#L50" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/exception.py#L50" }, - "StatusContainer.expander": { + "DeltaGenerator.expander": { "name": "expander", - "signature": "StatusContainer.expander(label, expanded=False)", + "signature": "element.expander(label, expanded=False)", "examples": "
\n

You can use with notation to insert any element into an expander

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nwith st.expander("See explanation"):\n    st.write(\\"\\"\\"\n        The chart above shows some numbers I picked for you.\n        I rolled actual dice for these, so they're *guaranteed* to\n        be random.\n    \\"\\"\\")\n    st.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\n\nst.bar_chart({"data": [1, 5, 2, 6, 2, 1]})\n\nexpander = st.expander("See explanation")\nexpander.write(\\"\\"\\"\n    The chart above shows some numbers I picked for you.\n    I rolled actual dice for these, so they're *guaranteed* to\n    be random.\n\\"\\"\\")\nexpander.image("https://static.streamlit.io/examples/dice.jpg")\n
\n\n \n
\n", "description": "

Insert a multi-element container that can be expanded/collapsed.

\n

Inserts a container into your app that can be used to hold multiple elements\nand can be expanded or collapsed by the user. When collapsed, all that is\nvisible is the provided label.

\n

To add elements to the returned container, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

Currently, you may not put expanders inside another expander.

\n
\n", "args": [ @@ -21828,7 +95884,7 @@ "name": "label", "type_name": "str", "is_optional": false, - "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "description": "

A string to use as the header for the expander. The label can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", "default": null }, { @@ -21840,11 +95896,11 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/layouts.py#L319" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/layouts.py#L315" }, - "StatusContainer.experimental_data_editor": { + "DeltaGenerator.experimental_data_editor": { "name": "experimental_data_editor", - "signature": "StatusContainer.experimental_data_editor(data, *, width=None, height=None, use_container_width=False, hide_index=None, column_order=None, column_config=None, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", + "signature": "element.experimental_data_editor(data, *, width=None, height=None, use_container_width=False, hide_index=None, column_order=None, column_config=None, num_rows=\"fixed\", disabled=False, key=None, on_change=None, args=None, kwargs=None)", "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

You can also allow the user to add and delete rows by setting num_rows to "dynamic":

\n
\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame(\n    [\n       {"command": "st.selectbox", "rating": 4, "is_widget": True},\n       {"command": "st.balloons", "rating": 5, "is_widget": False},\n       {"command": "st.time_input", "rating": 3, "is_widget": True},\n   ]\n)\nedited_df = st.data_editor(df, num_rows="dynamic")\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n

Or you can customize the data editor via column_config, hide_index, column_order, or disabled:

\n
\nimport pandas as pd\nimport streamlit as st\n\ndf = pd.DataFrame(\n    [\n        {"command": "st.selectbox", "rating": 4, "is_widget": True},\n        {"command": "st.balloons", "rating": 5, "is_widget": False},\n        {"command": "st.time_input", "rating": 3, "is_widget": True},\n    ]\n)\nedited_df = st.data_editor(\n    df,\n    column_config={\n        "command": "Streamlit Command",\n        "rating": st.column_config.NumberColumn(\n            "Your rating",\n            help="How much do you like this command (1-5)?",\n            min_value=1,\n            max_value=5,\n            step=1,\n            format="%d \u2b50",\n        ),\n        "is_widget": "Widget ?",\n    },\n    disabled=["command", "is_widget"],\n    hide_index=True,\n)\n\nfavorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]\nst.markdown(f"Your favorite command is **{favorite_command}** \ud83c\udf88")\n
\n\n \n
\n", "description": "

Display a data editor widget.

\n

The data editor widget allows you to edit dataframes and many other data structures in a table-like UI.

\n
\n

Warning

\n

When going from st.experimental_data_editor to st.data_editor in\n1.23.0, the data editor's representation in st.session_state was changed.\nThe edited_cells dictionary is now called edited_rows and uses a\ndifferent format ({0: {"column name": "edited value"}} instead of\n{"0:1": "edited value"}). You may need to adjust the code if your app uses\nst.experimental_data_editor in combination with st.session_state."

\n
\n", "args": [ @@ -21948,11 +96004,11 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/data_editor.py#L529" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/data_editor.py#L528" }, - "StatusContainer.file_uploader": { + "DeltaGenerator.file_uploader": { "name": "file_uploader", - "signature": "StatusContainer.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "signature": "element.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", "examples": "
\n

Insert a file uploader that accepts a single file at a time:

\n
\nimport streamlit as st\nimport pandas as pd\nfrom io import StringIO\n\nuploaded_file = st.file_uploader("Choose a file")\nif uploaded_file is not None:\n    # To read file as bytes:\n    bytes_data = uploaded_file.getvalue()\n    st.write(bytes_data)\n\n    # To convert to a string based IO:\n    stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))\n    st.write(stringio)\n\n    # To read file as string:\n    string_data = stringio.read()\n    st.write(string_data)\n\n    # Can be used wherever a "file-like" object is accepted:\n    dataframe = pd.read_csv(uploaded_file)\n    st.write(dataframe)\n
\n

Insert a file uploader that accepts multiple files at a time:

\n
\nimport streamlit as st\n\nuploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\nfor uploaded_file in uploaded_files:\n    bytes_data = uploaded_file.read()\n    st.write("filename:", uploaded_file.name)\n    st.write(bytes_data)\n
\n\n \n
\n", "description": "

Display a file uploader widget.

\n

By default, uploaded files are limited to 200MB. You can configure\nthis using the server.maxUploadSize config option. For more info\non how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options

\n", "args": [ @@ -21960,7 +96016,7 @@ "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this file uploader is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this file uploader is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { @@ -22035,11 +96091,11 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/file_uploader.py#L222" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/file_uploader.py#L214" }, - "StatusContainer.form": { + "DeltaGenerator.form": { "name": "form", - "signature": "StatusContainer.form(key, clear_on_submit=False)", + "signature": "element.form(key, clear_on_submit=False)", "examples": "
\n

Inserting elements using "with" notation:

\n
\nimport streamlit as st\n\nwith st.form("my_form"):\n   st.write("Inside the form")\n   slider_val = st.slider("Form slider")\n   checkbox_val = st.checkbox("Form checkbox")\n\n   # Every form must have a submit button.\n   submitted = st.form_submit_button("Submit")\n   if submitted:\n       st.write("slider", slider_val, "checkbox", checkbox_val)\n\nst.write("Outside the form")\n
\n\n \n

Inserting elements out of order:

\n
\nimport streamlit as st\n\nform = st.form("my_form")\nform.slider("Inside the form")\nst.slider("Outside the form")\n\n# Now add a submit button to the form:\nform.form_submit_button("Submit")\n
\n\n \n
\n", "description": "

Create a form that batches elements together with a "Submit" button.

\n

A form is a container that visually groups other elements and\nwidgets together, and contains a Submit button. When the form's\nSubmit button is pressed, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

To add elements to a form object, you can use "with" notation\n(preferred) or just call methods directly on the form. See\nexamples below.

\n

Forms have a few constraints:

\n
    \n
  • Every form must contain a st.form_submit_button.
  • \n
  • st.button and st.download_button cannot be added to a form.
  • \n
  • Forms can appear anywhere in your app (sidebar, columns, etc),\nbut they cannot be embedded inside other forms.
  • \n
  • Within a form, the only widget that can have a callback function is\nst.form_submit_button.
  • \n
\n", "args": [ @@ -22059,11 +96115,11 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/form.py#L118" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/form.py#L118" }, - "StatusContainer.form_submit_button": { + "DeltaGenerator.form_submit_button": { "name": "form_submit_button", - "signature": "StatusContainer.form_submit_button(label=\"Submit\", help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", + "signature": "element.form_submit_button(label=\"Submit\", help=None, on_click=None, args=None, kwargs=None, *, type=\"secondary\", disabled=False, use_container_width=False)", "description": "

Display a form submit button.

\n

When this button is clicked, all widget values inside the form will be\nsent to Streamlit in a batch.

\n

Every form must have a form_submit_button. A form_submit_button\ncannot exist outside a form.

\n

For more information about forms, check out our\nblog post.

\n", "args": [ { @@ -22131,11 +96187,11 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/form.py#L218" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/form.py#L218" }, - "StatusContainer.graphviz_chart": { + "DeltaGenerator.graphviz_chart": { "name": "graphviz_chart", - "signature": "StatusContainer.graphviz_chart(figure_or_dot, use_container_width=False)", + "signature": "element.graphviz_chart(figure_or_dot, use_container_width=False)", "example": "
\n
\nimport streamlit as st\nimport graphviz\n\n# Create a graphlib graph object\ngraph = graphviz.Digraph()\ngraph.edge('run', 'intr')\ngraph.edge('intr', 'runbl')\ngraph.edge('runbl', 'run')\ngraph.edge('run', 'kernel')\ngraph.edge('kernel', 'zombie')\ngraph.edge('kernel', 'sleep')\ngraph.edge('kernel', 'runmem')\ngraph.edge('sleep', 'swap')\ngraph.edge('swap', 'runswap')\ngraph.edge('runswap', 'new')\ngraph.edge('runswap', 'runmem')\ngraph.edge('new', 'runmem')\ngraph.edge('sleep', 'runmem')\n\nst.graphviz_chart(graph)\n
\n

Or you can render the chart from the graph using GraphViz's Dot\nlanguage:

\n
\nst.graphviz_chart('''\n    digraph {\n        run -> intr\n        intr -> runbl\n        runbl -> run\n        run -> kernel\n        kernel -> zombie\n        kernel -> sleep\n        kernel -> runmem\n        sleep -> swap\n        swap -> runswap\n        runswap -> new\n        runswap -> runmem\n        new -> runmem\n        sleep -> runmem\n    }\n''')\n
\n\n \n
\n", "description": "

Display a graph using the dagre-d3 library.

\n", "args": [ @@ -22155,19 +96211,19 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/graphviz_chart.py#L39" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/graphviz_chart.py#L39" }, - "StatusContainer.header": { + "DeltaGenerator.header": { "name": "header", - "signature": "StatusContainer.header(body, anchor=None, *, help=None, divider=False)", - "examples": "
\n
\nimport streamlit as st\n\nst.header('This is a header with a divider', divider='rainbow')\nst.header('_Streamlit_ is :blue[cool] :sunglasses:')\n
\n\n \n
\n", + "signature": "element.header(body, anchor=None, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.header('This is a header')\nst.header('A header with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", "description": "

Display text in header formatting.

\n", "args": [ { "name": "body", "type_name": "str", "is_optional": false, - "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", "default": null }, { @@ -22183,21 +96239,14 @@ "is_optional": false, "description": "

An optional tooltip that gets displayed next to the header.

\n", "default": null - }, - { - "name": "divider", - "type_name": "bool or \u201cblue\u201d, \u201cgreen\u201d, \u201corange\u201d, \u201cred\u201d, \u201cviolet\u201d, \u201cgray\u201d/\"grey\", or \u201crainbow\u201d", - "is_optional": false, - "description": "

Shows a colored divider below the header. If True, successive\nheaders will cycle through divider colors. That is, the first\nheader will have a blue line, the second header will have a\ngreen line, and so on. If a string, the color can be set to one of\nthe following: blue, green, orange, red, violet, gray/grey, or\nrainbow.

\n", - "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/heading.py#L41" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/heading.py#L40" }, - "StatusContainer.help": { + "DeltaGenerator.help": { "name": "help", - "signature": "StatusContainer.help(obj=)", + "signature": "element.help(obj=)", "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nimport streamlit as st\nimport pandas\n\nst.help(pandas.DataFrame)\n
\n\n \n

Want to quickly check what data type is output by a certain function?\nTry:

\n
\nimport streamlit as st\n\nx = my_poorly_documented_function()\nst.help(x)\n
\n

Want to quickly inspect an object? No sweat:

\n
\nclass Dog:\n  '''A typical dog.'''\n\n  def __init__(self, breed, color):\n    self.breed = breed\n    self.color = color\n\n  def bark(self):\n    return 'Woof!'\n\n\nfido = Dog('poodle', 'white')\n\nst.help(fido)\n
\n\n \n

And if you're using Magic, you can get help for functions, classes,\nand modules without even typing st.help:

\n
\nimport streamlit as st\nimport pandas\n\n# Get help for Pandas read_csv:\npandas.read_csv\n\n# Get help for Streamlit itself:\nst\n
\n\n \n
\n", "description": "

Display help and other information for a given object.

\n

Depending on the type of object that is passed in, this displays the\nobject's name, type, value, signature, docstring, and member variables,\nmethods \u2014 as well as the values/docstring of members and methods.

\n", "args": [ @@ -22210,15 +96259,15 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/doc_string.py#L48" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/doc_string.py#L48" }, - "StatusContainer.id": { + "DeltaGenerator.id": { "name": "id", - "signature": "StatusContainer.id" + "signature": "element.id" }, - "StatusContainer.image": { + "DeltaGenerator.image": { "name": "image", - "signature": "StatusContainer.image(image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", + "signature": "element.image(image, caption=None, width=None, use_column_width=None, clamp=False, channels=\"RGB\", output_format=\"auto\")", "example": "
\n
\nimport streamlit as st\nfrom PIL import Image\n\nimage = Image.open('sunrise.jpg')\n\nst.image(image, caption='Sunrise by the mountains')\n
\n\n \n
\n", "description": "

Display an image or list of images.

\n", "args": [ @@ -22273,11 +96322,11 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/image.py#L87" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/image.py#L88" }, - "StatusContainer.info": { + "DeltaGenerator.info": { "name": "info", - "signature": "StatusContainer.info(body, *, icon=None)", + "signature": "element.info(body, *, icon=None)", "example": "
\n
\nimport streamlit as st\n\nst.info('This is a purely informational message', icon="\u2139\ufe0f")\n
\n
\n", "description": "

Display an informational message.

\n", "args": [ @@ -22297,11 +96346,11 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/alert.py#L91" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/alert.py#L91" }, - "StatusContainer.json": { + "DeltaGenerator.json": { "name": "json", - "signature": "StatusContainer.json(body, *, expanded=True)", + "signature": "element.json(body, *, expanded=True)", "example": "
\n
\nimport streamlit as st\n\nst.json({\n    'foo': 'bar',\n    'baz': 'boz',\n    'stuff': [\n        'stuff 1',\n        'stuff 2',\n        'stuff 3',\n        'stuff 5',\n    ],\n})\n
\n\n \n
\n", "description": "

Display object or string as a pretty-printed JSON string.

\n", "args": [ @@ -22321,11 +96370,11 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/json.py#L35" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/json.py#L35" }, - "StatusContainer.latex": { + "DeltaGenerator.latex": { "name": "latex", - "signature": "StatusContainer.latex(body, *, help=None)", + "signature": "element.latex(body, *, help=None)", "example": "
\n
\nimport streamlit as st\n\nst.latex(r'''\n    a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n    \\sum_{k=0}^{n-1} ar^k =\n    a \\left(\\frac{1-r^{n}}{1-r}\\right)\n    ''')\n
\n
\n", "description": "

Display mathematical expressions formatted as LaTeX.

\n

Supported LaTeX functions are listed at\nhttps://katex.org/docs/supported.html.

\n", "args": [ @@ -22345,12 +96394,12 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/markdown.py#L210" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/markdown.py#L196" }, - "StatusContainer.line_chart": { + "DeltaGenerator.line_chart": { "name": "line_chart", - "signature": "StatusContainer.line_chart(data=None, *, x=None, y=None, color=None, width=0, height=0, use_container_width=True)", - "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\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 \n

You can also choose different columns to use for x and y, as well as set\nthe color dynamically based on a 3rd column (assuming your dataframe is in\nlong format):

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame({\n    'col1' : np.random.randn(20),\n    'col2' : np.random.randn(20),\n    'col3' : np.random.choice(['A','B','C'], 20)\n})\n\nst.line_chart(\n    chart_data,\n    x = 'col1',\n    y = 'col2',\n    color = 'col3'\n)\n
\n\n \n

Finally, if your dataframe is in wide format, you can group multiple\ncolumns under the y argument to show multiple lines with different\ncolors:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(20, 3),\n    columns = ['col1', 'col2', 'col3'])\n\nst.line_chart(\n    chart_data,\n    x = 'col1',\n    y = ['col2', 'col3'],\n    color = ['#FF0000', '#0000FF']  # Optional\n)\n
\n\n \n
\n", + "signature": "element.line_chart(data=None, *, x=None, y=None, width=0, height=0, use_container_width=True)", + "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\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 \n
\n", "description": "

Display a line chart.

\n

This is syntax-sugar around st.altair_chart. The main difference\nis this command uses the data's own column and indices to figure out\nthe chart's spec. As a result this is easier to use for many "just plot\nthis" scenarios, while being less customizable.

\n

If st.line_chart does not guess the data specification\ncorrectly, try specifying your desired chart using st.altair_chart.

\n", "args": [ { @@ -22374,13 +96423,6 @@ "description": "

Column name(s) to use for the y-axis. If a sequence of strings, draws several series\non the same chart by melting your wide-format table into a long-format table behind\nthe scenes. If None, draws the data of all remaining columns as data series.\nThis argument can only be supplied by keyword.

\n", "default": null }, - { - "name": "color", - "type_name": "str, tuple, sequence of str, sequence of tuple, or None", - "is_optional": false, - "description": "

The color to use for different lines in this chart. This argument\ncan only be supplied by keyword.

\n

For a line chart with just one line, this can be:

\n
    \n
  • None, to use the default color.
  • \n
  • A hex string like "#ffaa00" or "#ffaa0088".
  • \n
  • An RGB or RGBA tuple with the red, green, blue, and alpha\ncomponents specified as ints from 0 to 255 or floats from 0.0 to\n1.0.
  • \n
\n

For a line chart with multiple lines, where the dataframe is in\nlong format (that is, y is None or just one column), this can be:

\n
    \n
  • None, to use the default colors.

    \n
  • \n
  • The name of a column in the dataset. Data points will be grouped\ninto lines of the same color based on the value of this column.\nIn addition, if the values in this column match one of the color\nformats above (hex string or color tuple), then that color will\nbe used.

    \n

    For example: if the dataset has 1000 rows, but this column can\nonly contains the values "adult", "child", "baby", then\nthose 1000 datapoints will be grouped into three lines, whose\ncolors will be automatically selected from the default palette.

    \n

    But, if for the same 1000-row dataset, this column contained\nthe values "#ffaa00", "#f0f", "#0000ff", then then those 1000\ndatapoints would still be grouped into three lines, but their\ncolors would be "#ffaa00", "#f0f", "#0000ff" this time around.

    \n
  • \n
\n

For a line chart with multiple lines, where the dataframe is in\nwide format (that is, y is a sequence of columns), this can be:

\n
    \n
  • None, to use the default colors.
  • \n
  • A list of string colors or color tuples to be used for each of\nthe lines in the chart. This list should have the same length\nas the number of y values (e.g. color=["#fd0", "#f0f", "#04f"]\nfor three lines).
  • \n
\n", - "default": "color" - }, { "name": "width", "type_name": "int", @@ -22404,11 +96446,11 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L231" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/dataframe_selector.py#L230" }, - "StatusContainer.map": { + "DeltaGenerator.map": { "name": "map", - "signature": "StatusContainer.map(data=None, *, latitude=None, longitude=None, color=None, size=None, zoom=None, use_container_width=True)", + "signature": "element.map(data=None, *, latitude=None, longitude=None, color=None, size=None, zoom=None, use_container_width=True)", "examples": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n    columns=['lat', 'lon'])\n\nst.map(df)\n
\n\n \n

You can also customize the size and color of the datapoints:

\n
\nst.map(df, size=20, color='#0044ff')\n
\n

And finally, you can choose different columns to use for the latitude\nand longitude components, as well as set size and color of each\ndatapoint dynamically based on other columns:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame({\n    "col1": np.random.randn(1000) / 50 + 37.76,\n    "col2": np.random.randn(1000) / 50 + -122.4,\n    "col3": np.random.randn(1000) * 100,\n    "col4": np.random.rand(1000, 4).tolist(),\n})\n\nst.map(df,\n    latitude='col1',\n    longitude='col2',\n    size='col3',\n    color='col4')\n
\n\n \n
\n", "description": "

Display a map with a scatterplot overlaid onto it.

\n

This is a wrapper around st.pydeck_chart to quickly create\nscatterplot charts on top of a map, with auto-centering and auto-zoom.

\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", "args": [ @@ -22463,19 +96505,19 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/map.py#L91" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/map.py#L91" }, - "StatusContainer.markdown": { + "DeltaGenerator.markdown": { "name": "markdown", - "signature": "StatusContainer.markdown(body, unsafe_allow_html=False, *, help=None)", - "examples": "
\n
\nimport streamlit as st\n\nst.markdown("*Streamlit* is **really** ***cool***.")\nst.markdown('''\n    :red[Streamlit] :orange[can] :green[write] :blue[text] :violet[in]\n    :gray[pretty] :rainbow[colors].''')\nst.markdown("Here's a bouquet &mdash;\\\n            :tulip::cherry_blossom::rose::hibiscus::sunflower::blossom:")\n\nmulti = '''If you end a line with two spaces,\na soft return is used for the next line.\n\nTwo (or more) newline characters in a row will result in a hard return.\n'''\nst.markdown(multi)\n
\n\n \n
\n", + "signature": "element.markdown(body, unsafe_allow_html=False, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.markdown('Streamlit is **_really_ cool**.')\nst.markdown("This text is :red[colored red], and this is **:blue[colored]** and bold.")\nst.markdown(":green[$\\sqrt{x^2+y^2}=1$] is a Pythagorean identity. :pencil:")\n
\n
\n", "description": "

Display string formatted as Markdown.

\n", "args": [ { "name": "body", "type_name": "str", "is_optional": false, - "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", "default": null }, { @@ -22494,11 +96536,11 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/markdown.py#L31" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/markdown.py#L31" }, - "StatusContainer.metric": { + "DeltaGenerator.metric": { "name": "metric", - "signature": "StatusContainer.metric(label, value, delta=None, delta_color=\"normal\", help=None, label_visibility=\"visible\")", + "signature": "element.metric(label, value, delta=None, delta_color=\"normal\", help=None, label_visibility=\"visible\")", "example": "
\n
\nimport streamlit as st\n\nst.metric(label="Temperature", value="70 \u00b0F", delta="1.2 \u00b0F")\n
\n\n \n

st.metric looks especially nice in combination with st.columns:

\n
\nimport streamlit as st\n\ncol1, col2, col3 = st.columns(3)\ncol1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\ncol2.metric("Wind", "9 mph", "-8%")\ncol3.metric("Humidity", "86%", "4%")\n
\n\n \n

The delta indicator color can also be inverted or turned off:

\n
\nimport streamlit as st\n\nst.metric(label="Gas price", value=4, delta=-0.5,\n    delta_color="inverse")\n\nst.metric(label="Active developers", value=123, delta=123,\n    delta_color="off")\n
\n\n \n
\n", "description": "

Display a metric in big bold font, with an optional indicator of how the metric changed.

\n

Tip: If you want to display a large number, it may be a good idea to\nshorten it using packages like millify\nor numerize. E.g. 1234 can be\ndisplayed as 1.2k using st.metric("Short number", millify(1234)).

\n", "args": [ @@ -22506,7 +96548,7 @@ "name": "label", "type_name": "str", "is_optional": false, - "description": "

The header or title for the metric. The label can optionally contain\nMarkdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "description": "

The header or title for the metric. The label can optionally contain\nMarkdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", "default": null }, { @@ -22546,11 +96588,11 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/metric.py#L46" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/metric.py#L46" }, - "StatusContainer.multiselect": { + "DeltaGenerator.multiselect": { "name": "multiselect", - "signature": "StatusContainer.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, max_selections=None, placeholder=\"Choose an option\", disabled=False, label_visibility=\"visible\")", + "signature": "element.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, max_selections=None, placeholder=\"Choose an option\", disabled=False, label_visibility=\"visible\")", "example": "
\n
\nimport streamlit as st\n\noptions = st.multiselect(\n    'What are your favorite colors',\n    ['Green', 'Yellow', 'Red', 'Blue'],\n    ['Yellow', 'Red'])\n\nst.write('You selected:', options)\n
\n\n \n
\n", "description": "

Display a multiselect widget.

\n

The multiselect widget starts as empty.

\n", "args": [ @@ -22558,7 +96600,7 @@ "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { @@ -22654,11 +96696,11 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/multiselect.py#L146" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/multiselect.py#L145" }, - "StatusContainer.number_input": { + "DeltaGenerator.number_input": { "name": "number_input", - "signature": "StatusContainer.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "signature": "element.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", "example": "
\n
\nimport streamlit as st\n\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n
\n", "description": "

Display a numeric input widget.

\n
\n

Note

\n

Integer values exceeding +/- (1<<53) - 1 cannot be accurately\nstored or returned by the widget due to serialization contstraints\nbetween the Python server and JavaScript client. You must handle\nsuch numbers as floats, leading to a loss in precision.

\n
\n", "args": [ @@ -22666,7 +96708,7 @@ "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { @@ -22762,11 +96804,11 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/number_input.py#L67" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/number_input.py#L66" }, - "StatusContainer.plotly_chart": { + "DeltaGenerator.plotly_chart": { "name": "plotly_chart", - "signature": "StatusContainer.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", theme=\"streamlit\", **kwargs)", + "signature": "element.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", theme=\"streamlit\", **kwargs)", "example": "
\n

The example below comes straight from the examples at\nhttps://plot.ly/python:

\n
\nimport streamlit as st\nimport numpy as np\nimport plotly.figure_factory as ff\n\n# Add histogram data\nx1 = np.random.randn(200) - 2\nx2 = np.random.randn(200)\nx3 = np.random.randn(200) + 2\n\n# Group data together\nhist_data = [x1, x2, x3]\n\ngroup_labels = ['Group 1', 'Group 2', 'Group 3']\n\n# Create distplot with custom bin_size\nfig = ff.create_distplot(\n        hist_data, group_labels, bin_size=[.1, .25, .5])\n\n# Plot!\nst.plotly_chart(fig, use_container_width=True)\n
\n\n \n
\n", "description": "

Display an interactive Plotly chart.

\n

Plotly is a charting library for Python. The arguments to this function\nclosely follow the ones for Plotly's plot() function. You can find\nmore about Plotly at https://plot.ly/python.

\n

To show Plotly charts in Streamlit, call st.plotly_chart wherever you\nwould call Plotly's py.plot or py.iplot.

\n", "args": [ @@ -22807,11 +96849,11 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/plotly_chart.py#L81" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/plotly_chart.py#L81" }, - "StatusContainer.progress": { + "DeltaGenerator.progress": { "name": "progress", - "signature": "StatusContainer.progress(value, text=None)", + "signature": "element.progress(value, text=None)", "example": "
\n

Here is an example of a progress bar increasing over time:

\n
\nimport streamlit as st\nimport time\n\nprogress_text = "Operation in progress. Please wait."\nmy_bar = st.progress(0, text=progress_text)\n\nfor percent_complete in range(100):\n    time.sleep(0.1)\n    my_bar.progress(percent_complete + 1, text=progress_text)\n
\n
\n", "description": "

Display a progress bar.

\n", "args": [ @@ -22826,16 +96868,16 @@ "name": "text", "type_name": "str or None", "is_optional": false, - "description": "

A message to display above the progress bar. The text can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "description": "

A message to display above the progress bar. The text can optionally\ncontain Markdown and supports the following elements: Bold, Italics,\nStrikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/progress.py#L66" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/progress.py#L66" }, - "StatusContainer.pydeck_chart": { + "DeltaGenerator.pydeck_chart": { "name": "pydeck_chart", - "signature": "StatusContainer.pydeck_chart(pydeck_obj=None, use_container_width=False)", + "signature": "element.pydeck_chart(pydeck_obj=None, use_container_width=False)", "example": "
\n

Here's a chart using a HexagonLayer and a ScatterplotLayer. It uses either the\nlight or dark map style, based on which Streamlit theme is currently active:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport pydeck as pdk\n\nchart_data = pd.DataFrame(\n   np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n   columns=['lat', 'lon'])\n\nst.pydeck_chart(pdk.Deck(\n    map_style=None,\n    initial_view_state=pdk.ViewState(\n        latitude=37.76,\n        longitude=-122.4,\n        zoom=11,\n        pitch=50,\n    ),\n    layers=[\n        pdk.Layer(\n           'HexagonLayer',\n           data=chart_data,\n           get_position='[lon, lat]',\n           radius=200,\n           elevation_scale=4,\n           elevation_range=[0, 1000],\n           pickable=True,\n           extruded=True,\n        ),\n        pdk.Layer(\n            'ScatterplotLayer',\n            data=chart_data,\n            get_position='[lon, lat]',\n            get_color='[200, 30, 0, 160]',\n            get_radius=200,\n        ),\n    ],\n))\n
\n\n \n
\n

Note

\n

To make the PyDeck chart's style consistent with Streamlit's theme,\nyou can set map_style=None in the pydeck.Deck object.

\n
\n
\n", "description": "

Draw a chart using the PyDeck library.

\n

This supports 3D maps, point clouds, and more! More info about PyDeck\nat https://deckgl.readthedocs.io/en/latest/.

\n

These docs are also quite useful:

\n\n

When using this command, Mapbox provides the map tiles to render map\ncontent. Note that Mapbox is a third-party product, the use of which is\ngoverned by Mapbox's Terms of Use.

\n

Mapbox requires users to register and provide a token before users can\nrequest map tiles. Currently, Streamlit provides this token for you, but\nthis could change at any time. We strongly recommend all users create and\nuse their own personal Mapbox token to avoid any disruptions to their\nexperience. You can do this with the mapbox.token config option.

\n

To get a token for yourself, create an account at https://mapbox.com.\nFor more info on how to set config options, see\nhttps://docs.streamlit.io/library/advanced-features/configuration

\n", "args": [ @@ -22855,11 +96897,11 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/deck_gl_json_chart.py#L37" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/deck_gl_json_chart.py#L36" }, - "StatusContainer.pyplot": { + "DeltaGenerator.pyplot": { "name": "pyplot", - "signature": "StatusContainer.pyplot(fig=None, clear_figure=None, use_container_width=True, **kwargs)", + "signature": "element.pyplot(fig=None, clear_figure=None, use_container_width=True, **kwargs)", "notes": "
\n
\n

Note

\n

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

\n
\n

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

\n
\necho "backend: TkAgg" >> ~/.matplotlib/matplotlibrc\n
\n

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

\n
\n", "example": "
\n
\nimport streamlit as st\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.random.normal(1, 1, size=100)\nfig, ax = plt.subplots()\nax.hist(arr, bins=20)\n\nst.pyplot(fig)\n
\n\n \n
\n", "description": "

Display a matplotlib.pyplot figure.

\n", @@ -22894,26 +96936,26 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/pyplot.py#L38" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/pyplot.py#L38" }, - "StatusContainer.radio": { + "DeltaGenerator.radio": { "name": "radio", - "signature": "StatusContainer.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, captions=None, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\ngenre = st.radio(\n    "What's your favorite movie genre",\n    [":rainbow[Comedy]", "***Drama***", "Documentary :movie_camera:"],\n    captions = ["Laugh out loud.", "Get the popcorn.", "Never stop learning."])\n\nif genre == ':rainbow[Comedy]':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn\\'t select comedy.")\n
\n\n \n
\n", + "signature": "element.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, horizontal=False, label_visibility=\"visible\")", + "example": "
\n
\nimport streamlit as st\n\ngenre = st.radio(\n    "What\\'s your favorite movie genre",\n    ('Comedy', 'Drama', 'Documentary'))\n\nif genre == 'Comedy':\n    st.write('You selected comedy.')\nelse:\n    st.write("You didn\\'t select comedy.")\n
\n\n \n
\n", "description": "

Display a radio button widget.

\n", "args": [ { "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this radio group is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this radio group is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { "name": "options", "type_name": "Sequence, numpy.ndarray, pandas.Series, pandas.DataFrame, or pandas.Index", "is_optional": false, - "description": "

Labels for the radio options. Labels can include markdown as\ndescribed in the label parameter and will be cast to str\ninternally by default. For pandas.DataFrame, the first column is\nselected.

\n", + "description": "

Labels for the radio options. This will be cast to str internally\nby default. For pandas.DataFrame, the first column is selected.

\n", "default": null }, { @@ -22979,13 +97021,6 @@ "description": "

An optional boolean, which orients the radio group horizontally.\nThe default is false (vertical buttons). This argument can only\nbe supplied by keyword.

\n", "default": "false" }, - { - "name": "captions", - "type_name": "iterable of str or None", - "is_optional": false, - "description": "

A list of captions to show below each radio button. If None (default),\nno captions are shown.

\n", - "default": null - }, { "name": "label_visibility", "type_name": "\"visible\", \"hidden\", or \"collapsed\"", @@ -23002,11 +97037,11 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/radio.py#L76" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/radio.py#L75" }, - "StatusContainer.select_slider": { + "DeltaGenerator.select_slider": { "name": "select_slider", - "signature": "StatusContainer.select_slider(label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "signature": "element.select_slider(label, options=(), value=None, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", "examples": "
\nimport streamlit as st\n\ncolor = st.select_slider(\n    'Select a color of the rainbow',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\nst.write('My favorite color is', color)\n
\n

And here's an example of a range select slider:

\n
\nimport streamlit as st\n\nstart_color, end_color = st.select_slider(\n    'Select a range of color wavelength',\n    options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],\n    value=('red', 'blue'))\nst.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n\n \n ", "description": "

Display a slider widget to select items from a list.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.select_slider and st.slider is that\nselect_slider accepts any datatype and takes an iterable set of\noptions, while slider only accepts numerical or date/time data and\ntakes a range as input.

\n", "args": [ @@ -23014,7 +97049,7 @@ "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { @@ -23096,11 +97131,11 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/select_slider.py#L107" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/select_slider.py#L106" }, - "StatusContainer.selectbox": { + "DeltaGenerator.selectbox": { "name": "selectbox", - "signature": "StatusContainer.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=\"Select...\", disabled=False, label_visibility=\"visible\")", + "signature": "element.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=\"Select...\", disabled=False, label_visibility=\"visible\")", "example": "
\n
\nimport streamlit as st\n\noption = st.selectbox(\n    'How would you like to be contacted?',\n    ('Email', 'Home phone', 'Mobile phone'))\n\nst.write('You selected:', option)\n
\n\n \n
\n", "description": "

Display a select widget.

\n", "args": [ @@ -23108,7 +97143,7 @@ "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this select widget is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { @@ -23197,11 +97232,11 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/selectbox.py#L72" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/selectbox.py#L71" }, - "StatusContainer.slider": { + "DeltaGenerator.slider": { "name": "slider", - "signature": "StatusContainer.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "signature": "element.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", "examples": "
\n
\nimport streamlit as st\n\nage = st.slider('How old are you?', 0, 130, 25)\nst.write("I'm ", age, 'years old')\n
\n

And here's an example of a range slider:

\n
\nimport streamlit as st\n\nvalues = st.slider(\n    'Select a range of values',\n    0.0, 100.0, (25.0, 75.0))\nst.write('Values:', values)\n
\n

This is a range time slider:

\n
\nimport streamlit as st\nfrom datetime import time\n\nappointment = st.slider(\n    "Schedule your appointment:",\n    value=(time(11, 30), time(12, 45)))\nst.write("You're scheduled for:", appointment)\n
\n

Finally, a datetime slider:

\n
\nimport streamlit as st\nfrom datetime import datetime\n\nstart_time = st.slider(\n    "When do you start?",\n    value=datetime(2020, 1, 1, 9, 30),\n    format="MM/DD/YY - hh:mm")\nst.write("Start time:", start_time)\n
\n\n \n
\n", "description": "

Display a slider widget.

\n

This supports int, float, date, time, and datetime types.

\n

This also allows you to render a range slider by passing a two-element\ntuple or list as the value.

\n

The difference between st.slider and st.select_slider is that\nslider only accepts numerical or date/time data and takes a range as\ninput, while select_slider accepts any datatype and takes an iterable\nset of options.

\n
\n

Note

\n

Integer values exceeding +/- (1<<53) - 1 cannot be accurately\nstored or returned by the widget due to serialization contstraints\nbetween the Python server and JavaScript client. You must handle\nsuch numbers as floats, leading to a loss in precision.

\n
\n", "args": [ @@ -23209,7 +97244,7 @@ "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this slider is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { @@ -23305,66 +97340,28 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/slider.py#L173" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/slider.py#L172" }, - "StatusContainer.snow": { + "DeltaGenerator.snow": { "name": "snow", - "signature": "StatusContainer.snow()", + "signature": "element.snow()", "example": "
\n
\nimport streamlit as st\n\nst.snow()\n
\n

...then watch your app and get ready for a cool celebration!

\n
\n", "description": "

Draw celebratory snowfall.

\n", "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/snow.py#L25" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/snow.py#L25" }, - "StatusContainer.status": { - "name": "status", - "signature": "StatusContainer.status(label, *, expanded=False, state=\"running\")", - "examples": "
\n

You can use with notation to insert any element into an status container:

\n
\nimport time\nimport streamlit as st\n\nwith st.status("Downloading data..."):\n    st.write("Searching for data...")\n    time.sleep(2)\n    st.write("Found URL.")\n    time.sleep(1)\n    st.write("Downloading data...")\n    time.sleep(1)\n\nst.button('Rerun')\n
\n\n \n

You can also use .update() on the container to change the label, state,\nor expanded state:

\n
\nimport time\nimport streamlit as st\n\nwith st.status("Downloading data...", expanded=True) as status:\n    st.write("Searching for data...")\n    time.sleep(2)\n    st.write("Found URL.")\n    time.sleep(1)\n    st.write("Downloading data...")\n    time.sleep(1)\n    status.update(label="Download complete!", state="complete", expanded=False)\n\nst.button('Rerun')\n
\n\n \n
\n", - "description": "

Insert a status container to display output from long-running tasks.

\n

Inserts a container into your app that is typically used to show the status and\ndetails of a process or task. The container can hold multiple elements and can\nbe expanded or collapsed by the user similar to st.expander.\nWhen collapsed, all that is visible is the status icon and label.

\n

The label, state, and expanded state can all be updated by calling .update()\non the returned object. To add elements to the returned container, you can\nuse "with" notation (preferred) or just call methods directly on the returned\nobject.

\n

By default, st.status() initializes in the "running" state. When called using\n"with" notation, it automatically updates to the "complete" state at the end\nof the "with" block. See examples below for more details.

\n", - "args": [ - { - "name": "label", - "type_name": "str", - "is_optional": false, - "description": "

The initial label of the status container. The label can optionally\ncontain Markdown and supports the following elements: Bold,\nItalics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents)\nrender. Display unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", - "default": null - }, - { - "name": "expanded", - "type_name": "bool", - "is_optional": false, - "description": "

If True, initializes the status container in "expanded" state. Defaults to\nFalse (collapsed).

\n", - "default": "s" - }, - { - "name": "state", - "type_name": "\"running\", \"complete\", or \"error\"", - "is_optional": false, - "description": "

The initial state of the status container which determines which icon is\nshown:

\n
    \n
  • running (default): A spinner icon is shown.
  • \n
  • complete: A checkmark icon is shown.
  • \n
  • error: An error icon is shown.
  • \n
\n", - "default": null - } - ], - "returns": [ - { - "type_name": "StatusContainer", - "is_generator": false, - "description": "

A mutable status container that can hold multiple elements. The label, state,\nand expanded state can be updated after creation via .update().

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/layouts.py#L414" - }, - "StatusContainer.subheader": { + "DeltaGenerator.subheader": { "name": "subheader", - "signature": "StatusContainer.subheader(body, anchor=None, *, help=None, divider=False)", - "examples": "
\n
\nimport streamlit as st\n\nst.subheader('This is a subheader with a divider', divider='rainbow')\nst.subheader('_Streamlit_ is :blue[cool] :sunglasses:')\n
\n\n \n
\n", + "signature": "element.subheader(body, anchor=None, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.subheader('This is a subheader')\nst.subheader('A subheader with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", "description": "

Display text in subheader formatting.

\n", "args": [ { "name": "body", "type_name": "str", "is_optional": false, - "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", "default": null }, { @@ -23380,21 +97377,14 @@ "is_optional": false, "description": "

An optional tooltip that gets displayed next to the subheader.

\n", "default": null - }, - { - "name": "divider", - "type_name": "bool or \u201cblue\u201d, \u201cgreen\u201d, \u201corange\u201d, \u201cred\u201d, \u201cviolet\u201d, \u201cgray\u201d/\"grey\", or \u201crainbow\u201d", - "is_optional": false, - "description": "

Shows a colored divider below the header. If True, successive\nheaders will cycle through divider colors. That is, the first\nheader will have a blue line, the second header will have a\ngreen line, and so on. If a string, the color can be set to one of\nthe following: blue, green, orange, red, violet, gray/grey, or\nrainbow.

\n", - "default": null } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/heading.py#L111" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/heading.py#L93" }, - "StatusContainer.success": { + "DeltaGenerator.success": { "name": "success", - "signature": "StatusContainer.success(body, *, icon=None)", + "signature": "element.success(body, *, icon=None)", "example": "
\n
\nimport streamlit as st\n\nst.success('This is a success message!', icon="\u2705")\n
\n
\n", "description": "

Display a success message.

\n", "args": [ @@ -23414,11 +97404,11 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/alert.py#L124" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/alert.py#L124" }, - "StatusContainer.table": { + "DeltaGenerator.table": { "name": "table", - "signature": "StatusContainer.table(data=None)", + "signature": "element.table(data=None)", "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(\n   np.random.randn(10, 5),\n   columns=('col %d' % i for i in range(5)))\n\nst.table(df)\n
\n\n \n
\n", "description": "

Display a static table.

\n

This differs from st.dataframe in that the table in this case is\nstatic: its entire contents are laid out directly on the page.

\n", "args": [ @@ -23431,11 +97421,11 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L193" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/dataframe_selector.py#L192" }, - "StatusContainer.tabs": { + "DeltaGenerator.tabs": { "name": "tabs", - "signature": "StatusContainer.tabs(tabs)", + "signature": "element.tabs(tabs)", "examples": "
\n

You can use with notation to insert any element into a tab:

\n
\nimport streamlit as st\n\ntab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])\n\nwith tab1:\n   st.header("A cat")\n   st.image("https://static.streamlit.io/examples/cat.jpg", width=200)\n\nwith tab2:\n   st.header("A dog")\n   st.image("https://static.streamlit.io/examples/dog.jpg", width=200)\n\nwith tab3:\n   st.header("An owl")\n   st.image("https://static.streamlit.io/examples/owl.jpg", width=200)\n
\n\n \n

Or you can just call methods directly in the returned objects:

\n
\nimport streamlit as st\nimport numpy as np\n\ntab1, tab2 = st.tabs(["\ud83d\udcc8 Chart", "\ud83d\uddc3 Data"])\ndata = np.random.randn(10, 1)\n\ntab1.subheader("A tab with a chart")\ntab1.line_chart(data)\n\ntab2.subheader("A tab with the data")\ntab2.write(data)\n
\n\n \n
\n", "description": "

Insert containers separated into tabs.

\n

Inserts a number of multi-element containers as tabs.\nTabs are a navigational element that allows users to easily\nmove between groups of related content.

\n

To add elements to the returned containers, you can use "with" notation\n(preferred) or just call methods directly on the returned object. See\nexamples below.

\n
\n

Warning

\n

All the content of every tab is always sent to and rendered on the frontend.\nConditional rendering is currently not supported.

\n
\n", "args": [ @@ -23443,7 +97433,7 @@ "name": "tabs", "type_name": "list of strings", "is_optional": false, - "description": "

Creates a tab for each string in the list. The first tab is selected by default.\nThe string is used as the name of the tab and can optionally contain Markdown,\nsupporting the following elements: Bold, Italics, Strikethroughs, Inline Code,\nEmojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", + "description": "

Creates a tab for each string in the list. The first tab is selected by default.\nThe string is used as the name of the tab and can optionally contain Markdown,\nsupporting the following elements: Bold, Italics, Strikethroughs, Inline Code,\nEmojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n", "default": null } ], @@ -23455,11 +97445,11 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/layouts.py#L207" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/layouts.py#L203" }, - "StatusContainer.text": { + "DeltaGenerator.text": { "name": "text", - "signature": "StatusContainer.text(body, *, help=None)", + "signature": "element.text(body, *, help=None)", "example": "
\n
\nimport streamlit as st\n\nst.text('This is some text.')\n
\n
\n", "description": "

Write fixed-width and preformatted text.

\n", "args": [ @@ -23479,11 +97469,11 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/text.py#L27" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/text.py#L27" }, - "StatusContainer.text_area": { + "DeltaGenerator.text_area": { "name": "text_area", - "signature": "StatusContainer.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "signature": "element.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", "example": "
\n
\nimport streamlit as st\n\ntxt = st.text_area('Text to analyze', '''\n    It was the best of times, it was the worst of times, it was\n    the age of wisdom, it was the age of foolishness, it was\n    the epoch of belief, it was the epoch of incredulity, it\n    was the season of Light, it was the season of Darkness, it\n    was the spring of hope, it was the winter of despair, (...)\n    ''')\nst.write('Sentiment:', run_sentiment_analysis(txt))\n
\n
\n", "description": "

Display a multi-line text input widget.

\n", "args": [ @@ -23491,7 +97481,7 @@ "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { @@ -23580,11 +97570,11 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/text_widgets.py#L288" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/text_widgets.py#L274" }, - "StatusContainer.text_input": { + "DeltaGenerator.text_input": { "name": "text_input", - "signature": "StatusContainer.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", + "signature": "element.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility=\"visible\")", "example": "
\n
\nimport streamlit as st\n\ntitle = st.text_input('Movie title', 'Life of Brian')\nst.write('The current movie title is', title)\n
\n\n \n
\n", "description": "

Display a single-line text input widget.

\n", "args": [ @@ -23592,7 +97582,7 @@ "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { @@ -23688,11 +97678,11 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/text_widgets.py#L72" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/text_widgets.py#L71" }, - "StatusContainer.time_input": { + "DeltaGenerator.time_input": { "name": "time_input", - "signature": "StatusContainer.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", step=0:15:00)", + "signature": "element.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\", step=0:15:00)", "example": "
\n
\nimport datetime\nimport streamlit as st\n\nt = st.time_input('Set an alarm for', datetime.time(8, 45))\nst.write('Alarm is set for', t)\n
\n\n \n
\n", "description": "

Display a time input widget.

\n", "args": [ @@ -23700,7 +97690,7 @@ "name": "label", "type_name": "str", "is_optional": false, - "description": "

A short label explaining to the user what this time input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", + "description": "

A short label explaining to the user what this time input is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", "default": null }, { @@ -23775,19 +97765,19 @@ "return_name": null } ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/time_widgets.py#L219" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/time_widgets.py#L217" }, - "StatusContainer.title": { + "DeltaGenerator.title": { "name": "title", - "signature": "StatusContainer.title(body, anchor=None, *, help=None)", - "examples": "
\n
\nimport streamlit as st\n\nst.title('This is a title')\nst.title('_Streamlit_ is :blue[cool] :sunglasses:')\n
\n\n \n
\n", + "signature": "element.title(body, anchor=None, *, help=None)", + "examples": "
\n
\nimport streamlit as st\n\nst.title('This is a title')\nst.title('A title with _italics_ :blue[colors] and emojis :sunglasses:')\n
\n
\n", "description": "

Display text in title formatting.

\n

Each document should have a single st.title(), although this is not\nenforced.

\n", "args": [ { "name": "body", "type_name": "str", "is_optional": false, - "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", + "description": "

The text to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", "default": null }, { @@ -23806,11 +97796,11 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/heading.py#L181" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/heading.py#L146" }, - "StatusContainer.toast": { + "DeltaGenerator.toast": { "name": "toast", - "signature": "StatusContainer.toast(body, *, icon=None)", + "signature": "element.toast(body, *, icon=None)", "example": "
\n
\nimport streamlit as st\n\nst.toast('Your edited image was saved!', icon='\ud83d\ude0d')\n
\n
\n", "description": "

Display a short message, known as a notification "toast".

\n

The toast appears in the app's bottom-right corner and disappears after four seconds.

\n
\n

Warning

\n

st.toast is not compatible with Streamlit's caching and\ncannot be called within a cached function.

\n
\n", "args": [ @@ -23818,7 +97808,7 @@ "name": "body", "type_name": "str", "is_optional": false, - "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n", + "description": "

The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.
  • \n
\n", "default": null }, { @@ -23830,121 +97820,11 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/toast.py#L37" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/toast.py#L37" }, - "StatusContainer.toggle": { - "name": "toggle", - "signature": "StatusContainer.toggle(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", - "example": "
\n
\nimport streamlit as st\n\non = st.toggle('Activate feature')\n\nif on:\n    st.write('Feature activated!')\n
\n\n \n
\n", - "description": "

Display a toggle widget.

\n", - "args": [ - { - "name": "label", - "type_name": "str", - "is_optional": false, - "description": "

A short label explaining to the user what this toggle is for.\nThe label can optionally contain Markdown and supports the following\nelements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.

\n

This also supports:

\n
    \n
  • Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.
  • \n
  • LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
  • \n
  • Colored text, using the syntax :color[text to be colored],\nwhere color needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet, gray/grey, rainbow.
  • \n
\n

Unsupported elements are unwrapped so only their children (text contents) render.\nDisplay unsupported elements as literal characters by\nbackslash-escaping them. E.g. 1\\. Not an ordered list.

\n

For accessibility reasons, you should never set an empty label (label="")\nbut hide it with label_visibility if needed. In the future, we may disallow\nempty labels by raising an exception.

\n", - "default": null - }, - { - "name": "value", - "type_name": "bool", - "is_optional": false, - "description": "

Preselect the toggle when it first renders. This will be\ncast to bool internally.

\n", - "default": null - }, - { - "name": "key", - "type_name": "str or int", - "is_optional": false, - "description": "

An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share the same key.

\n", - "default": null - }, - { - "name": "help", - "type_name": "str", - "is_optional": false, - "description": "

An optional tooltip that gets displayed next to the toggle.

\n", - "default": null - }, - { - "name": "on_change", - "type_name": "callable", - "is_optional": false, - "description": "

An optional callback invoked when this toggle's value changes.

\n", - "default": null - }, - { - "name": "args", - "type_name": "tuple", - "is_optional": false, - "description": "

An optional tuple of args to pass to the callback.

\n", - "default": null - }, - { - "name": "kwargs", - "type_name": "dict", - "is_optional": false, - "description": "

An optional dict of kwargs to pass to the callback.

\n", - "default": null - }, - { - "name": "disabled", - "type_name": "bool", - "is_optional": false, - "description": "

An optional boolean, which disables the toggle if set to True.\nThe default is False. This argument can only be supplied by keyword.

\n", - "default": "False" - }, - { - "name": "label_visibility", - "type_name": "\"visible\", \"hidden\", or \"collapsed\"", - "is_optional": false, - "description": "

The visibility of the label. If "hidden", the label doesn't show but there\nis still empty space for it (equivalent to label="").\nIf "collapsed", both the label and the space are removed. Default is\n"visible". This argument can only be supplied by keyword.

\n", - "default": "is" - } - ], - "returns": [ - { - "type_name": "bool", - "is_generator": false, - "description": "

Whether or not the toggle is checked.

\n", - "return_name": null - } - ], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/widgets/checkbox.py#L156" - }, - "StatusContainer.update": { - "name": "update", - "signature": "StatusContainer.update(*, label=None, expanded=None, state=None)", - "description": "

Update the status container.

\n

Only specified arguments are updated. Container contents and unspecified\narguments remain unchanged.

\n", - "args": [ - { - "name": "label", - "type_name": "str or None", - "is_optional": false, - "description": "

A new label of the status container. If None, the label is not\nchanged.

\n", - "default": null - }, - { - "name": "expanded", - "type_name": "bool or None", - "is_optional": false, - "description": "

The new expanded state of the status container. If None,\nthe expanded state is not changed.

\n", - "default": null - }, - { - "name": "state", - "type_name": "\"running\", \"complete\", \"error\", or None", - "is_optional": false, - "description": "

The new state of the status container. This mainly changes the\nicon. If None, the state is not changed.

\n", - "default": null - } - ], - "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/lib/mutable_status_container.py#L95" - }, - "StatusContainer.vega_lite_chart": { + "DeltaGenerator.vega_lite_chart": { "name": "vega_lite_chart", - "signature": "StatusContainer.vega_lite_chart(data=None, spec=None, use_container_width=False, theme=\"streamlit\", **kwargs)", + "signature": "element.vega_lite_chart(data=None, spec=None, use_container_width=False, theme=\"streamlit\", **kwargs)", "example": "
\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nchart_data = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nst.vega_lite_chart(chart_data, {\n    'mark': {'type': 'circle', 'tooltip': True},\n    'encoding': {\n        'x': {'field': 'a', 'type': 'quantitative'},\n        'y': {'field': 'b', 'type': 'quantitative'},\n        'size': {'field': 'c', 'type': 'quantitative'},\n        'color': {'field': 'c', 'type': 'quantitative'},\n    },\n})\n
\n\n \n

Examples of Vega-Lite usage without Streamlit can be found at\nhttps://vega.github.io/vega-lite/examples/. Most of those can be easily\ntranslated to the syntax shown above.

\n
\n", "description": "

Display a chart using the Vega-Lite library.

\n", "args": [ @@ -23985,11 +97865,11 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/dataframe_selector.py#L819" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/dataframe_selector.py#L545" }, - "StatusContainer.video": { + "DeltaGenerator.video": { "name": "video", - "signature": "StatusContainer.video(data, format=\"video/mp4\", start_time=0)", + "signature": "element.video(data, format=\"video/mp4\", start_time=0)", "example": "
\n
\nimport streamlit as st\n\nvideo_file = open('myvideo.mp4', 'rb')\nvideo_bytes = video_file.read()\n\nst.video(video_bytes)\n
\n\n \n
\n

Note

\n

Some videos may not display if they are encoded using MP4V (which is an export option in OpenCV), as this codec is\nnot widely supported by browsers. Converting your video to H.264 will allow the video to be displayed in Streamlit.\nSee this StackOverflow post or this\nStreamlit forum post\nfor more information.

\n
\n
\n", "description": "

Display a video player.

\n", "args": [ @@ -24016,11 +97896,11 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/media.py#L115" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/media.py#L115" }, - "StatusContainer.warning": { + "DeltaGenerator.warning": { "name": "warning", - "signature": "StatusContainer.warning(body, *, icon=None)", + "signature": "element.warning(body, *, icon=None)", "example": "
\n
\nimport streamlit as st\n\nst.warning('This is a warning', icon="\u26a0\ufe0f")\n
\n
\n", "description": "

Display warning message.

\n", "args": [ @@ -24040,11 +97920,11 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/alert.py#L59" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/alert.py#L59" }, - "StatusContainer.write": { + "DeltaGenerator.write": { "name": "write", - "signature": "StatusContainer.write(*args, unsafe_allow_html=False, **kwargs)", + "signature": "element.write(*args, unsafe_allow_html=False, **kwargs)", "example": "
\n

Its basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:

\n
\nimport streamlit as st\n\nst.write('Hello, *World!* :sunglasses:')\n
\n\n \n

As mentioned earlier, st.write() also accepts other data formats, such as\nnumbers, data frames, styled data frames, and assorted objects:

\n
\nimport streamlit as st\nimport pandas as pd\n\nst.write(1234)\nst.write(pd.DataFrame({\n    'first column': [1, 2, 3, 4],\n    'second column': [10, 20, 30, 40],\n}))\n
\n\n \n

Finally, you can pass in multiple arguments to do things like:

\n
\nimport streamlit as st\n\nst.write('1 + 1 = ', 2)\nst.write('Below is a DataFrame:', data_frame, 'Above is a dataframe.')\n
\n\n \n

Oh, one more thing: st.write accepts chart objects too! For example:

\n
\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\n\ndf = pd.DataFrame(\n    np.random.randn(200, 3),\n    columns=['a', 'b', 'c'])\n\nc = alt.Chart(df).mark_circle().encode(\n    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n\nst.write(c)\n
\n\n \n
\n", "description": "

Write arguments to the app.

\n

This is the Swiss Army knife of Streamlit commands: it does different\nthings depending on what you throw at it. Unlike other Streamlit commands,\nwrite() has some unique properties:

\n
    \n
  1. You can pass in multiple arguments, all of which will be written.
  2. \n
  3. Its behavior depends on the input types as follows.
  4. \n
  5. It returns None, so its "slot" in the App cannot be reused.
  6. \n
\n", "args": [ @@ -24064,7 +97944,7 @@ } ], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/elements/write.py#L49" + "source": "https://github.com/streamlit/streamlit/blob/1.25.0/lib/streamlit/elements/write.py#L49" } }, "1.26.0": { @@ -25691,10 +99571,10 @@ "streamlit.experimental_rerun": { "name": "experimental_rerun", "signature": "st.experimental_rerun()", - "description": "

Rerun the script immediately.

\n

When st.experimental_rerun() is called, the script is halted - no\nmore statements will be run, and the script will be queued to re-run\nfrom the top.

\n

If this function is called outside of Streamlit, it will raise an\nException.

\n", + "description": "

Rerun the script immediately.

\n

When st.experimental_rerun() is called, the script is halted - no\nmore statements will be run, and the script will be queued to re-run\nfrom the top.

\n", "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/commands/execution_control.py#L47" + "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/commands/execution_control.py#L46" }, "streamlit.experimental_set_query_params": { "name": "experimental_set_query_params", @@ -26035,7 +99915,7 @@ }, "streamlit.help": { "name": "help", - "signature": "st.help(obj=)", + "signature": "st.help(obj=)", "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nimport streamlit as st\nimport pandas\n\nst.help(pandas.DataFrame)\n
\n\n \n

Want to quickly check what data type is output by a certain function?\nTry:

\n
\nimport streamlit as st\n\nx = my_poorly_documented_function()\nst.help(x)\n
\n

Want to quickly inspect an object? No sweat:

\n
\nclass Dog:\n  '''A typical dog.'''\n\n  def __init__(self, breed, color):\n    self.breed = breed\n    self.color = color\n\n  def bark(self):\n    return 'Woof!'\n\n\nfido = Dog('poodle', 'white')\n\nst.help(fido)\n
\n\n \n

And if you're using Magic, you can get help for functions, classes,\nand modules without even typing st.help:

\n
\nimport streamlit as st\nimport pandas\n\n# Get help for Pandas read_csv:\npandas.read_csv\n\n# Get help for Streamlit itself:\nst\n
\n\n \n
\n", "description": "

Display help and other information for a given object.

\n

Depending on the type of object that is passed in, this displays the\nobject's name, type, value, signature, docstring, and member variables,\nmethods \u2014 as well as the values/docstring of members and methods.

\n", "args": [ @@ -26302,7 +100182,7 @@ "streamlit.markdown": { "name": "markdown", "signature": "st.markdown(body, unsafe_allow_html=False, *, help=None)", - "examples": "
\n
\nimport streamlit as st\n\nst.markdown("*Streamlit* is **really** ***cool***.")\nst.markdown('''\n    :red[Streamlit] :orange[can] :green[write] :blue[text] :violet[in]\n    :gray[pretty] :rainbow[colors].''')\nst.markdown("Here's a bouquet &mdash;\\\n            :tulip::cherry_blossom::rose::hibiscus::sunflower::blossom:")\n\nmulti = '''If you end a line with two spaces,\na soft return is used for the next line.\n\nTwo (or more) newline characters in a row will result in a hard return.\n'''\nst.markdown(multi)\n
\n\n \n
\n", + "examples": "
\n
\nimport streamlit as st\n\nst.markdown("*Streamlit* is **really** ***cool***.")\nst.markdown('''\n    :red[Streamlit] :orange[can] :green[write] :blue[text] :violet[in]\n    :gray[pretty] :rainbow[colors].''')\nst.markdown("Here's a bouquet &mdash;\\\n            :tulip::cherry_blossom::rose::hibiscus::sunflower::blossom:")\n\nmulti = '''If you end a line with two spaces,\na soft return is used for the next line.\n\nTwo (or more) newline characters in a row will result in a hard return.\n'''\nst.markdown(multi)\n
\n\n \n
\n", "description": "

Display string formatted as Markdown.

\n", "args": [ { @@ -26492,7 +100372,7 @@ }, "streamlit.number_input": { "name": "number_input", - "signature": "st.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "signature": "st.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", "example": "
\n
\nimport streamlit as st\n\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n
\n", "description": "

Display a numeric input widget.

\n
\n

Note

\n

Integer values exceeding +/- (1<<53) - 1 cannot be accurately\nstored or returned by the widget due to serialization contstraints\nbetween the Python server and JavaScript client. You must handle\nsuch numbers as floats, leading to a loss in precision.

\n
\n", "args": [ @@ -27277,10 +101157,10 @@ "name": "stop", "signature": "st.stop()", "example": "
\n
\nimport streamlit as st\n\nname = st.text_input('Name')\nif not name:\n  st.warning('Please input a name.')\n  st.stop()\nst.success('Thank you for inputting a name.')\n
\n
\n", - "description": "

Stops execution immediately.

\n

Streamlit will not run any statements after st.stop().\nWe recommend rendering a message to explain why the script has stopped.\nWhen run outside of Streamlit, this will raise an Exception.

\n", + "description": "

Stops execution immediately.

\n

Streamlit will not run any statements after st.stop().\nWe recommend rendering a message to explain why the script has stopped.

\n", "args": [], "returns": [], - "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/commands/execution_control.py#L26" + "source": "https://github.com/streamlit/streamlit/blob/1.26.0/lib/streamlit/commands/execution_control.py#L21" }, "streamlit.subheader": { "name": "subheader", @@ -30824,7 +104704,7 @@ }, "DeltaGenerator.help": { "name": "help", - "signature": "element.help(obj=)", + "signature": "element.help(obj=)", "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nimport streamlit as st\nimport pandas\n\nst.help(pandas.DataFrame)\n
\n\n \n

Want to quickly check what data type is output by a certain function?\nTry:

\n
\nimport streamlit as st\n\nx = my_poorly_documented_function()\nst.help(x)\n
\n

Want to quickly inspect an object? No sweat:

\n
\nclass Dog:\n  '''A typical dog.'''\n\n  def __init__(self, breed, color):\n    self.breed = breed\n    self.color = color\n\n  def bark(self):\n    return 'Woof!'\n\n\nfido = Dog('poodle', 'white')\n\nst.help(fido)\n
\n\n \n

And if you're using Magic, you can get help for functions, classes,\nand modules without even typing st.help:

\n
\nimport streamlit as st\nimport pandas\n\n# Get help for Pandas read_csv:\npandas.read_csv\n\n# Get help for Streamlit itself:\nst\n
\n\n \n
\n", "description": "

Display help and other information for a given object.

\n

Depending on the type of object that is passed in, this displays the\nobject's name, type, value, signature, docstring, and member variables,\nmethods \u2014 as well as the values/docstring of members and methods.

\n", "args": [ @@ -31095,7 +104975,7 @@ "DeltaGenerator.markdown": { "name": "markdown", "signature": "element.markdown(body, unsafe_allow_html=False, *, help=None)", - "examples": "
\n
\nimport streamlit as st\n\nst.markdown("*Streamlit* is **really** ***cool***.")\nst.markdown('''\n    :red[Streamlit] :orange[can] :green[write] :blue[text] :violet[in]\n    :gray[pretty] :rainbow[colors].''')\nst.markdown("Here's a bouquet &mdash;\\\n            :tulip::cherry_blossom::rose::hibiscus::sunflower::blossom:")\n\nmulti = '''If you end a line with two spaces,\na soft return is used for the next line.\n\nTwo (or more) newline characters in a row will result in a hard return.\n'''\nst.markdown(multi)\n
\n\n \n
\n", + "examples": "
\n
\nimport streamlit as st\n\nst.markdown("*Streamlit* is **really** ***cool***.")\nst.markdown('''\n    :red[Streamlit] :orange[can] :green[write] :blue[text] :violet[in]\n    :gray[pretty] :rainbow[colors].''')\nst.markdown("Here's a bouquet &mdash;\\\n            :tulip::cherry_blossom::rose::hibiscus::sunflower::blossom:")\n\nmulti = '''If you end a line with two spaces,\na soft return is used for the next line.\n\nTwo (or more) newline characters in a row will result in a hard return.\n'''\nst.markdown(multi)\n
\n\n \n
\n", "description": "

Display string formatted as Markdown.

\n", "args": [ { @@ -31285,7 +105165,7 @@ }, "DeltaGenerator.number_input": { "name": "number_input", - "signature": "element.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "signature": "element.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", "example": "
\n
\nimport streamlit as st\n\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n
\n", "description": "

Display a numeric input widget.

\n
\n

Note

\n

Integer values exceeding +/- (1<<53) - 1 cannot be accurately\nstored or returned by the widget due to serialization contstraints\nbetween the Python server and JavaScript client. You must handle\nsuch numbers as floats, leading to a loss in precision.

\n
\n", "args": [ @@ -34234,7 +108114,7 @@ }, "StatusContainer.help": { "name": "help", - "signature": "StatusContainer.help(obj=)", + "signature": "StatusContainer.help(obj=)", "example": "
\n

Don't remember how to initialize a dataframe? Try this:

\n
\nimport streamlit as st\nimport pandas\n\nst.help(pandas.DataFrame)\n
\n\n \n

Want to quickly check what data type is output by a certain function?\nTry:

\n
\nimport streamlit as st\n\nx = my_poorly_documented_function()\nst.help(x)\n
\n

Want to quickly inspect an object? No sweat:

\n
\nclass Dog:\n  '''A typical dog.'''\n\n  def __init__(self, breed, color):\n    self.breed = breed\n    self.color = color\n\n  def bark(self):\n    return 'Woof!'\n\n\nfido = Dog('poodle', 'white')\n\nst.help(fido)\n
\n\n \n

And if you're using Magic, you can get help for functions, classes,\nand modules without even typing st.help:

\n
\nimport streamlit as st\nimport pandas\n\n# Get help for Pandas read_csv:\npandas.read_csv\n\n# Get help for Streamlit itself:\nst\n
\n\n \n
\n", "description": "

Display help and other information for a given object.

\n

Depending on the type of object that is passed in, this displays the\nobject's name, type, value, signature, docstring, and member variables,\nmethods \u2014 as well as the values/docstring of members and methods.

\n", "args": [ @@ -34505,7 +108385,7 @@ "StatusContainer.markdown": { "name": "markdown", "signature": "StatusContainer.markdown(body, unsafe_allow_html=False, *, help=None)", - "examples": "
\n
\nimport streamlit as st\n\nst.markdown("*Streamlit* is **really** ***cool***.")\nst.markdown('''\n    :red[Streamlit] :orange[can] :green[write] :blue[text] :violet[in]\n    :gray[pretty] :rainbow[colors].''')\nst.markdown("Here's a bouquet &mdash;\\\n            :tulip::cherry_blossom::rose::hibiscus::sunflower::blossom:")\n\nmulti = '''If you end a line with two spaces,\na soft return is used for the next line.\n\nTwo (or more) newline characters in a row will result in a hard return.\n'''\nst.markdown(multi)\n
\n\n \n
\n", + "examples": "
\n
\nimport streamlit as st\n\nst.markdown("*Streamlit* is **really** ***cool***.")\nst.markdown('''\n    :red[Streamlit] :orange[can] :green[write] :blue[text] :violet[in]\n    :gray[pretty] :rainbow[colors].''')\nst.markdown("Here's a bouquet &mdash;\\\n            :tulip::cherry_blossom::rose::hibiscus::sunflower::blossom:")\n\nmulti = '''If you end a line with two spaces,\na soft return is used for the next line.\n\nTwo (or more) newline characters in a row will result in a hard return.\n'''\nst.markdown(multi)\n
\n\n \n
\n", "description": "

Display string formatted as Markdown.

\n", "args": [ { @@ -34695,7 +108575,7 @@ }, "StatusContainer.number_input": { "name": "number_input", - "signature": "StatusContainer.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", + "signature": "StatusContainer.number_input(label, min_value=None, max_value=None, value=, step=None, format=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False, label_visibility=\"visible\")", "example": "
\n
\nimport streamlit as st\n\nnumber = st.number_input('Insert a number')\nst.write('The current number is ', number)\n
\n\n \n
\n", "description": "

Display a numeric input widget.

\n
\n

Note

\n

Integer values exceeding +/- (1<<53) - 1 cannot be accurately\nstored or returned by the widget due to serialization contstraints\nbetween the Python server and JavaScript client. You must handle\nsuch numbers as floats, leading to a loss in precision.

\n
\n", "args": [