- - {bold} - - {" "} - {children} -
-diff --git a/README.md b/README.md
index 448ab54cd..c6296a052 100644
--- a/README.md
+++ b/README.md
@@ -55,7 +55,7 @@ The directory structure of `content/` does not matter as the files will be recur
### Add a new page
-Do you want to add a new page to the docs?
+Do you want to add a new page to the docs?
1. First, decide which section the page should live in (Streamlit Library, Streamlit Cloud, or Knowledge Base).
@@ -67,7 +67,7 @@ Now that you've decided where the file should live and have named the file, it's
**File format**:
-Every `.md` file has front matter at the very top that defines the page title which appears in the browser tab bar, and the URL slug which appears after the slash in `docs.streamlit.io/` and `localhost:3000/`.
+Every `.md` file has front matter at the very top that defines the page title which appears in the browser tab bar, and the URL slug which appears after the slash in `docs.streamlit.io/` and `localhost:3000/`.
E.g. For a page titled "Create a component" that should exist at `docs.streamlit.io/library/components/create`, the front matter at the top of `create-component.md` is:
@@ -96,7 +96,7 @@ This is a **note** that links to our [website](https://docs.streamlit.io/).
**Embed code:**
-Enclose code within \` \` to embed it inline. E.g.
+Enclose code within \` \` to embed it inline. E.g.
```markdown
Create a header with `st.header`.
@@ -104,13 +104,13 @@ Create a header with `st.header`.
Embed code blocks like so:
-```markdown
+````markdown
```python
import streamlit as st
st.text("Hello world")
```
-```
+````
We support syntax highlighting for Python, Bash, TOML, SQL, and JSX.
@@ -122,39 +122,37 @@ Use standard Markdown to link to other pages in the docs. E.g. Add an inline lin
Learn how to [Create an app](/library/get-started/create-an-app).
```
-
-
**Add images:**
Store images you want to display in `/public/images/`. There are two ways to display images.
1. To display a single image, use regular Markdown. Make sure to start the path of your images from `/images/` instead of `/public/images/`. E.g.:
- ```markdown
- 
- ```
+ ```markdown
+ 
+ ```
2. To display multiple images on the same line, add an `
+ This method did not exist in version{" "}
+ {current_version}
of Streamlit.
+
This method did not exist in version {current_version}
of Streamlit.
No description
` + if ("warning" in func_obj) { + footers.push({ title: "Warning", body: func_obj.warning }); + } - if (param.is_optional) { - row['title'] = `${param.name} (${param.type_name})
` - row['body'] = `${description}` - } else { - row['title'] = `${param.name} (${param.type_name})
` - row['body'] = `${description}` - } + for (const index in func_obj.args) { + const row = {}; + const param = func_obj.args[index]; + const description = param.description + ? param.description + : `No description
`; + + if (param.is_optional) { + row[ + "title" + ] = `${param.name} (${param.type_name})
`; + row["body"] = `${description}`; + } else { + row[ + "title" + ] = `${param.name} (${param.type_name})
`; + row["body"] = `${description}`; + } + + args.push(row); + } - args.push(row) + body = ( ++ {body.title} + | +|
+ {" "} + | ++ + | +
{body.title} | -|
- | - |
{head.title} | -|
---|---|
- |
+ {head.title} + | +|
---|---|
+ |
{props.text || "Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia."}
-{props.text || "Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia."}
-+ {props.text || + "Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia."} +
++ {props.text || + "Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia."} +
+{props.caption}
{props.caption}
+Was this page helpful?
+Select all that apply
+Thank you for your feedback!
+Was this page helpful?
-Select all that apply
-Thank you for your feedback!
-Our forums are full of helpful information and Streamlit experts.
-+ Our{" "} + + forums + {" "} + are full of helpful information and Streamlit experts. +
+{category}
+{category}
-{this.state.hotKey}
- } - let searchBar = ( -Search
- {hotKey} -{this.state.hotKey}
; } + let searchBar = ( +Search
+ {hotKey} +View the Streamlit source code and issue tracker.
-Follow @streamlit on Twitter to keep up with the latest news.
-Watch screencasts made by the Streamlit team and the community.
-Join thousands of other Streamlit enthusiasts in our Discord server.
-Follow @streamlit.io on Instagram for more updates and content.
-+ View the Streamlit source code and issue tracker. +
++ Follow @streamlit on Twitter to keep up with the latest news. +
++ Watch screencasts made by the Streamlit team and the community. +
++ Join thousands of other Streamlit enthusiasts in our Discord + server. +
++ Follow @streamlit.io on Instagram for more updates and content. +
++ Try using the search bar, above, or check out one of the pages + below: +
-Try using the search bar, above, or check out one of the pages below:
- -
,
- h1: H1,
- h2: H2,
- h3: H3,
- // iframe : WrappedIFrame
- }
+import Autofunction from "../components/blocks/autofunction";
+import Code from "../components/blocks/code";
+import CodeTile from "../components/blocks/codeTile";
+import Download from "../components/utilities/download";
+import Flex from "../components/layouts/flex";
+import Image from "../components/blocks/image";
+import Important from "../components/blocks/important";
+import Note from "../components/blocks/noted";
+import RefCard from "../components/blocks/refCard";
+import Tile from "../components/blocks/tile";
+import InlineCallout from "../components/blocks/inlineCallout";
+import Tip from "../components/blocks/tip";
+import Warning from "../components/blocks/warning";
+import YouTube from "../components/blocks/youTube";
+
+export default function Article({
+ data,
+ source,
+ streamlit,
+ slug,
+ menu,
+ previous,
+ next,
+ version,
+ versions,
+ paths,
+ gdpr_data,
+ filename,
+}) {
+ let versionWarning;
+ let currentLink;
+ let sourceFile;
+ sourceFile =
+ "https://github.com/streamlit/docs/tree/main" +
+ filename.substring(filename.indexOf("/content/"));
+ const maxVersion = versions[versions.length - 1];
+
+ const components = {
+ Note,
+ Tip,
+ Important,
+ Code,
+ Warning,
+ YouTube,
+ Row,
+ Masonry,
+ CodeTile,
+ InlineCalloutContainer,
+ InlineCallout,
+ TileContainer,
+ Tile,
+ RefCard,
+ Image,
+ Download,
+ Flex,
+ Autofunction: (props) => (
+
,
+ h1: H1,
+ h2: H2,
+ h3: H3,
+ // iframe : WrappedIFrame
+ };
+
+ let previousArrow;
+ let nextArrow;
+ let arrowContainer;
+ let keywordsTag;
+
+ if (version && version != maxVersion) {
+ // Slugs don't have the version number, so we just have to join them.
+ currentLink = `/${slug.join("/")}`;
+ versionWarning = (
+ + You are reading the documentation for Streamlit version {version}, but{" "} + {maxVersion} is the latest version + available. +
+You are reading the documentation for Streamlit version {version}, but {maxVersion} is the latest version available.
-Streamlit is an open-source Python library that makes it easy to create and share beautiful, custom web apps for machine learning and data science. In just a few minutes you can build and deploy powerful data apps. So let’s get started!
++ Streamlit is an open-source + Python library that makes it easy to create and share beautiful, + custom web apps for machine learning and data science. In just a + few minutes you can build and deploy powerful data apps. So let’s + get started! +
The easiest way to learn how to use Streamlit is to try things out yourself. As you read through this guide, test each method.
-Streamlit is more than just a way to make data apps, it’s also a community of creators that share their apps and ideas and help each other make their work better.
-For this guide we’re using small amounts of data so that we can move quickly. You can check out our Tutorial on creating a data explorer to see an example of how to load data from an API and use @st.cache to cache it.
-Check out our community forum and post a question
-
+
+
+ Get started
+
+
+ Create your first Streamlit app
+
+
+ Article H3
+
+
+ Article H4
+
+
+ Article H5
+
+
+ Article H6
+
+
+
+ The easiest way to learn how to use Streamlit is to try things out
+ yourself. As you read through this guide, test each method.{" "}
+
+
+
+
+ Streamlit is more than just a way to make data apps, it’s also a
+ community of creators that share their apps and ideas and help each
+ other make their work better.
+
+
+
+
+ For this guide we’re using small amounts of data so that we can move
+ quickly. You can check out our Tutorial on creating a data explorer
+ to see an example of how to load data from an API and use @st.cache
+ to cache it.
+
+
+
+
+ Check out our{" "}
+
+ community forum
+ {" "}
+ and post a question
+
+
+
+
+ -
+ Create a new Python file named{" "}
+ first_app.py, then open it
+ with your IDE or text editor.
+
+ - Next, import Streamlit.
+
+
+
+
+ -
+ The first step is to create a new Python script. Let’s call it{" "}
+ uber_pickups.py.
+
+ -
+ Open uber_pickups.py in your
+ favorite IDE or text editor, then add these lines:
+
+
+
+
+
+ -
+ Check out our{" "}
+
+ community forum
+ {" "}
+ and post a question
+
+ -
+ Quick help from command line with{" "}
+ $ streamlit --help
+
+ -
+ Read more documentation! Check out:
+
+ -
+
+ Streamlit Cookbook
+ {" "}
+ for things like caching and inserting elements out of order
+
+ -
+
+ API reference
+ {" "}
+ for examples of every Streamlit command
+
+
+
+
+
+
+
-
-
-
- streamlit.text
-
-
- Article H2
-
-
-
-
-
-
-
-
-
-
- For this guide we’re using small amounts of data so that we can move quickly. You can check out our Tutorial on creating a data explorer to see an example of how to load data from an API and use @st.cache to cache it.
-
-
-
-
-
- Did you know you can also pass a URL to streamlit run? This is great when combined with Github Gists. For example:
-
-
-
-
-
-
- If the email you originally signed-up with isn’t the primary email associated with your GitHub account, just reply to your invite email telling us your primary Github email so we can grant access to the correct account.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Comming back to work on this.
-
-
- Comming back to work on this.
-
-
- Comming back to work on this.
-
-
- streamlit.text(body)`
- }}
- body={{ title: 'Parameters' }}
- rows={[
- {
- title: `body (str)
`,
- body: `The string to display
`
- },
- {
- title: `body (str)
`,
- body: `The string to display
`
- }
- ]}
- />
- streamlit.markdown(body, unsafe_allow_html=False)`
- }}
- body={{
- title: 'Parameters'
- }}
- rows={[
- {
- title: `body (str)
`,
- body: `The string to display
`
- },
- {
- title: `body (str)
`,
- body: `The string to display as Github-flavored Markdown. Syntax information can be found at: https://github.github.com/gfm.
This also supports:
- Emoji shortcodes, such as :+1: and :sunglasses:. For a list of all supported codes, see https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
- Second level of bullets example
- Third level of bullets example
- LaTeX expressions, by wrapping them in “$” or “$$” (the “$$” must be on their own lines). Supported LaTeX functions are listed at https://katex.org/docs/supported.html.
`
- }
- ]}
- />
-
-
-
+
+
+
+ streamlit.text
+
+
+
+ Article H2
+
+
+
+
+
+
+
+
+
+
+
+
+ For this guide we’re using small amounts of data so that we can
+ move quickly. You can check out our{" "}
+
+ Tutorial
+ {" "}
+ on creating a data explorer to see an example of how to load data
+ from an API and use{" "}
+
+ @st.cache
+ {" "}
+ to cache it.
+
+
+
+
+
+
+
+ Did you know you can also pass a URL to streamlit run? This is
+ great when combined with Github Gists. For example:
+
+
+
+
+
+
+
+
+ If the email you originally signed-up with isn’t the primary email
+ associated with your GitHub account, just reply to your invite
+ email telling us your primary Github email so we can grant access
+ to the correct account.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Comming back to work on this.
+
+
+ Comming back to work on this.
+
+
+ Comming back to work on this.
+
+
+ streamlit.text(body)`,
+ }}
+ body={{ title: "Parameters" }}
+ rows={[
+ {
+ title: `body (str)
`,
+ body: `The string to display
`,
+ },
+ {
+ title: `body (str)
`,
+ body: `The string to display
`,
+ },
+ ]}
+ />
+ streamlit.markdown(body, unsafe_allow_html=False)`,
+ }}
+ body={{
+ title: "Parameters",
+ }}
+ rows={[
+ {
+ title: `body (str)
`,
+ body: `The string to display
`,
+ },
+ {
+ title: `body (str)
`,
+ body: `The string to display as Github-flavored Markdown. Syntax information can be found at: https://github.github.com/gfm.
This also supports:
- Emoji shortcodes, such as :+1: and :sunglasses:. For a list of all supported codes, see https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
- Second level of bullets example
- Third level of bullets example
- LaTeX expressions, by wrapping them in “$” or “$$” (the “$$” must be on their own lines). Supported LaTeX functions are listed at https://katex.org/docs/supported.html.
`,
+ },
+ ]}
+ />
+
+
+
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- include our Get Started guide and a few step-by-step examples to building different types of apps in Streamlit.
- include our Get Started guide and a few step-by-step examples to building different types of apps in Streamlit.
-
-
-
-
-
-
-
- )
+st.altair_chart(chart_data)`}
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ include our{" "}
+
+ Get Started
+ {" "}
+ guide and a few step-by-step examples to building different types
+ of apps in Streamlit.
+
+
+ include our{" "}
+
+ Get Started
+ {" "}
+ guide and a few step-by-step examples to building different types
+ of apps in Streamlit.
+
+
+
+
+
+
+
+
+ );
}
diff --git a/public/admin/config.yml b/public/admin/config.yml
index 6afab1623..a39f56280 100644
--- a/public/admin/config.yml
+++ b/public/admin/config.yml
@@ -4,92 +4,180 @@ backend:
media_folder: public/img
public_folder: /img
collections:
-- name: "pages"
- label: "Site"
- files:
- - label: "Home"
- name: "home"
- file: "content/index.md"
- fields:
- - label: Title
- name: title
- widget: string
- - label: Body
- name: body
- widget: markdown
- minimal: true
- - label: Features
- name: features
- widget: list
- summary: '{{fields.title}}'
- fields:
- - { label: Title, name: title, widget: string }
- - { label: Body, name: body, widget: string }
- - { label: URL, name: url, widget: string, hint: "Should be a full url (https://www.example/)" }
- - { label: Color, name: color, widget: select, options: ['violet-70', 'orange-70', 'blue-70', 'red-70', 'yellow-70', 'green-70', 'b-g-70', 'l-blue-70', 'gray-70'] }
- - { label: Image, name: image, widget: image, hint: "Takes precedent over an icon, if set.", required: false }
- - { label: Icon, name: icon, widget: string, hint: "Must be the name (like_this) of a Material Icon. Should be an SVG.", required: false }
- - label: "What's New"
- name: whats_new
- widget: list
- summary: '{{fields.title}}'
- fields:
- - { label: Title, name: title, widget: string }
- - { label: Body, name: body, widget: string }
- - { label: URL, name: url, widget: string, hint: "Should be a full url (https://www.example/)" }
- - { label: Icon, name: icon, widget: string, hint: "Must be the name (like_this) of a Material Icon.", required: false }
- - { label: Image, name: image, widget: image, hint: "Takes precedent over an icon, if set. Should be an SVG.", required: false }
- - label: News
- name: news
- widget: list
- summary: '{{fields.publish_date}} - {{fields.title}}'
- fields:
- - { label: 'Date', name: publish_date, widget: string }
- - { label: Title, name: title, widget: string }
- - { label: Body, name: body, widget: text }
- - { label: URL, name: url, widget: string, hint: "Should be a full url (https://www.example/)" }
- - label: Next Page
- name: next
- widget: relation
- collection: "contents"
- value_field: "{{slug}}"
- search_fields: ["title","category"]
- display_fields: ["{{category}} / {{title}}"]
- - name: "menu"
- label: "Menu"
+ - name: "pages"
+ label: "Site"
+ files:
+ - label: "Home"
+ name: "home"
+ file: "content/index.md"
+ fields:
+ - label: Title
+ name: title
+ widget: string
+ - label: Body
+ name: body
+ widget: markdown
+ minimal: true
+ - label: Features
+ name: features
+ widget: list
+ summary: "{{fields.title}}"
+ fields:
+ - { label: Title, name: title, widget: string }
+ - { label: Body, name: body, widget: string }
+ - {
+ label: URL,
+ name: url,
+ widget: string,
+ hint: "Should be a full url (https://www.example/)",
+ }
+ - {
+ label: Color,
+ name: color,
+ widget: select,
+ options:
+ [
+ "violet-70",
+ "orange-70",
+ "blue-70",
+ "red-70",
+ "yellow-70",
+ "green-70",
+ "b-g-70",
+ "l-blue-70",
+ "gray-70",
+ ],
+ }
+ - {
+ label: Image,
+ name: image,
+ widget: image,
+ hint: "Takes precedent over an icon, if set.",
+ required: false,
+ }
+ - {
+ label: Icon,
+ name: icon,
+ widget: string,
+ hint: "Must be the name (like_this) of a Material Icon. Should be an SVG.",
+ required: false,
+ }
+ - label: "What's New"
+ name: whats_new
+ widget: list
+ summary: "{{fields.title}}"
+ fields:
+ - { label: Title, name: title, widget: string }
+ - { label: Body, name: body, widget: string }
+ - {
+ label: URL,
+ name: url,
+ widget: string,
+ hint: "Should be a full url (https://www.example/)",
+ }
+ - {
+ label: Icon,
+ name: icon,
+ widget: string,
+ hint: "Must be the name (like_this) of a Material Icon.",
+ required: false,
+ }
+ - {
+ label: Image,
+ name: image,
+ widget: image,
+ hint: "Takes precedent over an icon, if set. Should be an SVG.",
+ required: false,
+ }
+ - label: News
+ name: news
+ widget: list
+ summary: "{{fields.publish_date}} - {{fields.title}}"
+ fields:
+ - { label: "Date", name: publish_date, widget: string }
+ - { label: Title, name: title, widget: string }
+ - { label: Body, name: body, widget: text }
+ - {
+ label: URL,
+ name: url,
+ widget: string,
+ hint: "Should be a full url (https://www.example/)",
+ }
+ - label: Next Page
+ name: next
+ widget: relation
+ collection: "contents"
+ value_field: "{{slug}}"
+ search_fields: ["title", "category"]
+ display_fields: ["{{category}} / {{title}}"]
+ - name: "menu"
+ label: "Menu"
+ create: true
+ file: "content/menu.md"
+ fields:
+ - label: Site Menu
+ name: site_menu
+ widget: list
+ summary: "{{fields.category}}"
+ fields:
+ - {
+ label: Node,
+ name: category,
+ widget: string,
+ hint: "Use Parent / Child / Child format, with the last element acting as the item title.",
+ }
+ - {
+ label: URL,
+ name: url,
+ widget: string,
+ hint: "Should be either a full url (https://www.example/) or an absolute URL (/like/this)",
+ }
+ - {
+ label: Color,
+ name: color,
+ widget: select,
+ options:
+ [
+ "violet-70",
+ "orange-70",
+ "blue-70",
+ "red-70",
+ "yellow-70",
+ "green-70",
+ "b-g-70",
+ "l-blue-70",
+ "gray-70",
+ ],
+ required: false,
+ }
+ - {
+ label: Icon,
+ name: icon,
+ widget: string,
+ hint: "Must be the name (like_this) of a Material Icon.",
+ required: false,
+ }
+ - name: "contents"
+ label: "Documentation"
+ folder: "content"
create: true
- file: "content/menu.md"
- fields:
- - label: Site Menu
- name: site_menu
- widget: list
- summary: '{{fields.category}}'
- fields:
- - { label: Node, name: category, widget: string, hint: "Use Parent / Child / Child format, with the last element acting as the item title." }
- - { label: URL, name: url, widget: string, hint: "Should be either a full url (https://www.example/) or an absolute URL (/like/this)" }
- - { label: Color, name: color, widget: select, options: ['violet-70', 'orange-70', 'blue-70', 'red-70', 'yellow-70', 'green-70', 'b-g-70', 'l-blue-70', 'gray-70'], required: false }
- - { label: Icon, name: icon, widget: string, hint: "Must be the name (like_this) of a Material Icon.", required: false }
-- name: "contents"
- label: "Documentation"
- folder: "content"
- create: true
- slug: "{{slug}}"
- fields:
- - label: Title
- name: title
- widget: string
- - label: Page Catgeory
- name: category
- widget: string
- hint: "Categories should be seperated by back slashes (Parent / Child / Child)"
- - label: Body
- name: body
- widget: markdown
- modes: ['raw']
- - label: Next Page
- name: next
- widget: relation
- collection: "contents"
- value_field: "{{slug}}"
- search_fields: ["title","category"]
- display_fields: ["{{category}} / {{title}}"]
\ No newline at end of file
+ slug: "{{slug}}"
+ fields:
+ - label: Title
+ name: title
+ widget: string
+ - label: Page Catgeory
+ name: category
+ widget: string
+ hint: "Categories should be seperated by back slashes (Parent / Child / Child)"
+ - label: Body
+ name: body
+ widget: markdown
+ modes: ["raw"]
+ - label: Next Page
+ name: next
+ widget: relation
+ collection: "contents"
+ value_field: "{{slug}}"
+ search_fields: ["title", "category"]
+ display_fields: ["{{category}} / {{title}}"]
diff --git a/public/admin/index.html b/public/admin/index.html
index 26462aad1..302c13714 100644
--- a/public/admin/index.html
+++ b/public/admin/index.html
@@ -1,13 +1,13 @@
-
+
-
-
-
- Content Manager
-
-
-
-
-
-
-
\ No newline at end of file
+
+
+
+ Content Manager
+
+
+
+
+
+
+
diff --git a/public/sw.js b/public/sw.js
index 2d4d4602a..7365bb07e 100644
--- a/public/sw.js
+++ b/public/sw.js
@@ -2,16 +2,17 @@
// https://github.com/NekR/self-destroying-sw
-self.addEventListener('install', function (e) {
- self.skipWaiting()
-})
+self.addEventListener("install", function (e) {
+ self.skipWaiting();
+});
-self.addEventListener('activate', function (e) {
- self.registration.unregister()
+self.addEventListener("activate", function (e) {
+ self.registration
+ .unregister()
.then(function () {
- return self.clients.matchAll()
+ return self.clients.matchAll();
})
.then(function (clients) {
- clients.forEach(client => client.navigate(client.url))
- })
-})
+ clients.forEach((client) => client.navigate(client.url));
+ });
+});
diff --git a/python/.vscode/launch.json b/python/.vscode/launch.json
index 2b2502c69..9e37e6151 100644
--- a/python/.vscode/launch.json
+++ b/python/.vscode/launch.json
@@ -1,16 +1,16 @@
{
- // Use IntelliSense to learn about possible attributes.
- // Hover to view descriptions of existing attributes.
- // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
- "version": "0.2.0",
- "configurations": [
- {
- "name": "Python: Current File",
- "type": "python",
- "request": "launch",
- "program": "${file}",
- "console": "integratedTerminal",
- "justMyCode": false
- }
- ]
-}
\ No newline at end of file
+ // Use IntelliSense to learn about possible attributes.
+ // Hover to view descriptions of existing attributes.
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": "Python: Current File",
+ "type": "python",
+ "request": "launch",
+ "program": "${file}",
+ "console": "integratedTerminal",
+ "justMyCode": false
+ }
+ ]
+}
diff --git a/python/compose.yml b/python/compose.yml
index d877478bb..fe87f31f2 100644
--- a/python/compose.yml
+++ b/python/compose.yml
@@ -1,5 +1,5 @@
# Docker Compose version
-version: '3.3'
+version: "3.3"
services:
python:
build:
@@ -8,4 +8,4 @@ services:
image: streamlit-docstring-generator:latest
command: python build.py
volumes:
- - ../python:/docs
\ No newline at end of file
+ - ../python:/docs
diff --git a/python/streamlit.json b/python/streamlit.json
index db820bd13..45eb4f7e7 100644
--- a/python/streamlit.json
+++ b/python/streamlit.json
@@ -1 +1,43950 @@
-{"0.81.0": {"streamlit.altair_chart": {"name": "altair_chart", "signature": "st.altair_chart(altair_chart, use_container_width=False)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.
\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}]}, "streamlit.area_chart": {"name": "area_chart", "signature": "st.area_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display an area chart.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict", "is_optional": false, "description": "Data to be plotted.
\n", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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 width 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.
\n", "default": null}]}, "streamlit.audio": {"name": "audio", "signature": "st.audio(data, format=\"audio/wav\", start_time=0)", "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n", "default": "s"}]}, "streamlit.balloons": {"name": "balloons", "signature": "st.balloons()", "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n", "description": "Draw celebratory balloons.", "args": []}, "streamlit.bar_chart": {"name": "bar_chart", "signature": "st.bar_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a bar chart.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict", "is_optional": false, "description": "Data to be plotted.
\n", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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 width 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.
\n", "default": null}]}, "streamlit.beta_columns": {"name": "beta_columns", "signature": "st.beta_columns(spec)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.beta_columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.beta_columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor example, st.beta_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}]}, "streamlit.beta_container": {"name": "beta_container", "signature": "st.beta_container()", "examples": "\nInserting elements using "with" notation:
\n\n>>> with st.beta_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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.beta_container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "streamlit.beta_expander": {"name": "beta_expander", "signature": "st.beta_expander(label=None, expanded=False)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with st.beta_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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "streamlit.bokeh_chart": {"name": "bokeh_chart", "signature": "st.bokeh_chart(figure, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.", "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}, {"name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Bokeh's `show`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "streamlit.button": {"name": "button", "signature": "st.button(label, key=None, help=None)", "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 when the button is hovered over.
\n", "default": null}]}, "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\n... def fetch_and_clean_data(url):\n... # Fetch data from URL here, and then clean it up.\n... return data\n...\n>>> d1 = fetch_and_clean_data(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> d2 = 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>>>\n>>> d3 = fetch_and_clean_data(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nTo 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
\nTo 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
\nTo 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
\nAlternatively, 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", "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 normally shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.
\nIf 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 functions 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."}]}, "streamlit.caption": {"name": "caption", "signature": "st.caption(body)", "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in small font.", "args": [{"name": "body", "type_name": "str", "is_optional": false, "description": "The text to display.
\n", "default": null}]}, "streamlit.checkbox": {"name": "checkbox", "signature": "st.checkbox(label, value=False, key=None, help=None)", "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 checkbox.
\n", "default": null}]}, "streamlit.code": {"name": "code", "signature": "st.code(body, language=\"python\")", "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a code block with optional syntax highlighting.", "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", "default": null}]}, "streamlit.color_picker": {"name": "color_picker", "signature": "st.color_picker(label, value=None, key=None, help=None)", "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\n", "default": null}, {"name": "value", "type_name": "str or None", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 color picker.
\n", "default": null}]}, "streamlit.dataframe": {"name": "dataframe", "signature": "st.dataframe(data=None, width=None, height=None)", "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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, numpy.ndarray, Iterable, dict,", "is_optional": false, "description": "or None\nThe data to display.
\nIf '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!
\n", "default": null}, {"name": "width", "type_name": "int or None", "is_optional": false, "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 UI element expressed in pixels. If None, a\ndefault height is used.
\n", "default": "height"}]}, "streamlit.date_input": {"name": "date_input", "signature": "st.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None)", "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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. Defaults to today-10y.
\n", "default": "today-10y."}, {"name": "max_value", "type_name": "datetime.date or datetime.datetime", "is_optional": false, "description": "The maximum selectable date. Defaults to today+10y.
\n", "default": "today"}, {"name": "key", "type_name": "str", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n", "default": null}]}, "streamlit.echo": {"name": "echo", "signature": "st.echo(code_location=\"above\")", "example": "\n\n>>> with 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}]}, "streamlit.empty": {"name": "empty", "signature": "st.empty()", "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.beta_container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n", "description": "Insert a single-element container.", "args": []}, "streamlit.error": {"name": "error", "signature": "st.error(body)", "example": "\n\n>>> st.error('This is an error')\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}]}, "streamlit.exception": {"name": "exception", "signature": "st.exception(exception)", "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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}]}, "streamlit.experimental_get_query_params": {"name": "experimental_get_query_params", "signature": "st.experimental_get_query_params()", "example": "\nLet'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\n>>> st.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\nNote 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": []}, "streamlit.experimental_rerun": {"name": "experimental_rerun", "signature": "st.experimental_rerun()", "description": "Rerun the script immediately.", "args": []}, "streamlit.experimental_set_query_params": {"name": "experimental_set_query_params", "signature": "st.experimental_set_query_params(**query_params)", "example": "\nTo 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\n>>> st.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}]}, "streamlit.experimental_show": {"name": "experimental_show", "signature": "st.experimental_show(*args)", "notes": "\nThis 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- When passing multiple arguments the inclusion of , or ) in a string
\n
\n \nargument may cause an error.
\n
\n", "example": "\n\n>>> dataframe = pd.DataFrame({\n... 'first column': [1, 2, 3, 4],\n... 'second column': [10, 20, 30, 40],\n... }))\n>>> st.experimental_show(dataframe)\n
\n
\n", "description": "Write arguments and *argument names* to your app for debugging purposes.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to debug in the App.
\n", "default": null}]}, "streamlit.file_uploader": {"name": "file_uploader", "signature": "st.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None)", "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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", "description": "Display a file uploader widget.", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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}]}, "streamlit.form": {"name": "form", "signature": "st.form(key)", "description": "Create a form that batches elements together with a \"Submit\" button.", "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}]}, "streamlit.form_submit_button": {"name": "form_submit_button", "signature": "st.form_submit_button(label=\"Submit\")", "description": "Display a form submit button.", "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"}]}, "streamlit.get_option": {"name": "get_option", "signature": "st.get_option(key)", "description": "Return the current value of a given Streamlit config option.", "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}]}, "streamlit.graphviz_chart": {"name": "graphviz_chart", "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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}]}, "streamlit.header": {"name": "header", "signature": "st.header(body, anchor=None)", "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "streamlit.help": {"name": "help", "signature": "st.help(obj)", "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n", "description": "Display object's doc string, nicely formatted.", "args": [{"name": "obj", "type_name": "Object", "is_optional": false, "description": "The object whose docstring should be displayed.
\n", "default": null}]}, "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"}]}, "streamlit.info": {"name": "info", "signature": "st.info(body)", "example": "\n\n>>> st.info('This is a purely informational message')\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}]}, "streamlit.json": {"name": "json", "signature": "st.json(body)", "example": "\n\n>>> st.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}]}, "streamlit.latex": {"name": "latex", "signature": "st.latex(body)", "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display mathematical expressions formatted as LaTeX.", "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}]}, "streamlit.line_chart": {"name": "line_chart", "signature": "st.line_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a line chart.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict", "is_optional": false, "description": "or None\nData to be plotted.
\n", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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 width 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.
\n", "default": null}]}, "streamlit.map": {"name": "map", "signature": "st.map(data=None, zoom=None, use_container_width=True)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a map with points on it.", "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}]}, "streamlit.markdown": {"name": "markdown", "signature": "st.markdown(body, unsafe_allow_html=False)", "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n", "default": null}]}, "streamlit.multiselect": {"name": "multiselect", "signature": "st.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None)", "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n", "description": "Display a multiselect widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this select widget is for.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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": "[str] or None", "is_optional": false, "description": "List of default values.
\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 selectbox.
\n", "default": null}, {"name": "key", "type_name": "str", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 multiselect.
\n", "default": null}]}, "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)", "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n", "default": null}]}, "streamlit.object_beta_warning": {"name": "object_beta_warning", "signature": "st.object_beta_warning(obj, obj_name, date)", "description": "Wrapper for objects that are no longer in beta.", "args": [{"name": "obj", "type_name": "Any", "is_optional": false, "description": "The st. object that used to be in beta.
\n", "default": null}, {"name": "obj_name", "type_name": "str", "is_optional": false, "description": "The name of the object within __init__.py
\n", "default": null}, {"name": "date", "type_name": "str", "is_optional": false, "description": "A date like "2020-01-01", indicating the last day we'll guarantee\nsupport for the beta_ prefix.
\n \n", "default": null}]}, "streamlit.plotly_chart": {"name": "plotly_chart", "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)", "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.", "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
\nSee 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://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}, {"name": "To show Plotly charts in Streamlit, call `st.plotly_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Plotly's `py.plot` or `py.iplot`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "streamlit.progress": {"name": "progress", "signature": "st.progress(value)", "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n", "default": null}]}, "streamlit.pydeck_chart": {"name": "pydeck_chart", "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)", "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.", "args": [{"name": "spec", "type_name": "pydeck.Deck or None", "is_optional": false, "description": "Object specifying the PyDeck chart to draw.
\n", "default": null}]}, "streamlit.pyplot": {"name": "pyplot", "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)", "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n", "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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}]}, "streamlit.radio": {"name": "radio", "signature": "st.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None)", "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 radio.
\n", "default": null}]}, "streamlit.select_slider": {"name": "select_slider", "signature": "st.select_slider(label, options=[], value=None, format_func=special_internal_function, key=None, help=None)", "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n", "description": "Display a slider widget to select items from a list.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this slider is for.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 select slider.
\n", "default": null}]}, "streamlit.selectbox": {"name": "selectbox", "signature": "st.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None)", "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 selectbox.
\n", "default": null}]}, "streamlit.set_option": {"name": "set_option", "signature": "st.set_option(key, value)", "description": "Set config option.", "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}]}, "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\")", "example": "\n>>> st.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... )\n
\n", "description": "Configures the default settings of the page.", "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"}]}, "streamlit.slider": {"name": "slider", "signature": "st.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None)", "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n", "description": "Display a slider widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this slider is for.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 slider.
\n", "default": null}]}, "streamlit.spinner": {"name": "spinner", "signature": "st.spinner(text=\"In progress...\")", "example": "\n\n>>> with st.spinner('Wait for it...'):\n>>> time.sleep(5)\n>>> st.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}]}, "streamlit.stop": {"name": "stop", "signature": "st.stop()", "example": "\n\n>>> name = st.text_input('Name')\n>>> if not name:\n>>> st.warning('Please input a name.')\n>>> st.stop()\n>>> st.success('Thank you for inputting a name.')\n
\n
\n", "description": "Stops execution immediately.", "args": []}, "streamlit.subheader": {"name": "subheader", "signature": "st.subheader(body, anchor=None)", "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "streamlit.success": {"name": "success", "signature": "st.success(body)", "example": "\n\n>>> st.success('This is a success message!')\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}]}, "streamlit.table": {"name": "table", "signature": "st.table(data=None)", "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a static table.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,", "is_optional": false, "description": "or None\nThe table data.
\n", "default": null}]}, "streamlit.text": {"name": "text", "signature": "st.text(body)", "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "streamlit.text_area": {"name": "text_area", "signature": "st.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None)", "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n", "default": null}, {"name": "value", "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}, {"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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 textarea.
\n", "default": null}]}, "streamlit.text_input": {"name": "text_input", "signature": "st.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None)", "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n", "default": null}, {"name": "value", "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}, {"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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be 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": "A tooltip that gets displayed next to the input.
\n", "default": null}]}, "streamlit.time_input": {"name": "time_input", "signature": "st.time_input(label, value=None, key=None, help=None)", "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n", "default": null}]}, "streamlit.title": {"name": "title", "signature": "st.title(body, anchor=None)", "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in title 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}]}, "streamlit.vega_lite_chart": {"name": "vega_lite_chart", "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, **kwargs)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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, numpy.ndarray, Iterable, dict,", "is_optional": false, "description": "or None\nEither the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).
\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}]}, "streamlit.video": {"name": "video", "signature": "st.video(data, format=\"video/mp4\", start_time=0)", "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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}]}, "streamlit.warning": {"name": "warning", "signature": "st.warning(body)", "example": "\n\n>>> st.warning('This is a warning')\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}]}, "streamlit.write": {"name": "write", "signature": "st.write(*args, **kwargs)", "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Write arguments to the app.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n", "default": "False."}]}, "DeltaGenerator.add_rows": {"name": "add_rows", "signature": "element.add_rows(self, data=None, **kwargs)", "example": "\n\n>>> df1 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_table = st.table(df1)\n>>>\n>>> df2 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_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
\nYou 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...\n>>> my_chart = st.line_chart(df1)\n>>> my_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
\nAnd for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:
\n\n>>> my_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... }),\n>>> my_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, numpy.ndarray, Iterable, dict,", "is_optional": false, "description": "", "default": null}, {"name": "or None", "type_name": null, "is_optional": null, "description": "Table to concat. Optional.
\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}]}, "DeltaGenerator.altair_chart": {"name": "altair_chart", "signature": "element.altair_chart(self, altair_chart, use_container_width=False)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.
\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}]}, "DeltaGenerator.area_chart": {"name": "area_chart", "signature": "element.area_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display an area chart.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict", "is_optional": false, "description": "Data to be plotted.
\n", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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 width 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.
\n", "default": null}]}, "DeltaGenerator.audio": {"name": "audio", "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0)", "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n", "default": "s"}]}, "DeltaGenerator.balloons": {"name": "balloons", "signature": "element.balloons(self)", "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n", "description": "Draw celebratory balloons.", "args": []}, "DeltaGenerator.bar_chart": {"name": "bar_chart", "signature": "element.bar_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a bar chart.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict", "is_optional": false, "description": "Data to be plotted.
\n", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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 width 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.
\n", "default": null}]}, "DeltaGenerator.beta_columns": {"name": "beta_columns", "signature": "element.beta_columns(self, spec)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.beta_columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.beta_columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor example, st.beta_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}]}, "DeltaGenerator.beta_container": {"name": "beta_container", "signature": "element.beta_container(self)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with st.beta_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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.beta_container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "DeltaGenerator.beta_expander": {"name": "beta_expander", "signature": "element.beta_expander(self, label=None, expanded=False)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with st.beta_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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "DeltaGenerator.bokeh_chart": {"name": "bokeh_chart", "signature": "element.bokeh_chart(self, figure, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.", "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}, {"name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Bokeh's `show`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "DeltaGenerator.button": {"name": "button", "signature": "element.button(self, label, key=None, help=None)", "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 when the button is hovered over.
\n", "default": null}]}, "DeltaGenerator.caption": {"name": "caption", "signature": "element.caption(self, body)", "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in small font.", "args": [{"name": "body", "type_name": "str", "is_optional": false, "description": "The text to display.
\n", "default": null}]}, "DeltaGenerator.checkbox": {"name": "checkbox", "signature": "element.checkbox(self, label, value=False, key=None, help=None)", "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 checkbox.
\n", "default": null}]}, "DeltaGenerator.code": {"name": "code", "signature": "element.code(self, body, language=\"python\")", "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a code block with optional syntax highlighting.", "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", "default": null}]}, "DeltaGenerator.color_picker": {"name": "color_picker", "signature": "element.color_picker(self, label, value=None, key=None, help=None)", "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\n", "default": null}, {"name": "value", "type_name": "str or None", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 color picker.
\n", "default": null}]}, "DeltaGenerator.dataframe": {"name": "dataframe", "signature": "element.dataframe(self, data=None, width=None, height=None)", "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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, numpy.ndarray, Iterable, dict,", "is_optional": false, "description": "or None\nThe data to display.
\nIf '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!
\n", "default": null}, {"name": "width", "type_name": "int or None", "is_optional": false, "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 UI element expressed in pixels. If None, a\ndefault height is used.
\n", "default": "height"}]}, "DeltaGenerator.date_input": {"name": "date_input", "signature": "element.date_input(self, label, value=None, min_value=None, max_value=None, key=None, help=None)", "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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. Defaults to today-10y.
\n", "default": "today-10y."}, {"name": "max_value", "type_name": "datetime.date or datetime.datetime", "is_optional": false, "description": "The maximum selectable date. Defaults to today+10y.
\n", "default": "today"}, {"name": "key", "type_name": "str", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n", "default": null}]}, "DeltaGenerator.empty": {"name": "empty", "signature": "element.empty(self)", "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.beta_container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n", "description": "Insert a single-element container.", "args": []}, "DeltaGenerator.error": {"name": "error", "signature": "element.error(self, body)", "example": "\n\n>>> st.error('This is an error')\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}]}, "DeltaGenerator.exception": {"name": "exception", "signature": "element.exception(self, exception)", "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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}]}, "DeltaGenerator.file_uploader": {"name": "file_uploader", "signature": "element.file_uploader(self, label, type=None, accept_multiple_files=False, key=None, help=None)", "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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", "description": "Display a file uploader widget.", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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}]}, "DeltaGenerator.form": {"name": "form", "signature": "element.form(self, key)", "description": "Create a form that batches elements together with a \"Submit\" button.", "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}]}, "DeltaGenerator.form_submit_button": {"name": "form_submit_button", "signature": "element.form_submit_button(self, label=\"Submit\")", "description": "Display a form submit button.", "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"}]}, "DeltaGenerator.graphviz_chart": {"name": "graphviz_chart", "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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}]}, "DeltaGenerator.header": {"name": "header", "signature": "element.header(self, body, anchor=None)", "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "DeltaGenerator.help": {"name": "help", "signature": "element.help(self, obj)", "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n", "description": "Display object's doc string, nicely formatted.", "args": [{"name": "obj", "type_name": "Object", "is_optional": false, "description": "The object whose docstring should be displayed.
\n", "default": null}]}, "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"}]}, "DeltaGenerator.info": {"name": "info", "signature": "element.info(self, body)", "example": "\n\n>>> st.info('This is a purely informational message')\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}]}, "DeltaGenerator.json": {"name": "json", "signature": "element.json(self, body)", "example": "\n\n>>> st.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}]}, "DeltaGenerator.latex": {"name": "latex", "signature": "element.latex(self, body)", "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display mathematical expressions formatted as LaTeX.", "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}]}, "DeltaGenerator.line_chart": {"name": "line_chart", "signature": "element.line_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a line chart.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict", "is_optional": false, "description": "or None\nData to be plotted.
\n", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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 width 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.
\n", "default": null}]}, "DeltaGenerator.map": {"name": "map", "signature": "element.map(self, data=None, zoom=None, use_container_width=True)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a map with points on it.", "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}]}, "DeltaGenerator.markdown": {"name": "markdown", "signature": "element.markdown(self, body, unsafe_allow_html=False)", "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n", "default": null}]}, "DeltaGenerator.multiselect": {"name": "multiselect", "signature": "element.multiselect(self, label, options, default=None, format_func=special_internal_function, key=None, help=None)", "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n", "description": "Display a multiselect widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this select widget is for.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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": "[str] or None", "is_optional": false, "description": "List of default values.
\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 selectbox.
\n", "default": null}, {"name": "key", "type_name": "str", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 multiselect.
\n", "default": null}]}, "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)", "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n", "default": null}]}, "DeltaGenerator.plotly_chart": {"name": "plotly_chart", "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)", "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.", "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
\nSee 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://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}, {"name": "To show Plotly charts in Streamlit, call `st.plotly_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Plotly's `py.plot` or `py.iplot`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "DeltaGenerator.progress": {"name": "progress", "signature": "element.progress(self, value)", "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n", "default": null}]}, "DeltaGenerator.pydeck_chart": {"name": "pydeck_chart", "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)", "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.", "args": [{"name": "spec", "type_name": "pydeck.Deck or None", "is_optional": false, "description": "Object specifying the PyDeck chart to draw.
\n", "default": null}]}, "DeltaGenerator.pyplot": {"name": "pyplot", "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)", "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n", "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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}]}, "DeltaGenerator.radio": {"name": "radio", "signature": "element.radio(self, label, options, index=0, format_func=special_internal_function, key=None, help=None)", "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 radio.
\n", "default": null}]}, "DeltaGenerator.select_slider": {"name": "select_slider", "signature": "element.select_slider(self, label, options=[], value=None, format_func=special_internal_function, key=None, help=None)", "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n", "description": "Display a slider widget to select items from a list.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this slider is for.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 select slider.
\n", "default": null}]}, "DeltaGenerator.selectbox": {"name": "selectbox", "signature": "element.selectbox(self, label, options, index=0, format_func=special_internal_function, key=None, help=None)", "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 selectbox.
\n", "default": null}]}, "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)", "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n", "description": "Display a slider widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this slider is for.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 slider.
\n", "default": null}]}, "DeltaGenerator.subheader": {"name": "subheader", "signature": "element.subheader(self, body, anchor=None)", "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "DeltaGenerator.success": {"name": "success", "signature": "element.success(self, body)", "example": "\n\n>>> st.success('This is a success message!')\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}]}, "DeltaGenerator.table": {"name": "table", "signature": "element.table(self, data=None)", "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a static table.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,", "is_optional": false, "description": "or None\nThe table data.
\n", "default": null}]}, "DeltaGenerator.text": {"name": "text", "signature": "element.text(self, body)", "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "DeltaGenerator.text_area": {"name": "text_area", "signature": "element.text_area(self, label, value=\"\", height=None, max_chars=None, key=None, help=None)", "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n", "default": null}, {"name": "value", "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}, {"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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 textarea.
\n", "default": null}]}, "DeltaGenerator.text_input": {"name": "text_input", "signature": "element.text_input(self, label, value=\"\", max_chars=None, key=None, type=\"default\", help=None)", "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n", "default": null}, {"name": "value", "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}, {"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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be 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": "A tooltip that gets displayed next to the input.
\n", "default": null}]}, "DeltaGenerator.time_input": {"name": "time_input", "signature": "element.time_input(self, label, value=None, key=None, help=None)", "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n", "default": null}]}, "DeltaGenerator.title": {"name": "title", "signature": "element.title(self, body, anchor=None)", "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in title 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}]}, "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\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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, numpy.ndarray, Iterable, dict,", "is_optional": false, "description": "or None\nEither the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).
\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}]}, "DeltaGenerator.video": {"name": "video", "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)", "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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}]}, "DeltaGenerator.warning": {"name": "warning", "signature": "element.warning(self, body)", "example": "\n\n>>> st.warning('This is a warning')\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}]}, "DeltaGenerator.write": {"name": "write", "signature": "element.write(self, *args, **kwargs)", "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Write arguments to the app.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n", "default": "False."}]}}, "0.82.0": {"streamlit.altair_chart": {"name": "altair_chart", "signature": "st.altair_chart(altair_chart, use_container_width=False)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.
\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}]}, "streamlit.area_chart": {"name": "area_chart", "signature": "st.area_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display an area chart.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict", "is_optional": false, "description": "Data to be plotted.
\n", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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 width 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.
\n", "default": null}]}, "streamlit.audio": {"name": "audio", "signature": "st.audio(data, format=\"audio/wav\", start_time=0)", "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n", "default": "s"}]}, "streamlit.balloons": {"name": "balloons", "signature": "st.balloons()", "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n", "description": "Draw celebratory balloons.", "args": []}, "streamlit.bar_chart": {"name": "bar_chart", "signature": "st.bar_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a bar chart.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict", "is_optional": false, "description": "Data to be plotted.
\n", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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 width 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.
\n", "default": null}]}, "streamlit.beta_columns": {"name": "beta_columns", "signature": "st.beta_columns(spec)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.beta_columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.beta_columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor example, st.beta_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}]}, "streamlit.beta_container": {"name": "beta_container", "signature": "st.beta_container()", "examples": "\nInserting elements using "with" notation:
\n\n>>> with st.beta_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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.beta_container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "streamlit.beta_expander": {"name": "beta_expander", "signature": "st.beta_expander(label=None, expanded=False)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with st.beta_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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "streamlit.bokeh_chart": {"name": "bokeh_chart", "signature": "st.bokeh_chart(figure, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.", "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}, {"name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Bokeh's `show`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "streamlit.button": {"name": "button", "signature": "st.button(label, key=None, help=None)", "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 when the button is hovered over.
\n", "default": null}]}, "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\n... def fetch_and_clean_data(url):\n... # Fetch data from URL here, and then clean it up.\n... return data\n...\n>>> d1 = fetch_and_clean_data(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> d2 = 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>>>\n>>> d3 = fetch_and_clean_data(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nTo 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
\nTo 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
\nTo 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
\nAlternatively, 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", "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 normally shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.
\nIf 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 functions 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."}]}, "streamlit.caption": {"name": "caption", "signature": "st.caption(body)", "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in small font.", "args": [{"name": "body", "type_name": "str", "is_optional": false, "description": "The text to display.
\n", "default": null}]}, "streamlit.checkbox": {"name": "checkbox", "signature": "st.checkbox(label, value=False, key=None, help=None)", "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 checkbox.
\n", "default": null}]}, "streamlit.code": {"name": "code", "signature": "st.code(body, language=\"python\")", "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a code block with optional syntax highlighting.", "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", "default": null}]}, "streamlit.color_picker": {"name": "color_picker", "signature": "st.color_picker(label, value=None, key=None, help=None)", "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\n", "default": null}, {"name": "value", "type_name": "str or None", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 color picker.
\n", "default": null}]}, "streamlit.dataframe": {"name": "dataframe", "signature": "st.dataframe(data=None, width=None, height=None)", "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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, numpy.ndarray, Iterable, dict,", "is_optional": false, "description": "or None\nThe data to display.
\nIf '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!
\n", "default": null}, {"name": "width", "type_name": "int or None", "is_optional": false, "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 UI element expressed in pixels. If None, a\ndefault height is used.
\n", "default": "height"}]}, "streamlit.date_input": {"name": "date_input", "signature": "st.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None)", "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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. Defaults to today-10y.
\n", "default": "today-10y."}, {"name": "max_value", "type_name": "datetime.date or datetime.datetime", "is_optional": false, "description": "The maximum selectable date. Defaults to today+10y.
\n", "default": "today"}, {"name": "key", "type_name": "str", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n", "default": null}]}, "streamlit.echo": {"name": "echo", "signature": "st.echo(code_location=\"above\")", "example": "\n\n>>> with 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}]}, "streamlit.empty": {"name": "empty", "signature": "st.empty()", "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.beta_container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n", "description": "Insert a single-element container.", "args": []}, "streamlit.error": {"name": "error", "signature": "st.error(body)", "example": "\n\n>>> st.error('This is an error')\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}]}, "streamlit.exception": {"name": "exception", "signature": "st.exception(exception)", "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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}]}, "streamlit.experimental_get_query_params": {"name": "experimental_get_query_params", "signature": "st.experimental_get_query_params()", "example": "\nLet'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\n>>> st.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\nNote 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": []}, "streamlit.experimental_rerun": {"name": "experimental_rerun", "signature": "st.experimental_rerun()", "description": "Rerun the script immediately.", "args": []}, "streamlit.experimental_set_query_params": {"name": "experimental_set_query_params", "signature": "st.experimental_set_query_params(**query_params)", "example": "\nTo 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\n>>> st.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}]}, "streamlit.experimental_show": {"name": "experimental_show", "signature": "st.experimental_show(*args)", "notes": "\nThis 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- When passing multiple arguments the inclusion of , or ) in a string
\n
\n \nargument may cause an error.
\n
\n", "example": "\n\n>>> dataframe = pd.DataFrame({\n... 'first column': [1, 2, 3, 4],\n... 'second column': [10, 20, 30, 40],\n... }))\n>>> st.experimental_show(dataframe)\n
\n
\n", "description": "Write arguments and *argument names* to your app for debugging purposes.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to debug in the App.
\n", "default": null}]}, "streamlit.file_uploader": {"name": "file_uploader", "signature": "st.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None)", "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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", "description": "Display a file uploader widget.", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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}]}, "streamlit.form": {"name": "form", "signature": "st.form(key)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n", "description": "Create a form that batches elements together with a \"Submit\" button.", "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}]}, "streamlit.form_submit_button": {"name": "form_submit_button", "signature": "st.form_submit_button(label=\"Submit\")", "description": "Display a form submit button.", "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"}]}, "streamlit.get_option": {"name": "get_option", "signature": "st.get_option(key)", "description": "Return the current value of a given Streamlit config option.", "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}]}, "streamlit.graphviz_chart": {"name": "graphviz_chart", "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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}]}, "streamlit.header": {"name": "header", "signature": "st.header(body, anchor=None)", "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "streamlit.help": {"name": "help", "signature": "st.help(obj)", "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n", "description": "Display object's doc string, nicely formatted.", "args": [{"name": "obj", "type_name": "Object", "is_optional": false, "description": "The object whose docstring should be displayed.
\n", "default": null}]}, "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"}]}, "streamlit.info": {"name": "info", "signature": "st.info(body)", "example": "\n\n>>> st.info('This is a purely informational message')\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}]}, "streamlit.json": {"name": "json", "signature": "st.json(body)", "example": "\n\n>>> st.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}]}, "streamlit.latex": {"name": "latex", "signature": "st.latex(body)", "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display mathematical expressions formatted as LaTeX.", "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}]}, "streamlit.line_chart": {"name": "line_chart", "signature": "st.line_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a line chart.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict", "is_optional": false, "description": "or None\nData to be plotted.
\n", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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 width 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.
\n", "default": null}]}, "streamlit.map": {"name": "map", "signature": "st.map(data=None, zoom=None, use_container_width=True)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a map with points on it.", "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}]}, "streamlit.markdown": {"name": "markdown", "signature": "st.markdown(body, unsafe_allow_html=False)", "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n", "default": null}]}, "streamlit.multiselect": {"name": "multiselect", "signature": "st.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None)", "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n", "description": "Display a multiselect widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this select widget is for.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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": "[str] or None", "is_optional": false, "description": "List of default values.
\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 selectbox.
\n", "default": null}, {"name": "key", "type_name": "str", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 multiselect.
\n", "default": null}]}, "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)", "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n", "default": null}]}, "streamlit.object_beta_warning": {"name": "object_beta_warning", "signature": "st.object_beta_warning(obj, obj_name, date)", "description": "Wrapper for objects that are no longer in beta.", "args": [{"name": "obj", "type_name": "Any", "is_optional": false, "description": "The st. object that used to be in beta.
\n", "default": null}, {"name": "obj_name", "type_name": "str", "is_optional": false, "description": "The name of the object within __init__.py
\n", "default": null}, {"name": "date", "type_name": "str", "is_optional": false, "description": "A date like "2020-01-01", indicating the last day we'll guarantee\nsupport for the beta_ prefix.
\n \n", "default": null}]}, "streamlit.plotly_chart": {"name": "plotly_chart", "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)", "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.", "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
\nSee 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://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}, {"name": "To show Plotly charts in Streamlit, call `st.plotly_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Plotly's `py.plot` or `py.iplot`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "streamlit.progress": {"name": "progress", "signature": "st.progress(value)", "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n", "default": null}]}, "streamlit.pydeck_chart": {"name": "pydeck_chart", "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)", "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.", "args": [{"name": "spec", "type_name": "pydeck.Deck or None", "is_optional": false, "description": "Object specifying the PyDeck chart to draw.
\n", "default": null}]}, "streamlit.pyplot": {"name": "pyplot", "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)", "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n", "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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}]}, "streamlit.radio": {"name": "radio", "signature": "st.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None)", "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 radio.
\n", "default": null}]}, "streamlit.select_slider": {"name": "select_slider", "signature": "st.select_slider(label, options=[], value=None, format_func=special_internal_function, key=None, help=None)", "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n", "description": "Display a slider widget to select items from a list.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this slider is for.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 select slider.
\n", "default": null}]}, "streamlit.selectbox": {"name": "selectbox", "signature": "st.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None)", "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 selectbox.
\n", "default": null}]}, "streamlit.set_option": {"name": "set_option", "signature": "st.set_option(key, value)", "description": "Set config option.", "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}]}, "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\")", "example": "\n>>> st.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... )\n
\n", "description": "Configures the default settings of the page.", "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"}]}, "streamlit.slider": {"name": "slider", "signature": "st.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None)", "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n", "description": "Display a slider widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this slider is for.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 slider.
\n", "default": null}]}, "streamlit.spinner": {"name": "spinner", "signature": "st.spinner(text=\"In progress...\")", "example": "\n\n>>> with st.spinner('Wait for it...'):\n>>> time.sleep(5)\n>>> st.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}]}, "streamlit.stop": {"name": "stop", "signature": "st.stop()", "example": "\n\n>>> name = st.text_input('Name')\n>>> if not name:\n>>> st.warning('Please input a name.')\n>>> st.stop()\n>>> st.success('Thank you for inputting a name.')\n
\n
\n", "description": "Stops execution immediately.", "args": []}, "streamlit.subheader": {"name": "subheader", "signature": "st.subheader(body, anchor=None)", "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "streamlit.success": {"name": "success", "signature": "st.success(body)", "example": "\n\n>>> st.success('This is a success message!')\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}]}, "streamlit.table": {"name": "table", "signature": "st.table(data=None)", "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a static table.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,", "is_optional": false, "description": "or None\nThe table data.
\n", "default": null}]}, "streamlit.text": {"name": "text", "signature": "st.text(body)", "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "streamlit.text_area": {"name": "text_area", "signature": "st.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None)", "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n", "default": null}, {"name": "value", "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}, {"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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 textarea.
\n", "default": null}]}, "streamlit.text_input": {"name": "text_input", "signature": "st.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None)", "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n", "default": null}, {"name": "value", "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}, {"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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be 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": "A tooltip that gets displayed next to the input.
\n", "default": null}]}, "streamlit.time_input": {"name": "time_input", "signature": "st.time_input(label, value=None, key=None, help=None)", "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n", "default": null}]}, "streamlit.title": {"name": "title", "signature": "st.title(body, anchor=None)", "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in title 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}]}, "streamlit.vega_lite_chart": {"name": "vega_lite_chart", "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, **kwargs)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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, numpy.ndarray, Iterable, dict,", "is_optional": false, "description": "or None\nEither the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).
\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}]}, "streamlit.video": {"name": "video", "signature": "st.video(data, format=\"video/mp4\", start_time=0)", "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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}]}, "streamlit.warning": {"name": "warning", "signature": "st.warning(body)", "example": "\n\n>>> st.warning('This is a warning')\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}]}, "streamlit.write": {"name": "write", "signature": "st.write(*args, **kwargs)", "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Write arguments to the app.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n", "default": "False."}]}, "DeltaGenerator.add_rows": {"name": "add_rows", "signature": "element.add_rows(self, data=None, **kwargs)", "example": "\n\n>>> df1 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_table = st.table(df1)\n>>>\n>>> df2 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_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
\nYou 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...\n>>> my_chart = st.line_chart(df1)\n>>> my_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
\nAnd for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:
\n\n>>> my_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... }),\n>>> my_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, numpy.ndarray, Iterable, dict,", "is_optional": false, "description": "", "default": null}, {"name": "or None", "type_name": null, "is_optional": null, "description": "Table to concat. Optional.
\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}]}, "DeltaGenerator.altair_chart": {"name": "altair_chart", "signature": "element.altair_chart(self, altair_chart, use_container_width=False)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.
\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}]}, "DeltaGenerator.area_chart": {"name": "area_chart", "signature": "element.area_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display an area chart.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict", "is_optional": false, "description": "Data to be plotted.
\n", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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 width 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.
\n", "default": null}]}, "DeltaGenerator.audio": {"name": "audio", "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0)", "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n", "default": "s"}]}, "DeltaGenerator.balloons": {"name": "balloons", "signature": "element.balloons(self)", "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n", "description": "Draw celebratory balloons.", "args": []}, "DeltaGenerator.bar_chart": {"name": "bar_chart", "signature": "element.bar_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a bar chart.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict", "is_optional": false, "description": "Data to be plotted.
\n", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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 width 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.
\n", "default": null}]}, "DeltaGenerator.beta_columns": {"name": "beta_columns", "signature": "element.beta_columns(self, spec)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.beta_columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.beta_columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor example, st.beta_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}]}, "DeltaGenerator.beta_container": {"name": "beta_container", "signature": "element.beta_container(self)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with st.beta_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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.beta_container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "DeltaGenerator.beta_expander": {"name": "beta_expander", "signature": "element.beta_expander(self, label=None, expanded=False)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with st.beta_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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "DeltaGenerator.bokeh_chart": {"name": "bokeh_chart", "signature": "element.bokeh_chart(self, figure, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.", "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}, {"name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Bokeh's `show`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "DeltaGenerator.button": {"name": "button", "signature": "element.button(self, label, key=None, help=None)", "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 when the button is hovered over.
\n", "default": null}]}, "DeltaGenerator.caption": {"name": "caption", "signature": "element.caption(self, body)", "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in small font.", "args": [{"name": "body", "type_name": "str", "is_optional": false, "description": "The text to display.
\n", "default": null}]}, "DeltaGenerator.checkbox": {"name": "checkbox", "signature": "element.checkbox(self, label, value=False, key=None, help=None)", "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 checkbox.
\n", "default": null}]}, "DeltaGenerator.code": {"name": "code", "signature": "element.code(self, body, language=\"python\")", "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a code block with optional syntax highlighting.", "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", "default": null}]}, "DeltaGenerator.color_picker": {"name": "color_picker", "signature": "element.color_picker(self, label, value=None, key=None, help=None)", "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\n", "default": null}, {"name": "value", "type_name": "str or None", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 color picker.
\n", "default": null}]}, "DeltaGenerator.dataframe": {"name": "dataframe", "signature": "element.dataframe(self, data=None, width=None, height=None)", "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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, numpy.ndarray, Iterable, dict,", "is_optional": false, "description": "or None\nThe data to display.
\nIf '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!
\n", "default": null}, {"name": "width", "type_name": "int or None", "is_optional": false, "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 UI element expressed in pixels. If None, a\ndefault height is used.
\n", "default": "height"}]}, "DeltaGenerator.date_input": {"name": "date_input", "signature": "element.date_input(self, label, value=None, min_value=None, max_value=None, key=None, help=None)", "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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. Defaults to today-10y.
\n", "default": "today-10y."}, {"name": "max_value", "type_name": "datetime.date or datetime.datetime", "is_optional": false, "description": "The maximum selectable date. Defaults to today+10y.
\n", "default": "today"}, {"name": "key", "type_name": "str", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n", "default": null}]}, "DeltaGenerator.empty": {"name": "empty", "signature": "element.empty(self)", "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.beta_container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n", "description": "Insert a single-element container.", "args": []}, "DeltaGenerator.error": {"name": "error", "signature": "element.error(self, body)", "example": "\n\n>>> st.error('This is an error')\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}]}, "DeltaGenerator.exception": {"name": "exception", "signature": "element.exception(self, exception)", "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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}]}, "DeltaGenerator.file_uploader": {"name": "file_uploader", "signature": "element.file_uploader(self, label, type=None, accept_multiple_files=False, key=None, help=None)", "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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", "description": "Display a file uploader widget.", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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}]}, "DeltaGenerator.form": {"name": "form", "signature": "element.form(self, key)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n", "description": "Create a form that batches elements together with a \"Submit\" button.", "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}]}, "DeltaGenerator.form_submit_button": {"name": "form_submit_button", "signature": "element.form_submit_button(self, label=\"Submit\")", "description": "Display a form submit button.", "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"}]}, "DeltaGenerator.graphviz_chart": {"name": "graphviz_chart", "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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}]}, "DeltaGenerator.header": {"name": "header", "signature": "element.header(self, body, anchor=None)", "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "DeltaGenerator.help": {"name": "help", "signature": "element.help(self, obj)", "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n", "description": "Display object's doc string, nicely formatted.", "args": [{"name": "obj", "type_name": "Object", "is_optional": false, "description": "The object whose docstring should be displayed.
\n", "default": null}]}, "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"}]}, "DeltaGenerator.info": {"name": "info", "signature": "element.info(self, body)", "example": "\n\n>>> st.info('This is a purely informational message')\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}]}, "DeltaGenerator.json": {"name": "json", "signature": "element.json(self, body)", "example": "\n\n>>> st.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}]}, "DeltaGenerator.latex": {"name": "latex", "signature": "element.latex(self, body)", "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display mathematical expressions formatted as LaTeX.", "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}]}, "DeltaGenerator.line_chart": {"name": "line_chart", "signature": "element.line_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a line chart.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict", "is_optional": false, "description": "or None\nData to be plotted.
\n", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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 width 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.
\n", "default": null}]}, "DeltaGenerator.map": {"name": "map", "signature": "element.map(self, data=None, zoom=None, use_container_width=True)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a map with points on it.", "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}]}, "DeltaGenerator.markdown": {"name": "markdown", "signature": "element.markdown(self, body, unsafe_allow_html=False)", "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n", "default": null}]}, "DeltaGenerator.multiselect": {"name": "multiselect", "signature": "element.multiselect(self, label, options, default=None, format_func=special_internal_function, key=None, help=None)", "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n", "description": "Display a multiselect widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this select widget is for.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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": "[str] or None", "is_optional": false, "description": "List of default values.
\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 selectbox.
\n", "default": null}, {"name": "key", "type_name": "str", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 multiselect.
\n", "default": null}]}, "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)", "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n", "default": null}]}, "DeltaGenerator.plotly_chart": {"name": "plotly_chart", "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)", "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.", "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
\nSee 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://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}, {"name": "To show Plotly charts in Streamlit, call `st.plotly_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Plotly's `py.plot` or `py.iplot`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "DeltaGenerator.progress": {"name": "progress", "signature": "element.progress(self, value)", "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n", "default": null}]}, "DeltaGenerator.pydeck_chart": {"name": "pydeck_chart", "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)", "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.", "args": [{"name": "spec", "type_name": "pydeck.Deck or None", "is_optional": false, "description": "Object specifying the PyDeck chart to draw.
\n", "default": null}]}, "DeltaGenerator.pyplot": {"name": "pyplot", "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)", "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n", "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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}]}, "DeltaGenerator.radio": {"name": "radio", "signature": "element.radio(self, label, options, index=0, format_func=special_internal_function, key=None, help=None)", "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 radio.
\n", "default": null}]}, "DeltaGenerator.select_slider": {"name": "select_slider", "signature": "element.select_slider(self, label, options=[], value=None, format_func=special_internal_function, key=None, help=None)", "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n", "description": "Display a slider widget to select items from a list.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this slider is for.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 select slider.
\n", "default": null}]}, "DeltaGenerator.selectbox": {"name": "selectbox", "signature": "element.selectbox(self, label, options, index=0, format_func=special_internal_function, key=None, help=None)", "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 selectbox.
\n", "default": null}]}, "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)", "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n", "description": "Display a slider widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this slider is for.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 slider.
\n", "default": null}]}, "DeltaGenerator.subheader": {"name": "subheader", "signature": "element.subheader(self, body, anchor=None)", "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "DeltaGenerator.success": {"name": "success", "signature": "element.success(self, body)", "example": "\n\n>>> st.success('This is a success message!')\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}]}, "DeltaGenerator.table": {"name": "table", "signature": "element.table(self, data=None)", "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a static table.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,", "is_optional": false, "description": "or None\nThe table data.
\n", "default": null}]}, "DeltaGenerator.text": {"name": "text", "signature": "element.text(self, body)", "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "DeltaGenerator.text_area": {"name": "text_area", "signature": "element.text_area(self, label, value=\"\", height=None, max_chars=None, key=None, help=None)", "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n", "default": null}, {"name": "value", "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}, {"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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 textarea.
\n", "default": null}]}, "DeltaGenerator.text_input": {"name": "text_input", "signature": "element.text_input(self, label, value=\"\", max_chars=None, key=None, type=\"default\", help=None)", "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n", "default": null}, {"name": "value", "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}, {"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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be 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": "A tooltip that gets displayed next to the input.
\n", "default": null}]}, "DeltaGenerator.time_input": {"name": "time_input", "signature": "element.time_input(self, label, value=None, key=None, help=None)", "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n", "default": null}]}, "DeltaGenerator.title": {"name": "title", "signature": "element.title(self, body, anchor=None)", "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in title 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}]}, "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\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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, numpy.ndarray, Iterable, dict,", "is_optional": false, "description": "or None\nEither the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).
\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}]}, "DeltaGenerator.video": {"name": "video", "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)", "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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}]}, "DeltaGenerator.warning": {"name": "warning", "signature": "element.warning(self, body)", "example": "\n\n>>> st.warning('This is a warning')\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}]}, "DeltaGenerator.write": {"name": "write", "signature": "element.write(self, *args, **kwargs)", "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Write arguments to the app.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n", "default": "False."}]}}, "0.83.0": {"streamlit.altair_chart": {"name": "altair_chart", "signature": "st.altair_chart(altair_chart, use_container_width=False)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.
\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}]}, "streamlit.area_chart": {"name": "area_chart", "signature": "st.area_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display an area chart.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict", "is_optional": false, "description": "Data to be plotted.
\n", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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 width 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.
\n", "default": null}]}, "streamlit.audio": {"name": "audio", "signature": "st.audio(data, format=\"audio/wav\", start_time=0)", "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n", "default": "s"}]}, "streamlit.balloons": {"name": "balloons", "signature": "st.balloons()", "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n", "description": "Draw celebratory balloons.", "args": []}, "streamlit.bar_chart": {"name": "bar_chart", "signature": "st.bar_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a bar chart.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict", "is_optional": false, "description": "Data to be plotted.
\n", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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 width 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.
\n", "default": null}]}, "streamlit.beta_columns": {"name": "beta_columns", "signature": "st.beta_columns(spec)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.beta_columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.beta_columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor example, st.beta_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}]}, "streamlit.beta_container": {"name": "beta_container", "signature": "st.beta_container()", "examples": "\nInserting elements using "with" notation:
\n\n>>> with st.beta_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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.beta_container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "streamlit.beta_expander": {"name": "beta_expander", "signature": "st.beta_expander(label=None, expanded=False)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with st.beta_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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "streamlit.bokeh_chart": {"name": "bokeh_chart", "signature": "st.bokeh_chart(figure, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.", "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}, {"name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Bokeh's `show`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "streamlit.button": {"name": "button", "signature": "st.button(label, key=None, help=None)", "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 when the button is hovered over.
\n", "default": null}]}, "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\n... def fetch_and_clean_data(url):\n... # Fetch data from URL here, and then clean it up.\n... return data\n...\n>>> d1 = fetch_and_clean_data(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> d2 = 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>>>\n>>> d3 = fetch_and_clean_data(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nTo 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
\nTo 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
\nTo 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
\nAlternatively, 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", "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 normally shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.
\nIf 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 functions 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."}]}, "streamlit.caption": {"name": "caption", "signature": "st.caption(body)", "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in small font.", "args": [{"name": "body", "type_name": "str", "is_optional": false, "description": "The text to display.
\n", "default": null}]}, "streamlit.checkbox": {"name": "checkbox", "signature": "st.checkbox(label, value=False, key=None, help=None)", "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 checkbox.
\n", "default": null}]}, "streamlit.code": {"name": "code", "signature": "st.code(body, language=\"python\")", "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a code block with optional syntax highlighting.", "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", "default": null}]}, "streamlit.color_picker": {"name": "color_picker", "signature": "st.color_picker(label, value=None, key=None, help=None)", "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\n", "default": null}, {"name": "value", "type_name": "str or None", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 color picker.
\n", "default": null}]}, "streamlit.dataframe": {"name": "dataframe", "signature": "st.dataframe(data=None, width=None, height=None)", "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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, numpy.ndarray, Iterable, dict,", "is_optional": false, "description": "or None\nThe data to display.
\nIf '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!
\n", "default": null}, {"name": "width", "type_name": "int or None", "is_optional": false, "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 UI element expressed in pixels. If None, a\ndefault height is used.
\n", "default": "height"}]}, "streamlit.date_input": {"name": "date_input", "signature": "st.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None)", "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n", "default": null}]}, "streamlit.echo": {"name": "echo", "signature": "st.echo(code_location=\"above\")", "example": "\n\n>>> with 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}]}, "streamlit.empty": {"name": "empty", "signature": "st.empty()", "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.beta_container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n", "description": "Insert a single-element container.", "args": []}, "streamlit.error": {"name": "error", "signature": "st.error(body)", "example": "\n\n>>> st.error('This is an error')\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}]}, "streamlit.exception": {"name": "exception", "signature": "st.exception(exception)", "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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}]}, "streamlit.experimental_get_query_params": {"name": "experimental_get_query_params", "signature": "st.experimental_get_query_params()", "example": "\nLet'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\n>>> st.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\nNote 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": []}, "streamlit.experimental_rerun": {"name": "experimental_rerun", "signature": "st.experimental_rerun()", "description": "Rerun the script immediately.", "args": []}, "streamlit.experimental_set_query_params": {"name": "experimental_set_query_params", "signature": "st.experimental_set_query_params(**query_params)", "example": "\nTo 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\n>>> st.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}]}, "streamlit.experimental_show": {"name": "experimental_show", "signature": "st.experimental_show(*args)", "notes": "\nThis 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- When passing multiple arguments the inclusion of , or ) in a string
\n
\n \nargument may cause an error.
\n
\n", "example": "\n\n>>> dataframe = pd.DataFrame({\n... 'first column': [1, 2, 3, 4],\n... 'second column': [10, 20, 30, 40],\n... }))\n>>> st.experimental_show(dataframe)\n
\n
\n", "description": "Write arguments and *argument names* to your app for debugging purposes.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to debug in the App.
\n", "default": null}]}, "streamlit.file_uploader": {"name": "file_uploader", "signature": "st.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None)", "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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", "description": "Display a file uploader widget.", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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}]}, "streamlit.form": {"name": "form", "signature": "st.form(key, clear_on_submit=False)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n", "description": "Create a form that batches elements together with a \"Submit\" button.", "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"}]}, "streamlit.form_submit_button": {"name": "form_submit_button", "signature": "st.form_submit_button(label=\"Submit\", help=None)", "description": "Display a form submit button.", "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."}]}, "streamlit.get_option": {"name": "get_option", "signature": "st.get_option(key)", "description": "Return the current value of a given Streamlit config option.", "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}]}, "streamlit.graphviz_chart": {"name": "graphviz_chart", "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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}]}, "streamlit.header": {"name": "header", "signature": "st.header(body, anchor=None)", "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "streamlit.help": {"name": "help", "signature": "st.help(obj)", "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n", "description": "Display object's doc string, nicely formatted.", "args": [{"name": "obj", "type_name": "Object", "is_optional": false, "description": "The object whose docstring should be displayed.
\n", "default": null}]}, "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"}]}, "streamlit.info": {"name": "info", "signature": "st.info(body)", "example": "\n\n>>> st.info('This is a purely informational message')\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}]}, "streamlit.json": {"name": "json", "signature": "st.json(body)", "example": "\n\n>>> st.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}]}, "streamlit.latex": {"name": "latex", "signature": "st.latex(body)", "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display mathematical expressions formatted as LaTeX.", "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}]}, "streamlit.line_chart": {"name": "line_chart", "signature": "st.line_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a line chart.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict", "is_optional": false, "description": "or None\nData to be plotted.
\n", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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 width 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.
\n", "default": null}]}, "streamlit.map": {"name": "map", "signature": "st.map(data=None, zoom=None, use_container_width=True)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a map with points on it.", "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}]}, "streamlit.markdown": {"name": "markdown", "signature": "st.markdown(body, unsafe_allow_html=False)", "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n", "default": null}]}, "streamlit.multiselect": {"name": "multiselect", "signature": "st.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None)", "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n", "description": "Display a multiselect widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this select widget is for.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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": "[str] or None", "is_optional": false, "description": "List of default values.
\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 selectbox.
\n", "default": null}, {"name": "key", "type_name": "str", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 multiselect.
\n", "default": null}]}, "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)", "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n", "default": null}]}, "streamlit.object_beta_warning": {"name": "object_beta_warning", "signature": "st.object_beta_warning(obj, obj_name, date)", "description": "Wrapper for objects that are no longer in beta.", "args": [{"name": "obj", "type_name": "Any", "is_optional": false, "description": "The st. object that used to be in beta.
\n", "default": null}, {"name": "obj_name", "type_name": "str", "is_optional": false, "description": "The name of the object within __init__.py
\n", "default": null}, {"name": "date", "type_name": "str", "is_optional": false, "description": "A date like "2020-01-01", indicating the last day we'll guarantee\nsupport for the beta_ prefix.
\n \n", "default": null}]}, "streamlit.plotly_chart": {"name": "plotly_chart", "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)", "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.", "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
\nSee 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://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}, {"name": "To show Plotly charts in Streamlit, call `st.plotly_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Plotly's `py.plot` or `py.iplot`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "streamlit.progress": {"name": "progress", "signature": "st.progress(value)", "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n", "default": null}]}, "streamlit.pydeck_chart": {"name": "pydeck_chart", "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)", "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.", "args": [{"name": "spec", "type_name": "pydeck.Deck or None", "is_optional": false, "description": "Object specifying the PyDeck chart to draw.
\n", "default": null}]}, "streamlit.pyplot": {"name": "pyplot", "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)", "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n", "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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}]}, "streamlit.radio": {"name": "radio", "signature": "st.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None)", "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 radio.
\n", "default": null}]}, "streamlit.select_slider": {"name": "select_slider", "signature": "st.select_slider(label, options=[], value=None, format_func=special_internal_function, key=None, help=None)", "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n", "description": "Display a slider widget to select items from a list.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this slider is for.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 select slider.
\n", "default": null}]}, "streamlit.selectbox": {"name": "selectbox", "signature": "st.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None)", "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 selectbox.
\n", "default": null}]}, "streamlit.set_option": {"name": "set_option", "signature": "st.set_option(key, value)", "description": "Set config option.", "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}]}, "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\")", "example": "\n>>> st.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... )\n
\n", "description": "Configures the default settings of the page.", "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"}]}, "streamlit.slider": {"name": "slider", "signature": "st.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None)", "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n", "description": "Display a slider widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this slider is for.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 slider.
\n", "default": null}]}, "streamlit.spinner": {"name": "spinner", "signature": "st.spinner(text=\"In progress...\")", "example": "\n\n>>> with st.spinner('Wait for it...'):\n>>> time.sleep(5)\n>>> st.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}]}, "streamlit.stop": {"name": "stop", "signature": "st.stop()", "example": "\n\n>>> name = st.text_input('Name')\n>>> if not name:\n>>> st.warning('Please input a name.')\n>>> st.stop()\n>>> st.success('Thank you for inputting a name.')\n
\n
\n", "description": "Stops execution immediately.", "args": []}, "streamlit.subheader": {"name": "subheader", "signature": "st.subheader(body, anchor=None)", "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "streamlit.success": {"name": "success", "signature": "st.success(body)", "example": "\n\n>>> st.success('This is a success message!')\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}]}, "streamlit.table": {"name": "table", "signature": "st.table(data=None)", "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a static table.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,", "is_optional": false, "description": "or None\nThe table data.
\n", "default": null}]}, "streamlit.text": {"name": "text", "signature": "st.text(body)", "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "streamlit.text_area": {"name": "text_area", "signature": "st.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None)", "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n", "default": null}, {"name": "value", "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}, {"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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 textarea.
\n", "default": null}]}, "streamlit.text_input": {"name": "text_input", "signature": "st.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None)", "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n", "default": null}, {"name": "value", "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}, {"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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be 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": "A tooltip that gets displayed next to the input.
\n", "default": null}]}, "streamlit.time_input": {"name": "time_input", "signature": "st.time_input(label, value=None, key=None, help=None)", "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n", "default": null}]}, "streamlit.title": {"name": "title", "signature": "st.title(body, anchor=None)", "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in title 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}]}, "streamlit.vega_lite_chart": {"name": "vega_lite_chart", "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, **kwargs)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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, numpy.ndarray, Iterable, dict,", "is_optional": false, "description": "or None\nEither the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).
\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}]}, "streamlit.video": {"name": "video", "signature": "st.video(data, format=\"video/mp4\", start_time=0)", "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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}]}, "streamlit.warning": {"name": "warning", "signature": "st.warning(body)", "example": "\n\n>>> st.warning('This is a warning')\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}]}, "streamlit.write": {"name": "write", "signature": "st.write(*args, **kwargs)", "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Write arguments to the app.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n", "default": "False."}]}, "DeltaGenerator.add_rows": {"name": "add_rows", "signature": "element.add_rows(self, data=None, **kwargs)", "example": "\n\n>>> df1 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_table = st.table(df1)\n>>>\n>>> df2 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_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
\nYou 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...\n>>> my_chart = st.line_chart(df1)\n>>> my_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
\nAnd for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:
\n\n>>> my_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... }),\n>>> my_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, numpy.ndarray, Iterable, dict,", "is_optional": false, "description": "", "default": null}, {"name": "or None", "type_name": null, "is_optional": null, "description": "Table to concat. Optional.
\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}]}, "DeltaGenerator.altair_chart": {"name": "altair_chart", "signature": "element.altair_chart(self, altair_chart, use_container_width=False)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.
\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}]}, "DeltaGenerator.area_chart": {"name": "area_chart", "signature": "element.area_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display an area chart.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict", "is_optional": false, "description": "Data to be plotted.
\n", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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 width 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.
\n", "default": null}]}, "DeltaGenerator.audio": {"name": "audio", "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0)", "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n", "default": "s"}]}, "DeltaGenerator.balloons": {"name": "balloons", "signature": "element.balloons(self)", "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n", "description": "Draw celebratory balloons.", "args": []}, "DeltaGenerator.bar_chart": {"name": "bar_chart", "signature": "element.bar_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a bar chart.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict", "is_optional": false, "description": "Data to be plotted.
\n", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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 width 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.
\n", "default": null}]}, "DeltaGenerator.beta_columns": {"name": "beta_columns", "signature": "element.beta_columns(self, spec)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.beta_columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.beta_columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor example, st.beta_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}]}, "DeltaGenerator.beta_container": {"name": "beta_container", "signature": "element.beta_container(self)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with st.beta_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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.beta_container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "DeltaGenerator.beta_expander": {"name": "beta_expander", "signature": "element.beta_expander(self, label=None, expanded=False)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with st.beta_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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "DeltaGenerator.bokeh_chart": {"name": "bokeh_chart", "signature": "element.bokeh_chart(self, figure, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.", "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}, {"name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Bokeh's `show`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "DeltaGenerator.button": {"name": "button", "signature": "element.button(self, label, key=None, help=None)", "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 when the button is hovered over.
\n", "default": null}]}, "DeltaGenerator.caption": {"name": "caption", "signature": "element.caption(self, body)", "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in small font.", "args": [{"name": "body", "type_name": "str", "is_optional": false, "description": "The text to display.
\n", "default": null}]}, "DeltaGenerator.checkbox": {"name": "checkbox", "signature": "element.checkbox(self, label, value=False, key=None, help=None)", "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 checkbox.
\n", "default": null}]}, "DeltaGenerator.code": {"name": "code", "signature": "element.code(self, body, language=\"python\")", "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a code block with optional syntax highlighting.", "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", "default": null}]}, "DeltaGenerator.color_picker": {"name": "color_picker", "signature": "element.color_picker(self, label, value=None, key=None, help=None)", "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\n", "default": null}, {"name": "value", "type_name": "str or None", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 color picker.
\n", "default": null}]}, "DeltaGenerator.dataframe": {"name": "dataframe", "signature": "element.dataframe(self, data=None, width=None, height=None)", "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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, numpy.ndarray, Iterable, dict,", "is_optional": false, "description": "or None\nThe data to display.
\nIf '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!
\n", "default": null}, {"name": "width", "type_name": "int or None", "is_optional": false, "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 UI element expressed in pixels. If None, a\ndefault height is used.
\n", "default": "height"}]}, "DeltaGenerator.date_input": {"name": "date_input", "signature": "element.date_input(self, label, value=None, min_value=None, max_value=None, key=None, help=None)", "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n", "default": null}]}, "DeltaGenerator.empty": {"name": "empty", "signature": "element.empty(self)", "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.beta_container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n", "description": "Insert a single-element container.", "args": []}, "DeltaGenerator.error": {"name": "error", "signature": "element.error(self, body)", "example": "\n\n>>> st.error('This is an error')\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}]}, "DeltaGenerator.exception": {"name": "exception", "signature": "element.exception(self, exception)", "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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}]}, "DeltaGenerator.file_uploader": {"name": "file_uploader", "signature": "element.file_uploader(self, label, type=None, accept_multiple_files=False, key=None, help=None)", "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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", "description": "Display a file uploader widget.", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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}]}, "DeltaGenerator.form": {"name": "form", "signature": "element.form(self, key, clear_on_submit=False)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n", "description": "Create a form that batches elements together with a \"Submit\" button.", "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"}]}, "DeltaGenerator.form_submit_button": {"name": "form_submit_button", "signature": "element.form_submit_button(self, label=\"Submit\", help=None)", "description": "Display a form submit button.", "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."}]}, "DeltaGenerator.graphviz_chart": {"name": "graphviz_chart", "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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}]}, "DeltaGenerator.header": {"name": "header", "signature": "element.header(self, body, anchor=None)", "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "DeltaGenerator.help": {"name": "help", "signature": "element.help(self, obj)", "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n", "description": "Display object's doc string, nicely formatted.", "args": [{"name": "obj", "type_name": "Object", "is_optional": false, "description": "The object whose docstring should be displayed.
\n", "default": null}]}, "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"}]}, "DeltaGenerator.info": {"name": "info", "signature": "element.info(self, body)", "example": "\n\n>>> st.info('This is a purely informational message')\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}]}, "DeltaGenerator.json": {"name": "json", "signature": "element.json(self, body)", "example": "\n\n>>> st.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}]}, "DeltaGenerator.latex": {"name": "latex", "signature": "element.latex(self, body)", "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display mathematical expressions formatted as LaTeX.", "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}]}, "DeltaGenerator.line_chart": {"name": "line_chart", "signature": "element.line_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a line chart.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict", "is_optional": false, "description": "or None\nData to be plotted.
\n", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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 width 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.
\n", "default": null}]}, "DeltaGenerator.map": {"name": "map", "signature": "element.map(self, data=None, zoom=None, use_container_width=True)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a map with points on it.", "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}]}, "DeltaGenerator.markdown": {"name": "markdown", "signature": "element.markdown(self, body, unsafe_allow_html=False)", "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n", "default": null}]}, "DeltaGenerator.multiselect": {"name": "multiselect", "signature": "element.multiselect(self, label, options, default=None, format_func=special_internal_function, key=None, help=None)", "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n", "description": "Display a multiselect widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this select widget is for.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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": "[str] or None", "is_optional": false, "description": "List of default values.
\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 selectbox.
\n", "default": null}, {"name": "key", "type_name": "str", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 multiselect.
\n", "default": null}]}, "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)", "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n", "default": null}]}, "DeltaGenerator.plotly_chart": {"name": "plotly_chart", "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)", "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.", "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
\nSee 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://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}, {"name": "To show Plotly charts in Streamlit, call `st.plotly_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Plotly's `py.plot` or `py.iplot`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "DeltaGenerator.progress": {"name": "progress", "signature": "element.progress(self, value)", "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n", "default": null}]}, "DeltaGenerator.pydeck_chart": {"name": "pydeck_chart", "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)", "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.", "args": [{"name": "spec", "type_name": "pydeck.Deck or None", "is_optional": false, "description": "Object specifying the PyDeck chart to draw.
\n", "default": null}]}, "DeltaGenerator.pyplot": {"name": "pyplot", "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)", "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n", "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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}]}, "DeltaGenerator.radio": {"name": "radio", "signature": "element.radio(self, label, options, index=0, format_func=special_internal_function, key=None, help=None)", "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 radio.
\n", "default": null}]}, "DeltaGenerator.select_slider": {"name": "select_slider", "signature": "element.select_slider(self, label, options=[], value=None, format_func=special_internal_function, key=None, help=None)", "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n", "description": "Display a slider widget to select items from a list.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this slider is for.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 select slider.
\n", "default": null}]}, "DeltaGenerator.selectbox": {"name": "selectbox", "signature": "element.selectbox(self, label, options, index=0, format_func=special_internal_function, key=None, help=None)", "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 selectbox.
\n", "default": null}]}, "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)", "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n", "description": "Display a slider widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this slider is for.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 slider.
\n", "default": null}]}, "DeltaGenerator.subheader": {"name": "subheader", "signature": "element.subheader(self, body, anchor=None)", "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "DeltaGenerator.success": {"name": "success", "signature": "element.success(self, body)", "example": "\n\n>>> st.success('This is a success message!')\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}]}, "DeltaGenerator.table": {"name": "table", "signature": "element.table(self, data=None)", "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a static table.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,", "is_optional": false, "description": "or None\nThe table data.
\n", "default": null}]}, "DeltaGenerator.text": {"name": "text", "signature": "element.text(self, body)", "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "DeltaGenerator.text_area": {"name": "text_area", "signature": "element.text_area(self, label, value=\"\", height=None, max_chars=None, key=None, help=None)", "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n", "default": null}, {"name": "value", "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}, {"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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 textarea.
\n", "default": null}]}, "DeltaGenerator.text_input": {"name": "text_input", "signature": "element.text_input(self, label, value=\"\", max_chars=None, key=None, type=\"default\", help=None)", "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n", "default": null}, {"name": "value", "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}, {"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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be 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": "A tooltip that gets displayed next to the input.
\n", "default": null}]}, "DeltaGenerator.time_input": {"name": "time_input", "signature": "element.time_input(self, label, value=None, key=None, help=None)", "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n", "default": null}]}, "DeltaGenerator.title": {"name": "title", "signature": "element.title(self, body, anchor=None)", "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in title 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}]}, "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\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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, numpy.ndarray, Iterable, dict,", "is_optional": false, "description": "or None\nEither the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).
\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}]}, "DeltaGenerator.video": {"name": "video", "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)", "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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}]}, "DeltaGenerator.warning": {"name": "warning", "signature": "element.warning(self, body)", "example": "\n\n>>> st.warning('This is a warning')\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}]}, "DeltaGenerator.write": {"name": "write", "signature": "element.write(self, *args, **kwargs)", "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Write arguments to the app.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n", "default": "False."}]}}, "0.84.0": {"streamlit.altair_chart": {"name": "altair_chart", "signature": "st.altair_chart(altair_chart, use_container_width=False)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.
\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}]}, "streamlit.area_chart": {"name": "area_chart", "signature": "st.area_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display an area chart.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict", "is_optional": false, "description": "Data to be plotted.
\n", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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 width 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.
\n", "default": null}]}, "streamlit.audio": {"name": "audio", "signature": "st.audio(data, format=\"audio/wav\", start_time=0)", "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n", "default": "s"}]}, "streamlit.balloons": {"name": "balloons", "signature": "st.balloons()", "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n", "description": "Draw celebratory balloons.", "args": []}, "streamlit.bar_chart": {"name": "bar_chart", "signature": "st.bar_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a bar chart.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict", "is_optional": false, "description": "Data to be plotted.
\n", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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 width 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.
\n", "default": null}]}, "streamlit.beta_columns": {"name": "beta_columns", "signature": "st.beta_columns(spec)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.beta_columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.beta_columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor example, st.beta_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}]}, "streamlit.beta_container": {"name": "beta_container", "signature": "st.beta_container()", "examples": "\nInserting elements using "with" notation:
\n\n>>> with st.beta_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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.beta_container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "streamlit.beta_expander": {"name": "beta_expander", "signature": "st.beta_expander(label, expanded=False)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with st.beta_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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "streamlit.bokeh_chart": {"name": "bokeh_chart", "signature": "st.bokeh_chart(figure, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.", "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}, {"name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Bokeh's `show`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "streamlit.button": {"name": "button", "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None)", "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type 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}]}, "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\n... def fetch_and_clean_data(url):\n... # Fetch data from URL here, and then clean it up.\n... return data\n...\n>>> d1 = fetch_and_clean_data(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> d2 = 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>>>\n>>> d3 = fetch_and_clean_data(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nTo 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
\nTo 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
\nTo 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
\nAlternatively, 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", "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 normally shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.
\nIf 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 functions 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."}]}, "streamlit.caption": {"name": "caption", "signature": "st.caption(body)", "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in small font.", "args": [{"name": "body", "type_name": "str", "is_optional": false, "description": "The text to display.
\n", "default": null}]}, "streamlit.checkbox": {"name": "checkbox", "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "streamlit.code": {"name": "code", "signature": "st.code(body, language=\"python\")", "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a code block with optional syntax highlighting.", "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", "default": null}]}, "streamlit.color_picker": {"name": "color_picker", "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "streamlit.dataframe": {"name": "dataframe", "signature": "st.dataframe(data=None, width=None, height=None)", "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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, numpy.ndarray, Iterable, dict,", "is_optional": false, "description": "or None\nThe data to display.
\nIf '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!
\n", "default": null}, {"name": "width", "type_name": "int or None", "is_optional": false, "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 UI element expressed in pixels. If None, a\ndefault height is used.
\n", "default": "height"}]}, "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)", "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "streamlit.echo": {"name": "echo", "signature": "st.echo(code_location=\"above\")", "example": "\n\n>>> with 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}]}, "streamlit.empty": {"name": "empty", "signature": "st.empty()", "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.beta_container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n", "description": "Insert a single-element container.", "args": []}, "streamlit.error": {"name": "error", "signature": "st.error(body)", "example": "\n\n>>> st.error('This is an error')\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}]}, "streamlit.exception": {"name": "exception", "signature": "st.exception(exception)", "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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}]}, "streamlit.experimental_get_query_params": {"name": "experimental_get_query_params", "signature": "st.experimental_get_query_params()", "example": "\nLet'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\n>>> st.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\nNote 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": []}, "streamlit.experimental_rerun": {"name": "experimental_rerun", "signature": "st.experimental_rerun()", "description": "Rerun the script immediately.", "args": []}, "streamlit.experimental_set_query_params": {"name": "experimental_set_query_params", "signature": "st.experimental_set_query_params(**query_params)", "example": "\nTo 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\n>>> st.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}]}, "streamlit.experimental_show": {"name": "experimental_show", "signature": "st.experimental_show(*args)", "notes": "\nThis 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- When passing multiple arguments the inclusion of , or ) in a string
\n
\n \nargument may cause an error.
\n
\n", "example": "\n\n>>> dataframe = pd.DataFrame({\n... 'first column': [1, 2, 3, 4],\n... 'second column': [10, 20, 30, 40],\n... }))\n>>> st.experimental_show(dataframe)\n
\n
\n", "description": "Write arguments and *argument names* to your app for debugging purposes.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to debug in the App.
\n", "default": null}]}, "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)", "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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", "description": "Display a file uploader widget.", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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}]}, "streamlit.form": {"name": "form", "signature": "st.form(key, clear_on_submit=False)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n", "description": "Create a form that batches elements together with a \"Submit\" button.", "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"}]}, "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.", "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}]}, "streamlit.get_option": {"name": "get_option", "signature": "st.get_option(key)", "description": "Return the current value of a given Streamlit config option.", "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}]}, "streamlit.graphviz_chart": {"name": "graphviz_chart", "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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}]}, "streamlit.header": {"name": "header", "signature": "st.header(body, anchor=None)", "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "streamlit.help": {"name": "help", "signature": "st.help(obj)", "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n", "description": "Display object's doc string, nicely formatted.", "args": [{"name": "obj", "type_name": "Object", "is_optional": false, "description": "The object whose docstring should be displayed.
\n", "default": null}]}, "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"}]}, "streamlit.info": {"name": "info", "signature": "st.info(body)", "example": "\n\n>>> st.info('This is a purely informational message')\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}]}, "streamlit.json": {"name": "json", "signature": "st.json(body)", "example": "\n\n>>> st.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}]}, "streamlit.latex": {"name": "latex", "signature": "st.latex(body)", "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display mathematical expressions formatted as LaTeX.", "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}]}, "streamlit.line_chart": {"name": "line_chart", "signature": "st.line_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a line chart.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict", "is_optional": false, "description": "or None\nData to be plotted.
\n", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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 width 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.
\n", "default": null}]}, "streamlit.map": {"name": "map", "signature": "st.map(data=None, zoom=None, use_container_width=True)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a map with points on it.", "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}]}, "streamlit.markdown": {"name": "markdown", "signature": "st.markdown(body, unsafe_allow_html=False)", "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n", "default": null}]}, "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)", "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n", "description": "Display a multiselect widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this select widget is for.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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": "[str] or None", "is_optional": false, "description": "List of default values.
\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 selectbox.
\n", "default": null}, {"name": "key", "type_name": "str", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "streamlit.object_beta_warning": {"name": "object_beta_warning", "signature": "st.object_beta_warning(obj, obj_name, date)", "description": "Wrapper for objects that are no longer in beta.", "args": [{"name": "obj", "type_name": "Any", "is_optional": false, "description": "The st. object that used to be in beta.
\n", "default": null}, {"name": "obj_name", "type_name": "str", "is_optional": false, "description": "The name of the object within __init__.py
\n", "default": null}, {"name": "date", "type_name": "str", "is_optional": false, "description": "A date like "2020-01-01", indicating the last day we'll guarantee\nsupport for the beta_ prefix.
\n \n", "default": null}]}, "streamlit.plotly_chart": {"name": "plotly_chart", "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)", "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.", "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
\nSee 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://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}, {"name": "To show Plotly charts in Streamlit, call `st.plotly_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Plotly's `py.plot` or `py.iplot`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "streamlit.progress": {"name": "progress", "signature": "st.progress(value)", "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n", "default": null}]}, "streamlit.pydeck_chart": {"name": "pydeck_chart", "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)", "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.", "args": [{"name": "spec", "type_name": "pydeck.Deck or None", "is_optional": false, "description": "Object specifying the PyDeck chart to draw.
\n", "default": null}]}, "streamlit.pyplot": {"name": "pyplot", "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)", "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n", "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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}]}, "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)", "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n", "description": "Display a slider widget to select items from a list.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this slider is for.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "streamlit.set_option": {"name": "set_option", "signature": "st.set_option(key, value)", "description": "Set config option.", "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}]}, "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\")", "example": "\n>>> st.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... )\n
\n", "description": "Configures the default settings of the page.", "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"}]}, "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)", "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n", "description": "Display a slider widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this slider is for.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "streamlit.spinner": {"name": "spinner", "signature": "st.spinner(text=\"In progress...\")", "example": "\n\n>>> with st.spinner('Wait for it...'):\n>>> time.sleep(5)\n>>> st.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}]}, "streamlit.stop": {"name": "stop", "signature": "st.stop()", "example": "\n\n>>> name = st.text_input('Name')\n>>> if not name:\n>>> st.warning('Please input a name.')\n>>> st.stop()\n>>> st.success('Thank you for inputting a name.')\n
\n
\n", "description": "Stops execution immediately.", "args": []}, "streamlit.subheader": {"name": "subheader", "signature": "st.subheader(body, anchor=None)", "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "streamlit.success": {"name": "success", "signature": "st.success(body)", "example": "\n\n>>> st.success('This is a success message!')\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}]}, "streamlit.table": {"name": "table", "signature": "st.table(data=None)", "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a static table.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,", "is_optional": false, "description": "or None\nThe table data.
\n", "default": null}]}, "streamlit.text": {"name": "text", "signature": "st.text(body)", "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "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)", "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n", "default": null}, {"name": "value", "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}, {"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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n", "default": null}, {"name": "value", "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}, {"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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be 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}]}, "streamlit.time_input": {"name": "time_input", "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "streamlit.title": {"name": "title", "signature": "st.title(body, anchor=None)", "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in title 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}]}, "streamlit.vega_lite_chart": {"name": "vega_lite_chart", "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, **kwargs)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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, numpy.ndarray, Iterable, dict,", "is_optional": false, "description": "or None\nEither the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).
\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}]}, "streamlit.video": {"name": "video", "signature": "st.video(data, format=\"video/mp4\", start_time=0)", "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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}]}, "streamlit.warning": {"name": "warning", "signature": "st.warning(body)", "example": "\n\n>>> st.warning('This is a warning')\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}]}, "streamlit.write": {"name": "write", "signature": "st.write(*args, **kwargs)", "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Write arguments to the app.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n", "default": "False."}]}, "DeltaGenerator.add_rows": {"name": "add_rows", "signature": "element.add_rows(self, data=None, **kwargs)", "example": "\n\n>>> df1 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_table = st.table(df1)\n>>>\n>>> df2 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_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
\nYou 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...\n>>> my_chart = st.line_chart(df1)\n>>> my_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
\nAnd for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:
\n\n>>> my_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... }),\n>>> my_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, numpy.ndarray, Iterable, dict,", "is_optional": false, "description": "", "default": null}, {"name": "or None", "type_name": null, "is_optional": null, "description": "Table to concat. Optional.
\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}]}, "DeltaGenerator.altair_chart": {"name": "altair_chart", "signature": "element.altair_chart(self, altair_chart, use_container_width=False)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.
\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}]}, "DeltaGenerator.area_chart": {"name": "area_chart", "signature": "element.area_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display an area chart.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict", "is_optional": false, "description": "Data to be plotted.
\n", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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 width 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.
\n", "default": null}]}, "DeltaGenerator.audio": {"name": "audio", "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0)", "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n", "default": "s"}]}, "DeltaGenerator.balloons": {"name": "balloons", "signature": "element.balloons(self)", "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n", "description": "Draw celebratory balloons.", "args": []}, "DeltaGenerator.bar_chart": {"name": "bar_chart", "signature": "element.bar_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a bar chart.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict", "is_optional": false, "description": "Data to be plotted.
\n", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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 width 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.
\n", "default": null}]}, "DeltaGenerator.beta_columns": {"name": "beta_columns", "signature": "element.beta_columns(self, spec)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.beta_columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.beta_columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor example, st.beta_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}]}, "DeltaGenerator.beta_container": {"name": "beta_container", "signature": "element.beta_container(self)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with st.beta_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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.beta_container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "DeltaGenerator.beta_expander": {"name": "beta_expander", "signature": "element.beta_expander(self, label, expanded=False)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with st.beta_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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "DeltaGenerator.bokeh_chart": {"name": "bokeh_chart", "signature": "element.bokeh_chart(self, figure, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.", "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}, {"name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Bokeh's `show`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "DeltaGenerator.button": {"name": "button", "signature": "element.button(self, label, key=None, help=None, on_click=None, args=None, kwargs=None)", "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type 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}]}, "DeltaGenerator.caption": {"name": "caption", "signature": "element.caption(self, body)", "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in small font.", "args": [{"name": "body", "type_name": "str", "is_optional": false, "description": "The text to display.
\n", "default": null}]}, "DeltaGenerator.checkbox": {"name": "checkbox", "signature": "element.checkbox(self, label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "DeltaGenerator.code": {"name": "code", "signature": "element.code(self, body, language=\"python\")", "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a code block with optional syntax highlighting.", "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", "default": null}]}, "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)", "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "DeltaGenerator.dataframe": {"name": "dataframe", "signature": "element.dataframe(self, data=None, width=None, height=None)", "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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, numpy.ndarray, Iterable, dict,", "is_optional": false, "description": "or None\nThe data to display.
\nIf '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!
\n", "default": null}, {"name": "width", "type_name": "int or None", "is_optional": false, "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 UI element expressed in pixels. If None, a\ndefault height is used.
\n", "default": "height"}]}, "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)", "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "DeltaGenerator.empty": {"name": "empty", "signature": "element.empty(self)", "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.beta_container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n", "description": "Insert a single-element container.", "args": []}, "DeltaGenerator.error": {"name": "error", "signature": "element.error(self, body)", "example": "\n\n>>> st.error('This is an error')\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}]}, "DeltaGenerator.exception": {"name": "exception", "signature": "element.exception(self, exception)", "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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}]}, "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)", "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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", "description": "Display a file uploader widget.", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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}]}, "DeltaGenerator.form": {"name": "form", "signature": "element.form(self, key, clear_on_submit=False)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n", "description": "Create a form that batches elements together with a \"Submit\" button.", "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"}]}, "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.", "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}]}, "DeltaGenerator.graphviz_chart": {"name": "graphviz_chart", "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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}]}, "DeltaGenerator.header": {"name": "header", "signature": "element.header(self, body, anchor=None)", "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "DeltaGenerator.help": {"name": "help", "signature": "element.help(self, obj)", "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n", "description": "Display object's doc string, nicely formatted.", "args": [{"name": "obj", "type_name": "Object", "is_optional": false, "description": "The object whose docstring should be displayed.
\n", "default": null}]}, "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"}]}, "DeltaGenerator.info": {"name": "info", "signature": "element.info(self, body)", "example": "\n\n>>> st.info('This is a purely informational message')\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}]}, "DeltaGenerator.json": {"name": "json", "signature": "element.json(self, body)", "example": "\n\n>>> st.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}]}, "DeltaGenerator.latex": {"name": "latex", "signature": "element.latex(self, body)", "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display mathematical expressions formatted as LaTeX.", "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}]}, "DeltaGenerator.line_chart": {"name": "line_chart", "signature": "element.line_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a line chart.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict", "is_optional": false, "description": "or None\nData to be plotted.
\n", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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 width 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.
\n", "default": null}]}, "DeltaGenerator.map": {"name": "map", "signature": "element.map(self, data=None, zoom=None, use_container_width=True)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a map with points on it.", "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}]}, "DeltaGenerator.markdown": {"name": "markdown", "signature": "element.markdown(self, body, unsafe_allow_html=False)", "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n", "default": null}]}, "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)", "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n", "description": "Display a multiselect widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this select widget is for.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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": "[str] or None", "is_optional": false, "description": "List of default values.
\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 selectbox.
\n", "default": null}, {"name": "key", "type_name": "str", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "DeltaGenerator.plotly_chart": {"name": "plotly_chart", "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)", "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.", "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
\nSee 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://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}, {"name": "To show Plotly charts in Streamlit, call `st.plotly_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Plotly's `py.plot` or `py.iplot`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "DeltaGenerator.progress": {"name": "progress", "signature": "element.progress(self, value)", "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n", "default": null}]}, "DeltaGenerator.pydeck_chart": {"name": "pydeck_chart", "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)", "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.", "args": [{"name": "spec", "type_name": "pydeck.Deck or None", "is_optional": false, "description": "Object specifying the PyDeck chart to draw.
\n", "default": null}]}, "DeltaGenerator.pyplot": {"name": "pyplot", "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)", "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n", "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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}]}, "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)", "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n", "description": "Display a slider widget to select items from a list.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this slider is for.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\n", "default": null}, {"name": "options", "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n", "description": "Display a slider widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this slider is for.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "DeltaGenerator.subheader": {"name": "subheader", "signature": "element.subheader(self, body, anchor=None)", "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "DeltaGenerator.success": {"name": "success", "signature": "element.success(self, body)", "example": "\n\n>>> st.success('This is a success message!')\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}]}, "DeltaGenerator.table": {"name": "table", "signature": "element.table(self, data=None)", "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a static table.", "args": [{"name": "data", "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,", "is_optional": false, "description": "or None\nThe table data.
\n", "default": null}]}, "DeltaGenerator.text": {"name": "text", "signature": "element.text(self, body)", "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "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)", "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n", "default": null}, {"name": "value", "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}, {"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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n", "default": null}, {"name": "value", "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}, {"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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be 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}]}, "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)", "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "DeltaGenerator.title": {"name": "title", "signature": "element.title(self, body, anchor=None)", "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in title 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}]}, "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\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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, numpy.ndarray, Iterable, dict,", "is_optional": false, "description": "or None\nEither the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).
\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}]}, "DeltaGenerator.video": {"name": "video", "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)", "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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}]}, "DeltaGenerator.warning": {"name": "warning", "signature": "element.warning(self, body)", "example": "\n\n>>> st.warning('This is a warning')\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}]}, "DeltaGenerator.write": {"name": "write", "signature": "element.write(self, *args, **kwargs)", "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Write arguments to the app.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n", "default": "False."}]}}, "0.85.0": {"streamlit.altair_chart": {"name": "altair_chart", "signature": "st.altair_chart(altair_chart, use_container_width=False)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\nExamples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.
\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}]}, "streamlit.area_chart": {"name": "area_chart", "signature": "st.area_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n
\n", "description": "Display an area chart.", "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": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "streamlit.audio": {"name": "audio", "signature": "st.audio(data, format=\"audio/wav\", start_time=0)", "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n", "default": "s"}]}, "streamlit.balloons": {"name": "balloons", "signature": "st.balloons()", "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n", "description": "Draw celebratory balloons.", "args": []}, "streamlit.bar_chart": {"name": "bar_chart", "signature": "st.bar_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n
\n", "description": "Display a bar chart.", "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": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "streamlit.beta_columns": {"name": "beta_columns", "signature": "st.beta_columns(spec)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.beta_columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.beta_columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor example, st.beta_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}]}, "streamlit.beta_container": {"name": "beta_container", "signature": "st.beta_container()", "examples": "\nInserting elements using "with" notation:
\n\n>>> with st.beta_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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.beta_container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "streamlit.beta_expander": {"name": "beta_expander", "signature": "st.beta_expander(label, expanded=False)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with st.beta_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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "streamlit.bokeh_chart": {"name": "bokeh_chart", "signature": "st.bokeh_chart(figure, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.", "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}, {"name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Bokeh's `show`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "streamlit.button": {"name": "button", "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None)", "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type 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}]}, "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\n... def fetch_and_clean_data(url):\n... # Fetch data from URL here, and then clean it up.\n... return data\n...\n>>> d1 = fetch_and_clean_data(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> d2 = 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>>>\n>>> d3 = fetch_and_clean_data(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nTo 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
\nTo 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
\nTo 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
\nAlternatively, 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", "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 normally shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.
\nIf 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 functions 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."}]}, "streamlit.caption": {"name": "caption", "signature": "st.caption(body)", "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in small font.", "args": [{"name": "body", "type_name": "str", "is_optional": false, "description": "The text to display.
\n", "default": null}]}, "streamlit.checkbox": {"name": "checkbox", "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "streamlit.code": {"name": "code", "signature": "st.code(body, language=\"python\")", "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a code block with optional syntax highlighting.", "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", "default": null}]}, "streamlit.color_picker": {"name": "color_picker", "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "streamlit.dataframe": {"name": "dataframe", "signature": "st.dataframe(data=None, width=None, height=None)", "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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.
\nIf '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 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 UI element expressed in pixels. If None, a\ndefault height is used.
\n", "default": "height"}]}, "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)", "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "streamlit.echo": {"name": "echo", "signature": "st.echo(code_location=\"above\")", "example": "\n\n>>> with 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}]}, "streamlit.empty": {"name": "empty", "signature": "st.empty()", "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.beta_container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n", "description": "Insert a single-element container.", "args": []}, "streamlit.error": {"name": "error", "signature": "st.error(body)", "example": "\n\n>>> st.error('This is an error')\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}]}, "streamlit.exception": {"name": "exception", "signature": "st.exception(exception)", "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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}]}, "streamlit.experimental_get_query_params": {"name": "experimental_get_query_params", "signature": "st.experimental_get_query_params()", "example": "\nLet'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\n>>> st.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\nNote 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": []}, "streamlit.experimental_rerun": {"name": "experimental_rerun", "signature": "st.experimental_rerun()", "description": "Rerun the script immediately.", "args": []}, "streamlit.experimental_set_query_params": {"name": "experimental_set_query_params", "signature": "st.experimental_set_query_params(**query_params)", "example": "\nTo 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\n>>> st.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}]}, "streamlit.experimental_show": {"name": "experimental_show", "signature": "st.experimental_show(*args)", "notes": "\nThis 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- When passing multiple arguments the inclusion of , or ) in a string
\n
\n \nargument may cause an error.
\n
\n", "example": "\n\n>>> dataframe = pd.DataFrame({\n... 'first column': [1, 2, 3, 4],\n... 'second column': [10, 20, 30, 40],\n... }))\n>>> st.experimental_show(dataframe)\n
\n
\n", "description": "Write arguments and *argument names* to your app for debugging purposes.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to debug in the App.
\n", "default": null}]}, "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)", "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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", "description": "Display a file uploader widget.", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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}]}, "streamlit.form": {"name": "form", "signature": "st.form(key, clear_on_submit=False)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n", "description": "Create a form that batches elements together with a \"Submit\" button.", "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"}]}, "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.", "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}]}, "streamlit.get_option": {"name": "get_option", "signature": "st.get_option(key)", "description": "Return the current value of a given Streamlit config option.", "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}]}, "streamlit.graphviz_chart": {"name": "graphviz_chart", "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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}]}, "streamlit.header": {"name": "header", "signature": "st.header(body, anchor=None)", "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "streamlit.help": {"name": "help", "signature": "st.help(obj)", "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n", "description": "Display object's doc string, nicely formatted.", "args": [{"name": "obj", "type_name": "Object", "is_optional": false, "description": "The object whose docstring should be displayed.
\n", "default": null}]}, "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"}]}, "streamlit.info": {"name": "info", "signature": "st.info(body)", "example": "\n\n>>> st.info('This is a purely informational message')\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}]}, "streamlit.json": {"name": "json", "signature": "st.json(body)", "example": "\n\n>>> st.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}]}, "streamlit.latex": {"name": "latex", "signature": "st.latex(body)", "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display mathematical expressions formatted as LaTeX.", "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}]}, "streamlit.line_chart": {"name": "line_chart", "signature": "st.line_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st._arrow_line_chart(chart_data)\n
\n
\n", "description": "Display a line chart.", "args": [{"name": "data", "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", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "streamlit.map": {"name": "map", "signature": "st.map(data=None, zoom=None, use_container_width=True)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a map with points on it.", "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}]}, "streamlit.markdown": {"name": "markdown", "signature": "st.markdown(body, unsafe_allow_html=False)", "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n", "default": null}]}, "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)", "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n", "description": "Display a multiselect widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this select widget 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 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": "[str] or None", "is_optional": false, "description": "List of default values.
\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 selectbox.
\n", "default": null}, {"name": "key", "type_name": "str", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "streamlit.object_beta_warning": {"name": "object_beta_warning", "signature": "st.object_beta_warning(obj, obj_name, date)", "description": "Wrapper for objects that are no longer in beta.", "args": [{"name": "obj", "type_name": "Any", "is_optional": false, "description": "The st. object that used to be in beta.
\n", "default": null}, {"name": "obj_name", "type_name": "str", "is_optional": false, "description": "The name of the object within __init__.py
\n", "default": null}, {"name": "date", "type_name": "str", "is_optional": false, "description": "A date like "2020-01-01", indicating the last day we'll guarantee\nsupport for the beta_ prefix.
\n \n", "default": null}]}, "streamlit.plotly_chart": {"name": "plotly_chart", "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)", "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.", "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
\nSee 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://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}, {"name": "To show Plotly charts in Streamlit, call `st.plotly_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Plotly's `py.plot` or `py.iplot`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "streamlit.progress": {"name": "progress", "signature": "st.progress(value)", "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n", "default": null}]}, "streamlit.pydeck_chart": {"name": "pydeck_chart", "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)", "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.", "args": [{"name": "spec", "type_name": "pydeck.Deck or None", "is_optional": false, "description": "Object specifying the PyDeck chart to draw.
\n", "default": null}]}, "streamlit.pyplot": {"name": "pyplot", "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)", "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n", "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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}]}, "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)", "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n", "description": "Display a slider widget to select items from a list.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "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": "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "streamlit.set_option": {"name": "set_option", "signature": "st.set_option(key, value)", "description": "Set config option.", "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}]}, "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\")", "example": "\n>>> st.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... )\n
\n", "description": "Configures the default settings of the page.", "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"}]}, "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)", "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n", "description": "Display a slider widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this slider is for.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "streamlit.spinner": {"name": "spinner", "signature": "st.spinner(text=\"In progress...\")", "example": "\n\n>>> with st.spinner('Wait for it...'):\n>>> time.sleep(5)\n>>> st.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}]}, "streamlit.stop": {"name": "stop", "signature": "st.stop()", "example": "\n\n>>> name = st.text_input('Name')\n>>> if not name:\n>>> st.warning('Please input a name.')\n>>> st.stop()\n>>> st.success('Thank you for inputting a name.')\n
\n
\n", "description": "Stops execution immediately.", "args": []}, "streamlit.subheader": {"name": "subheader", "signature": "st.subheader(body, anchor=None)", "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "streamlit.success": {"name": "success", "signature": "st.success(body)", "example": "\n\n>>> st.success('This is a success message!')\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}]}, "streamlit.table": {"name": "table", "signature": "st.table(data=None)", "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a static table.", "args": [{"name": "data", "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", "default": null}]}, "streamlit.text": {"name": "text", "signature": "st.text(body)", "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "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)", "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n", "default": null}, {"name": "value", "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}, {"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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n", "default": null}, {"name": "value", "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}, {"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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be 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}]}, "streamlit.time_input": {"name": "time_input", "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "streamlit.title": {"name": "title", "signature": "st.title(body, anchor=None)", "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in title 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}]}, "streamlit.vega_lite_chart": {"name": "vega_lite_chart", "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, **kwargs)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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}]}, "streamlit.video": {"name": "video", "signature": "st.video(data, format=\"video/mp4\", start_time=0)", "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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}]}, "streamlit.warning": {"name": "warning", "signature": "st.warning(body)", "example": "\n\n>>> st.warning('This is a warning')\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}]}, "streamlit.write": {"name": "write", "signature": "st.write(*args, **kwargs)", "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Write arguments to the app.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n", "default": "False."}]}, "DeltaGenerator.add_rows": {"name": "add_rows", "signature": "element.add_rows(self, data=None, **kwargs)", "example": "\n\n>>> df1 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_table = st.table(df1)\n>>>\n>>> df2 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_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
\nYou 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...\n>>> my_chart = st.line_chart(df1)\n>>> my_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
\nAnd for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:
\n\n>>> my_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... }),\n>>> my_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": "**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}]}, "DeltaGenerator.altair_chart": {"name": "altair_chart", "signature": "element.altair_chart(self, altair_chart, use_container_width=False)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\nExamples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.
\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}]}, "DeltaGenerator.area_chart": {"name": "area_chart", "signature": "element.area_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n
\n", "description": "Display an area chart.", "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": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "DeltaGenerator.audio": {"name": "audio", "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0)", "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n", "default": "s"}]}, "DeltaGenerator.balloons": {"name": "balloons", "signature": "element.balloons(self)", "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n", "description": "Draw celebratory balloons.", "args": []}, "DeltaGenerator.bar_chart": {"name": "bar_chart", "signature": "element.bar_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n
\n", "description": "Display a bar chart.", "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": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "DeltaGenerator.beta_columns": {"name": "beta_columns", "signature": "element.beta_columns(self, spec)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.beta_columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.beta_columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor example, st.beta_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}]}, "DeltaGenerator.beta_container": {"name": "beta_container", "signature": "element.beta_container(self)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with st.beta_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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.beta_container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "DeltaGenerator.beta_expander": {"name": "beta_expander", "signature": "element.beta_expander(self, label, expanded=False)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with st.beta_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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "DeltaGenerator.bokeh_chart": {"name": "bokeh_chart", "signature": "element.bokeh_chart(self, figure, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.", "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}, {"name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Bokeh's `show`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "DeltaGenerator.button": {"name": "button", "signature": "element.button(self, label, key=None, help=None, on_click=None, args=None, kwargs=None)", "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type 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}]}, "DeltaGenerator.caption": {"name": "caption", "signature": "element.caption(self, body)", "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in small font.", "args": [{"name": "body", "type_name": "str", "is_optional": false, "description": "The text to display.
\n", "default": null}]}, "DeltaGenerator.checkbox": {"name": "checkbox", "signature": "element.checkbox(self, label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "DeltaGenerator.code": {"name": "code", "signature": "element.code(self, body, language=\"python\")", "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a code block with optional syntax highlighting.", "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", "default": null}]}, "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)", "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "DeltaGenerator.dataframe": {"name": "dataframe", "signature": "element.dataframe(self, data=None, width=None, height=None)", "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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.
\nIf '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 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 UI element expressed in pixels. If None, a\ndefault height is used.
\n", "default": "height"}]}, "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)", "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "DeltaGenerator.empty": {"name": "empty", "signature": "element.empty(self)", "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.beta_container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n", "description": "Insert a single-element container.", "args": []}, "DeltaGenerator.error": {"name": "error", "signature": "element.error(self, body)", "example": "\n\n>>> st.error('This is an error')\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}]}, "DeltaGenerator.exception": {"name": "exception", "signature": "element.exception(self, exception)", "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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}]}, "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)", "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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", "description": "Display a file uploader widget.", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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}]}, "DeltaGenerator.form": {"name": "form", "signature": "element.form(self, key, clear_on_submit=False)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n", "description": "Create a form that batches elements together with a \"Submit\" button.", "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"}]}, "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.", "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}]}, "DeltaGenerator.graphviz_chart": {"name": "graphviz_chart", "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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}]}, "DeltaGenerator.header": {"name": "header", "signature": "element.header(self, body, anchor=None)", "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "DeltaGenerator.help": {"name": "help", "signature": "element.help(self, obj)", "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n", "description": "Display object's doc string, nicely formatted.", "args": [{"name": "obj", "type_name": "Object", "is_optional": false, "description": "The object whose docstring should be displayed.
\n", "default": null}]}, "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"}]}, "DeltaGenerator.info": {"name": "info", "signature": "element.info(self, body)", "example": "\n\n>>> st.info('This is a purely informational message')\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}]}, "DeltaGenerator.json": {"name": "json", "signature": "element.json(self, body)", "example": "\n\n>>> st.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}]}, "DeltaGenerator.latex": {"name": "latex", "signature": "element.latex(self, body)", "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display mathematical expressions formatted as LaTeX.", "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}]}, "DeltaGenerator.line_chart": {"name": "line_chart", "signature": "element.line_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st._arrow_line_chart(chart_data)\n
\n
\n", "description": "Display a line chart.", "args": [{"name": "data", "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", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "DeltaGenerator.map": {"name": "map", "signature": "element.map(self, data=None, zoom=None, use_container_width=True)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a map with points on it.", "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}]}, "DeltaGenerator.markdown": {"name": "markdown", "signature": "element.markdown(self, body, unsafe_allow_html=False)", "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n", "default": null}]}, "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)", "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n", "description": "Display a multiselect widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this select widget 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 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": "[str] or None", "is_optional": false, "description": "List of default values.
\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 selectbox.
\n", "default": null}, {"name": "key", "type_name": "str", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "DeltaGenerator.plotly_chart": {"name": "plotly_chart", "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)", "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.", "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
\nSee 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://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}, {"name": "To show Plotly charts in Streamlit, call `st.plotly_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Plotly's `py.plot` or `py.iplot`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "DeltaGenerator.progress": {"name": "progress", "signature": "element.progress(self, value)", "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n", "default": null}]}, "DeltaGenerator.pydeck_chart": {"name": "pydeck_chart", "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)", "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.", "args": [{"name": "spec", "type_name": "pydeck.Deck or None", "is_optional": false, "description": "Object specifying the PyDeck chart to draw.
\n", "default": null}]}, "DeltaGenerator.pyplot": {"name": "pyplot", "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)", "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n", "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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}]}, "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)", "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n", "description": "Display a slider widget to select items from a list.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "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": "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n", "description": "Display a slider widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this slider is for.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "DeltaGenerator.subheader": {"name": "subheader", "signature": "element.subheader(self, body, anchor=None)", "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "DeltaGenerator.success": {"name": "success", "signature": "element.success(self, body)", "example": "\n\n>>> st.success('This is a success message!')\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}]}, "DeltaGenerator.table": {"name": "table", "signature": "element.table(self, data=None)", "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a static table.", "args": [{"name": "data", "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", "default": null}]}, "DeltaGenerator.text": {"name": "text", "signature": "element.text(self, body)", "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "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)", "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n", "default": null}, {"name": "value", "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}, {"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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n", "default": null}, {"name": "value", "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}, {"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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be 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}]}, "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)", "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "DeltaGenerator.title": {"name": "title", "signature": "element.title(self, body, anchor=None)", "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in title 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}]}, "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\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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}]}, "DeltaGenerator.video": {"name": "video", "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)", "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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}]}, "DeltaGenerator.warning": {"name": "warning", "signature": "element.warning(self, body)", "example": "\n\n>>> st.warning('This is a warning')\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}]}, "DeltaGenerator.write": {"name": "write", "signature": "element.write(self, *args, **kwargs)", "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Write arguments to the app.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n", "default": "False."}]}}, "0.86.0": {"streamlit.altair_chart": {"name": "altair_chart", "signature": "st.altair_chart(altair_chart, use_container_width=False)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\nExamples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.
\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}]}, "streamlit.area_chart": {"name": "area_chart", "signature": "st.area_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n
\n", "description": "Display an area chart.", "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": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "streamlit.audio": {"name": "audio", "signature": "st.audio(data, format=\"audio/wav\", start_time=0)", "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n", "default": "s"}]}, "streamlit.balloons": {"name": "balloons", "signature": "st.balloons()", "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n", "description": "Draw celebratory balloons.", "args": []}, "streamlit.bar_chart": {"name": "bar_chart", "signature": "st.bar_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n
\n", "description": "Display a bar chart.", "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": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "streamlit.beta_columns": {"name": "beta_columns", "signature": "st.beta_columns(*args, **kwargs)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor 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}]}, "streamlit.beta_container": {"name": "beta_container", "signature": "st.beta_container(*args, **kwargs)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "streamlit.beta_expander": {"name": "beta_expander", "signature": "st.beta_expander(*args, **kwargs)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "streamlit.bokeh_chart": {"name": "bokeh_chart", "signature": "st.bokeh_chart(figure, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.", "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}, {"name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Bokeh's `show`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "streamlit.button": {"name": "button", "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None)", "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type 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}]}, "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\n... def fetch_and_clean_data(url):\n... # Fetch data from URL here, and then clean it up.\n... return data\n...\n>>> d1 = fetch_and_clean_data(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> d2 = 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>>>\n>>> d3 = fetch_and_clean_data(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nTo 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
\nTo 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
\nTo 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
\nAlternatively, 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", "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 normally shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.
\nIf 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 functions 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."}]}, "streamlit.caption": {"name": "caption", "signature": "st.caption(body)", "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in small font.", "args": [{"name": "body", "type_name": "str", "is_optional": false, "description": "The text to display.
\n", "default": null}]}, "streamlit.checkbox": {"name": "checkbox", "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "streamlit.code": {"name": "code", "signature": "st.code(body, language=\"python\")", "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a code block with optional syntax highlighting.", "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", "default": null}]}, "streamlit.color_picker": {"name": "color_picker", "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "streamlit.columns": {"name": "columns", "signature": "st.columns(spec)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor 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}]}, "streamlit.container": {"name": "container", "signature": "st.container()", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "streamlit.dataframe": {"name": "dataframe", "signature": "st.dataframe(data=None, width=None, height=None)", "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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.
\nIf '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 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 UI element expressed in pixels. If None, a\ndefault height is used.
\n", "default": "height"}]}, "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)", "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "streamlit.echo": {"name": "echo", "signature": "st.echo(code_location=\"above\")", "example": "\n\n>>> with 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}]}, "streamlit.empty": {"name": "empty", "signature": "st.empty()", "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n", "description": "Insert a single-element container.", "args": []}, "streamlit.error": {"name": "error", "signature": "st.error(body)", "example": "\n\n>>> st.error('This is an error')\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}]}, "streamlit.exception": {"name": "exception", "signature": "st.exception(exception)", "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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}]}, "streamlit.expander": {"name": "expander", "signature": "st.expander(label, expanded=False)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "streamlit.experimental_get_query_params": {"name": "experimental_get_query_params", "signature": "st.experimental_get_query_params()", "example": "\nLet'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\n>>> st.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\nNote 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": []}, "streamlit.experimental_rerun": {"name": "experimental_rerun", "signature": "st.experimental_rerun()", "description": "Rerun the script immediately.", "args": []}, "streamlit.experimental_set_query_params": {"name": "experimental_set_query_params", "signature": "st.experimental_set_query_params(**query_params)", "example": "\nTo 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\n>>> st.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}]}, "streamlit.experimental_show": {"name": "experimental_show", "signature": "st.experimental_show(*args)", "notes": "\nThis 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- When passing multiple arguments the inclusion of , or ) in a string
\n
\n \nargument may cause an error.
\n
\n", "example": "\n\n>>> dataframe = pd.DataFrame({\n... 'first column': [1, 2, 3, 4],\n... 'second column': [10, 20, 30, 40],\n... }))\n>>> st.experimental_show(dataframe)\n
\n
\n", "description": "Write arguments and *argument names* to your app for debugging purposes.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to debug in the App.
\n", "default": null}]}, "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)", "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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", "description": "Display a file uploader widget.", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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}]}, "streamlit.form": {"name": "form", "signature": "st.form(key, clear_on_submit=False)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n", "description": "Create a form that batches elements together with a \"Submit\" button.", "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"}]}, "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.", "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}]}, "streamlit.get_option": {"name": "get_option", "signature": "st.get_option(key)", "description": "Return the current value of a given Streamlit config option.", "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}]}, "streamlit.graphviz_chart": {"name": "graphviz_chart", "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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}]}, "streamlit.header": {"name": "header", "signature": "st.header(body, anchor=None)", "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "streamlit.help": {"name": "help", "signature": "st.help(obj)", "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n", "description": "Display object's doc string, nicely formatted.", "args": [{"name": "obj", "type_name": "Object", "is_optional": false, "description": "The object whose docstring should be displayed.
\n", "default": null}]}, "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"}]}, "streamlit.info": {"name": "info", "signature": "st.info(body)", "example": "\n\n>>> st.info('This is a purely informational message')\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}]}, "streamlit.json": {"name": "json", "signature": "st.json(body)", "example": "\n\n>>> st.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}]}, "streamlit.latex": {"name": "latex", "signature": "st.latex(body)", "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display mathematical expressions formatted as LaTeX.", "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}]}, "streamlit.line_chart": {"name": "line_chart", "signature": "st.line_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st._arrow_line_chart(chart_data)\n
\n
\n", "description": "Display a line chart.", "args": [{"name": "data", "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", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "streamlit.map": {"name": "map", "signature": "st.map(data=None, zoom=None, use_container_width=True)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a map with points on it.", "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}]}, "streamlit.markdown": {"name": "markdown", "signature": "st.markdown(body, unsafe_allow_html=False)", "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n", "default": null}]}, "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)", "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n", "description": "Display a multiselect widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this select widget 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 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": "[str] or None", "is_optional": false, "description": "List of default values.
\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 selectbox.
\n", "default": null}, {"name": "key", "type_name": "str", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "streamlit.plotly_chart": {"name": "plotly_chart", "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)", "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.", "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
\nSee 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://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}, {"name": "To show Plotly charts in Streamlit, call `st.plotly_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Plotly's `py.plot` or `py.iplot`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "streamlit.progress": {"name": "progress", "signature": "st.progress(value)", "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n", "default": null}]}, "streamlit.pydeck_chart": {"name": "pydeck_chart", "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)", "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.", "args": [{"name": "spec", "type_name": "pydeck.Deck or None", "is_optional": false, "description": "Object specifying the PyDeck chart to draw.
\n", "default": null}]}, "streamlit.pyplot": {"name": "pyplot", "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)", "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n", "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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}]}, "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)", "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n", "description": "Display a slider widget to select items from a list.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "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": "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "streamlit.set_option": {"name": "set_option", "signature": "st.set_option(key, value)", "description": "Set config option.", "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}]}, "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\")", "example": "\n>>> st.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... )\n
\n", "description": "Configures the default settings of the page.", "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"}]}, "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)", "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n", "description": "Display a slider widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this slider is for.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "streamlit.spinner": {"name": "spinner", "signature": "st.spinner(text=\"In progress...\")", "example": "\n\n>>> with st.spinner('Wait for it...'):\n>>> time.sleep(5)\n>>> st.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}]}, "streamlit.stop": {"name": "stop", "signature": "st.stop()", "example": "\n\n>>> name = st.text_input('Name')\n>>> if not name:\n>>> st.warning('Please input a name.')\n>>> st.stop()\n>>> st.success('Thank you for inputting a name.')\n
\n
\n", "description": "Stops execution immediately.", "args": []}, "streamlit.subheader": {"name": "subheader", "signature": "st.subheader(body, anchor=None)", "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "streamlit.success": {"name": "success", "signature": "st.success(body)", "example": "\n\n>>> st.success('This is a success message!')\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}]}, "streamlit.table": {"name": "table", "signature": "st.table(data=None)", "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a static table.", "args": [{"name": "data", "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", "default": null}]}, "streamlit.text": {"name": "text", "signature": "st.text(body)", "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "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)", "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n", "default": null}, {"name": "value", "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}, {"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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n", "default": null}, {"name": "value", "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}, {"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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be 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}]}, "streamlit.time_input": {"name": "time_input", "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "streamlit.title": {"name": "title", "signature": "st.title(body, anchor=None)", "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in title 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}]}, "streamlit.vega_lite_chart": {"name": "vega_lite_chart", "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, **kwargs)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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}]}, "streamlit.video": {"name": "video", "signature": "st.video(data, format=\"video/mp4\", start_time=0)", "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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}]}, "streamlit.warning": {"name": "warning", "signature": "st.warning(body)", "example": "\n\n>>> st.warning('This is a warning')\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}]}, "streamlit.write": {"name": "write", "signature": "st.write(*args, **kwargs)", "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Write arguments to the app.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n", "default": "False."}]}, "DeltaGenerator.add_rows": {"name": "add_rows", "signature": "element.add_rows(self, data=None, **kwargs)", "example": "\n\n>>> df1 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_table = st.table(df1)\n>>>\n>>> df2 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_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
\nYou 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...\n>>> my_chart = st.line_chart(df1)\n>>> my_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
\nAnd for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:
\n\n>>> my_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... }),\n>>> my_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": "**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}]}, "DeltaGenerator.altair_chart": {"name": "altair_chart", "signature": "element.altair_chart(self, altair_chart, use_container_width=False)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\nExamples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.
\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}]}, "DeltaGenerator.area_chart": {"name": "area_chart", "signature": "element.area_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n
\n", "description": "Display an area chart.", "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": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "DeltaGenerator.audio": {"name": "audio", "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0)", "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n", "default": "s"}]}, "DeltaGenerator.balloons": {"name": "balloons", "signature": "element.balloons(self)", "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n", "description": "Draw celebratory balloons.", "args": []}, "DeltaGenerator.bar_chart": {"name": "bar_chart", "signature": "element.bar_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n
\n", "description": "Display a bar chart.", "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": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "DeltaGenerator.beta_columns": {"name": "beta_columns", "signature": "element.beta_columns(*args, **kwargs)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor 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}]}, "DeltaGenerator.beta_container": {"name": "beta_container", "signature": "element.beta_container(*args, **kwargs)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "DeltaGenerator.beta_expander": {"name": "beta_expander", "signature": "element.beta_expander(*args, **kwargs)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "DeltaGenerator.bokeh_chart": {"name": "bokeh_chart", "signature": "element.bokeh_chart(self, figure, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.", "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}, {"name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Bokeh's `show`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "DeltaGenerator.button": {"name": "button", "signature": "element.button(self, label, key=None, help=None, on_click=None, args=None, kwargs=None)", "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type 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}]}, "DeltaGenerator.caption": {"name": "caption", "signature": "element.caption(self, body)", "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in small font.", "args": [{"name": "body", "type_name": "str", "is_optional": false, "description": "The text to display.
\n", "default": null}]}, "DeltaGenerator.checkbox": {"name": "checkbox", "signature": "element.checkbox(self, label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "DeltaGenerator.code": {"name": "code", "signature": "element.code(self, body, language=\"python\")", "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a code block with optional syntax highlighting.", "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", "default": null}]}, "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)", "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "DeltaGenerator.columns": {"name": "columns", "signature": "element.columns(self, spec)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor 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}]}, "DeltaGenerator.container": {"name": "container", "signature": "element.container(self)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "DeltaGenerator.dataframe": {"name": "dataframe", "signature": "element.dataframe(self, data=None, width=None, height=None)", "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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.
\nIf '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 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 UI element expressed in pixels. If None, a\ndefault height is used.
\n", "default": "height"}]}, "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)", "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "DeltaGenerator.empty": {"name": "empty", "signature": "element.empty(self)", "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n", "description": "Insert a single-element container.", "args": []}, "DeltaGenerator.error": {"name": "error", "signature": "element.error(self, body)", "example": "\n\n>>> st.error('This is an error')\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}]}, "DeltaGenerator.exception": {"name": "exception", "signature": "element.exception(self, exception)", "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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}]}, "DeltaGenerator.expander": {"name": "expander", "signature": "element.expander(self, label, expanded=False)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "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)", "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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", "description": "Display a file uploader widget.", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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}]}, "DeltaGenerator.form": {"name": "form", "signature": "element.form(self, key, clear_on_submit=False)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n", "description": "Create a form that batches elements together with a \"Submit\" button.", "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"}]}, "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.", "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}]}, "DeltaGenerator.graphviz_chart": {"name": "graphviz_chart", "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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}]}, "DeltaGenerator.header": {"name": "header", "signature": "element.header(self, body, anchor=None)", "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "DeltaGenerator.help": {"name": "help", "signature": "element.help(self, obj)", "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n", "description": "Display object's doc string, nicely formatted.", "args": [{"name": "obj", "type_name": "Object", "is_optional": false, "description": "The object whose docstring should be displayed.
\n", "default": null}]}, "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"}]}, "DeltaGenerator.info": {"name": "info", "signature": "element.info(self, body)", "example": "\n\n>>> st.info('This is a purely informational message')\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}]}, "DeltaGenerator.json": {"name": "json", "signature": "element.json(self, body)", "example": "\n\n>>> st.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}]}, "DeltaGenerator.latex": {"name": "latex", "signature": "element.latex(self, body)", "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display mathematical expressions formatted as LaTeX.", "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}]}, "DeltaGenerator.line_chart": {"name": "line_chart", "signature": "element.line_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st._arrow_line_chart(chart_data)\n
\n
\n", "description": "Display a line chart.", "args": [{"name": "data", "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", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "DeltaGenerator.map": {"name": "map", "signature": "element.map(self, data=None, zoom=None, use_container_width=True)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a map with points on it.", "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}]}, "DeltaGenerator.markdown": {"name": "markdown", "signature": "element.markdown(self, body, unsafe_allow_html=False)", "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n", "default": null}]}, "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)", "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n", "description": "Display a multiselect widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this select widget 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 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": "[str] or None", "is_optional": false, "description": "List of default values.
\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 selectbox.
\n", "default": null}, {"name": "key", "type_name": "str", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "DeltaGenerator.plotly_chart": {"name": "plotly_chart", "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)", "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.", "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
\nSee 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://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}, {"name": "To show Plotly charts in Streamlit, call `st.plotly_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Plotly's `py.plot` or `py.iplot`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "DeltaGenerator.progress": {"name": "progress", "signature": "element.progress(self, value)", "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n", "default": null}]}, "DeltaGenerator.pydeck_chart": {"name": "pydeck_chart", "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)", "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.", "args": [{"name": "spec", "type_name": "pydeck.Deck or None", "is_optional": false, "description": "Object specifying the PyDeck chart to draw.
\n", "default": null}]}, "DeltaGenerator.pyplot": {"name": "pyplot", "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)", "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n", "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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}]}, "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)", "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n", "description": "Display a slider widget to select items from a list.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "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": "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n", "description": "Display a slider widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this slider is for.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "DeltaGenerator.subheader": {"name": "subheader", "signature": "element.subheader(self, body, anchor=None)", "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "DeltaGenerator.success": {"name": "success", "signature": "element.success(self, body)", "example": "\n\n>>> st.success('This is a success message!')\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}]}, "DeltaGenerator.table": {"name": "table", "signature": "element.table(self, data=None)", "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a static table.", "args": [{"name": "data", "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", "default": null}]}, "DeltaGenerator.text": {"name": "text", "signature": "element.text(self, body)", "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "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)", "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n", "default": null}, {"name": "value", "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}, {"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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n", "default": null}, {"name": "value", "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}, {"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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be 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}]}, "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)", "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "DeltaGenerator.title": {"name": "title", "signature": "element.title(self, body, anchor=None)", "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in title 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}]}, "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\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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}]}, "DeltaGenerator.video": {"name": "video", "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)", "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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}]}, "DeltaGenerator.warning": {"name": "warning", "signature": "element.warning(self, body)", "example": "\n\n>>> st.warning('This is a warning')\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}]}, "DeltaGenerator.write": {"name": "write", "signature": "element.write(self, *args, **kwargs)", "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Write arguments to the app.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n", "default": "False."}]}}, "0.87.0": {"streamlit.altair_chart": {"name": "altair_chart", "signature": "st.altair_chart(altair_chart, use_container_width=False)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\nExamples 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}]}, "streamlit.area_chart": {"name": "area_chart", "signature": "st.area_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display an area chart.", "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": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "streamlit.audio": {"name": "audio", "signature": "st.audio(data, format=\"audio/wav\", start_time=0)", "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n", "default": "s"}]}, "streamlit.balloons": {"name": "balloons", "signature": "st.balloons()", "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n", "description": "Draw celebratory balloons.", "args": []}, "streamlit.bar_chart": {"name": "bar_chart", "signature": "st.bar_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a bar chart.", "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": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "streamlit.beta_columns": {"name": "beta_columns", "signature": "st.beta_columns(*args, **kwargs)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor 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}]}, "streamlit.beta_container": {"name": "beta_container", "signature": "st.beta_container(*args, **kwargs)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "streamlit.beta_expander": {"name": "beta_expander", "signature": "st.beta_expander(*args, **kwargs)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "streamlit.bokeh_chart": {"name": "bokeh_chart", "signature": "st.bokeh_chart(figure, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.", "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}, {"name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Bokeh's `show`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "streamlit.button": {"name": "button", "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None)", "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type 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}]}, "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\n... def fetch_and_clean_data(url):\n... # Fetch data from URL here, and then clean it up.\n... return data\n...\n>>> d1 = fetch_and_clean_data(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> d2 = 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>>>\n>>> d3 = fetch_and_clean_data(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nTo 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
\nTo 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
\nTo 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
\nAlternatively, 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", "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 normally shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.
\nIf 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 functions 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."}]}, "streamlit.caption": {"name": "caption", "signature": "st.caption(body)", "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in small font.", "args": [{"name": "body", "type_name": "str", "is_optional": false, "description": "The text to display.
\n", "default": null}]}, "streamlit.checkbox": {"name": "checkbox", "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "streamlit.code": {"name": "code", "signature": "st.code(body, language=\"python\")", "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a code block with optional syntax highlighting.", "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", "default": null}]}, "streamlit.color_picker": {"name": "color_picker", "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "streamlit.columns": {"name": "columns", "signature": "st.columns(spec)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor 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}]}, "streamlit.container": {"name": "container", "signature": "st.container()", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "streamlit.dataframe": {"name": "dataframe", "signature": "st.dataframe(data=None, width=None, height=None)", "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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.
\nIf '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 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 UI element expressed in pixels. If None, a\ndefault height is used.
\n", "default": "height"}]}, "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)", "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "streamlit.echo": {"name": "echo", "signature": "st.echo(code_location=\"above\")", "example": "\n\n>>> with 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}]}, "streamlit.empty": {"name": "empty", "signature": "st.empty()", "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n", "description": "Insert a single-element container.", "args": []}, "streamlit.error": {"name": "error", "signature": "st.error(body)", "example": "\n\n>>> st.error('This is an error')\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}]}, "streamlit.exception": {"name": "exception", "signature": "st.exception(exception)", "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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}]}, "streamlit.expander": {"name": "expander", "signature": "st.expander(label, expanded=False)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "streamlit.experimental_get_query_params": {"name": "experimental_get_query_params", "signature": "st.experimental_get_query_params()", "example": "\nLet'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\n>>> st.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\nNote 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": []}, "streamlit.experimental_rerun": {"name": "experimental_rerun", "signature": "st.experimental_rerun()", "description": "Rerun the script immediately.", "args": []}, "streamlit.experimental_set_query_params": {"name": "experimental_set_query_params", "signature": "st.experimental_set_query_params(**query_params)", "example": "\nTo 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\n>>> st.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}]}, "streamlit.experimental_show": {"name": "experimental_show", "signature": "st.experimental_show(*args)", "notes": "\nThis 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- When passing multiple arguments the inclusion of , or ) in a string
\n
\n \nargument may cause an error.
\n
\n", "example": "\n\n>>> dataframe = pd.DataFrame({\n... 'first column': [1, 2, 3, 4],\n... 'second column': [10, 20, 30, 40],\n... }))\n>>> st.experimental_show(dataframe)\n
\n
\n", "description": "Write arguments and *argument names* to your app for debugging purposes.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to debug in the App.
\n", "default": null}]}, "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)", "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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", "description": "Display a file uploader widget.", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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}]}, "streamlit.form": {"name": "form", "signature": "st.form(key, clear_on_submit=False)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n", "description": "Create a form that batches elements together with a \"Submit\" button.", "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"}]}, "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.", "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}]}, "streamlit.get_option": {"name": "get_option", "signature": "st.get_option(key)", "description": "Return the current value of a given Streamlit config option.", "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}]}, "streamlit.graphviz_chart": {"name": "graphviz_chart", "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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}]}, "streamlit.header": {"name": "header", "signature": "st.header(body, anchor=None)", "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "streamlit.help": {"name": "help", "signature": "st.help(obj)", "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n", "description": "Display object's doc string, nicely formatted.", "args": [{"name": "obj", "type_name": "Object", "is_optional": false, "description": "The object whose docstring should be displayed.
\n", "default": null}]}, "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"}]}, "streamlit.info": {"name": "info", "signature": "st.info(body)", "example": "\n\n>>> st.info('This is a purely informational message')\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}]}, "streamlit.json": {"name": "json", "signature": "st.json(body)", "example": "\n\n>>> st.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}]}, "streamlit.latex": {"name": "latex", "signature": "st.latex(body)", "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display mathematical expressions formatted as LaTeX.", "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}]}, "streamlit.line_chart": {"name": "line_chart", "signature": "st.line_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a line chart.", "args": [{"name": "data", "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", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "streamlit.map": {"name": "map", "signature": "st.map(data=None, zoom=None, use_container_width=True)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a map with points on it.", "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}]}, "streamlit.markdown": {"name": "markdown", "signature": "st.markdown(body, unsafe_allow_html=False)", "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n", "default": null}]}, "streamlit.metric": {"name": "metric", "signature": "st.metric(label, value, delta=None, delta_color=\"normal\")", "example": "\n\n>>> st.metric(label="Active developers", value=123, delta=123,\n... delta_color="off") # arrow up, gray\n
\n
\n", "description": "Display a metric in big bold font, with an optional indicator of how the metric changed.", "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}]}, "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)", "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n", "description": "Display a multiselect widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this select widget 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 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": "[str] or None", "is_optional": false, "description": "List of default values.
\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 selectbox.
\n", "default": null}, {"name": "key", "type_name": "str", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "streamlit.plotly_chart": {"name": "plotly_chart", "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)", "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.", "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
\nSee 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://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}, {"name": "To show Plotly charts in Streamlit, call `st.plotly_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Plotly's `py.plot` or `py.iplot`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "streamlit.progress": {"name": "progress", "signature": "st.progress(value)", "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n", "default": null}]}, "streamlit.pydeck_chart": {"name": "pydeck_chart", "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)", "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.", "args": [{"name": "spec", "type_name": "pydeck.Deck or None", "is_optional": false, "description": "Object specifying the PyDeck chart to draw.
\n", "default": null}]}, "streamlit.pyplot": {"name": "pyplot", "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)", "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n", "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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}]}, "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)", "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n", "description": "Display a slider widget to select items from a list.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "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": "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "streamlit.set_option": {"name": "set_option", "signature": "st.set_option(key, value)", "description": "Set config option.", "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}]}, "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\")", "example": "\n>>> st.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... )\n
\n", "description": "Configures the default settings of the page.", "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"}]}, "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)", "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n", "description": "Display a slider widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this slider is for.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "streamlit.spinner": {"name": "spinner", "signature": "st.spinner(text=\"In progress...\")", "example": "\n\n>>> with st.spinner('Wait for it...'):\n>>> time.sleep(5)\n>>> st.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}]}, "streamlit.stop": {"name": "stop", "signature": "st.stop()", "example": "\n\n>>> name = st.text_input('Name')\n>>> if not name:\n>>> st.warning('Please input a name.')\n>>> st.stop()\n>>> st.success('Thank you for inputting a name.')\n
\n
\n", "description": "Stops execution immediately.", "args": []}, "streamlit.subheader": {"name": "subheader", "signature": "st.subheader(body, anchor=None)", "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "streamlit.success": {"name": "success", "signature": "st.success(body)", "example": "\n\n>>> st.success('This is a success message!')\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}]}, "streamlit.table": {"name": "table", "signature": "st.table(data=None)", "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a static table.", "args": [{"name": "data", "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", "default": null}]}, "streamlit.text": {"name": "text", "signature": "st.text(body)", "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "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)", "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n", "default": null}, {"name": "value", "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}, {"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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n", "default": null}, {"name": "value", "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}, {"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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be 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}]}, "streamlit.time_input": {"name": "time_input", "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "streamlit.title": {"name": "title", "signature": "st.title(body, anchor=None)", "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in title 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}]}, "streamlit.vega_lite_chart": {"name": "vega_lite_chart", "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, **kwargs)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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}]}, "streamlit.video": {"name": "video", "signature": "st.video(data, format=\"video/mp4\", start_time=0)", "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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}]}, "streamlit.warning": {"name": "warning", "signature": "st.warning(body)", "example": "\n\n>>> st.warning('This is a warning')\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}]}, "streamlit.write": {"name": "write", "signature": "st.write(*args, **kwargs)", "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Write arguments to the app.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n", "default": "False."}]}, "DeltaGenerator.add_rows": {"name": "add_rows", "signature": "element.add_rows(self, data=None, **kwargs)", "example": "\n\n>>> df1 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_table = st.table(df1)\n>>>\n>>> df2 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_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
\nYou 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...\n>>> my_chart = st.line_chart(df1)\n>>> my_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
\nAnd for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:
\n\n>>> my_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... }),\n>>> my_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": "**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}]}, "DeltaGenerator.altair_chart": {"name": "altair_chart", "signature": "element.altair_chart(self, altair_chart, use_container_width=False)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\nExamples 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}]}, "DeltaGenerator.area_chart": {"name": "area_chart", "signature": "element.area_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display an area chart.", "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": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "DeltaGenerator.audio": {"name": "audio", "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0)", "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n", "default": "s"}]}, "DeltaGenerator.balloons": {"name": "balloons", "signature": "element.balloons(self)", "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n", "description": "Draw celebratory balloons.", "args": []}, "DeltaGenerator.bar_chart": {"name": "bar_chart", "signature": "element.bar_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a bar chart.", "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": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "DeltaGenerator.beta_columns": {"name": "beta_columns", "signature": "element.beta_columns(*args, **kwargs)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor 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}]}, "DeltaGenerator.beta_container": {"name": "beta_container", "signature": "element.beta_container(*args, **kwargs)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "DeltaGenerator.beta_expander": {"name": "beta_expander", "signature": "element.beta_expander(*args, **kwargs)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "DeltaGenerator.bokeh_chart": {"name": "bokeh_chart", "signature": "element.bokeh_chart(self, figure, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.", "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}, {"name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Bokeh's `show`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "DeltaGenerator.button": {"name": "button", "signature": "element.button(self, label, key=None, help=None, on_click=None, args=None, kwargs=None)", "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type 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}]}, "DeltaGenerator.caption": {"name": "caption", "signature": "element.caption(self, body)", "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in small font.", "args": [{"name": "body", "type_name": "str", "is_optional": false, "description": "The text to display.
\n", "default": null}]}, "DeltaGenerator.checkbox": {"name": "checkbox", "signature": "element.checkbox(self, label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "DeltaGenerator.code": {"name": "code", "signature": "element.code(self, body, language=\"python\")", "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a code block with optional syntax highlighting.", "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", "default": null}]}, "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)", "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "DeltaGenerator.columns": {"name": "columns", "signature": "element.columns(self, spec)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor 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}]}, "DeltaGenerator.container": {"name": "container", "signature": "element.container(self)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "DeltaGenerator.dataframe": {"name": "dataframe", "signature": "element.dataframe(self, data=None, width=None, height=None)", "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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.
\nIf '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 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 UI element expressed in pixels. If None, a\ndefault height is used.
\n", "default": "height"}]}, "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)", "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "DeltaGenerator.determine_delta_color_and_direction": {"name": "determine_delta_color_and_direction", "signature": "element.determine_delta_color_and_direction(self, delta_color, delta)"}, "DeltaGenerator.empty": {"name": "empty", "signature": "element.empty(self)", "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n", "description": "Insert a single-element container.", "args": []}, "DeltaGenerator.error": {"name": "error", "signature": "element.error(self, body)", "example": "\n\n>>> st.error('This is an error')\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}]}, "DeltaGenerator.exception": {"name": "exception", "signature": "element.exception(self, exception)", "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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}]}, "DeltaGenerator.expander": {"name": "expander", "signature": "element.expander(self, label, expanded=False)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "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)", "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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", "description": "Display a file uploader widget.", "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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}]}, "DeltaGenerator.form": {"name": "form", "signature": "element.form(self, key, clear_on_submit=False)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n", "description": "Create a form that batches elements together with a \"Submit\" button.", "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"}]}, "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.", "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}]}, "DeltaGenerator.graphviz_chart": {"name": "graphviz_chart", "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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}]}, "DeltaGenerator.header": {"name": "header", "signature": "element.header(self, body, anchor=None)", "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "DeltaGenerator.help": {"name": "help", "signature": "element.help(self, obj)", "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n", "description": "Display object's doc string, nicely formatted.", "args": [{"name": "obj", "type_name": "Object", "is_optional": false, "description": "The object whose docstring should be displayed.
\n", "default": null}]}, "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"}]}, "DeltaGenerator.info": {"name": "info", "signature": "element.info(self, body)", "example": "\n\n>>> st.info('This is a purely informational message')\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}]}, "DeltaGenerator.is_negative": {"name": "is_negative", "signature": "element.is_negative(self, delta)"}, "DeltaGenerator.json": {"name": "json", "signature": "element.json(self, body)", "example": "\n\n>>> st.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}]}, "DeltaGenerator.latex": {"name": "latex", "signature": "element.latex(self, body)", "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display mathematical expressions formatted as LaTeX.", "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}]}, "DeltaGenerator.line_chart": {"name": "line_chart", "signature": "element.line_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a line chart.", "args": [{"name": "data", "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", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "DeltaGenerator.map": {"name": "map", "signature": "element.map(self, data=None, zoom=None, use_container_width=True)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a map with points on it.", "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}]}, "DeltaGenerator.markdown": {"name": "markdown", "signature": "element.markdown(self, body, unsafe_allow_html=False)", "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n", "default": null}]}, "DeltaGenerator.metric": {"name": "metric", "signature": "element.metric(self, label, value, delta=None, delta_color=\"normal\")", "example": "\n\n>>> st.metric(label="Active developers", value=123, delta=123,\n... delta_color="off") # arrow up, gray\n
\n
\n", "description": "Display a metric in big bold font, with an optional indicator of how the metric changed.", "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}]}, "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)", "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n", "description": "Display a multiselect widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this select widget 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 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": "[str] or None", "is_optional": false, "description": "List of default values.
\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 selectbox.
\n", "default": null}, {"name": "key", "type_name": "str", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "DeltaGenerator.parse_delta": {"name": "parse_delta", "signature": "element.parse_delta(self, delta)"}, "DeltaGenerator.parse_label": {"name": "parse_label", "signature": "element.parse_label(self, label)"}, "DeltaGenerator.parse_value": {"name": "parse_value", "signature": "element.parse_value(self, value)"}, "DeltaGenerator.plotly_chart": {"name": "plotly_chart", "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)", "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.", "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
\nSee 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://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}, {"name": "To show Plotly charts in Streamlit, call `st.plotly_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Plotly's `py.plot` or `py.iplot`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "DeltaGenerator.progress": {"name": "progress", "signature": "element.progress(self, value)", "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n", "default": null}]}, "DeltaGenerator.pydeck_chart": {"name": "pydeck_chart", "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)", "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.", "args": [{"name": "spec", "type_name": "pydeck.Deck or None", "is_optional": false, "description": "Object specifying the PyDeck chart to draw.
\n", "default": null}]}, "DeltaGenerator.pyplot": {"name": "pyplot", "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)", "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n", "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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}]}, "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)", "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n", "description": "Display a slider widget to select items from a list.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "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": "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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n", "description": "Display a slider widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this slider is for.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "DeltaGenerator.subheader": {"name": "subheader", "signature": "element.subheader(self, body, anchor=None)", "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "DeltaGenerator.success": {"name": "success", "signature": "element.success(self, body)", "example": "\n\n>>> st.success('This is a success message!')\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}]}, "DeltaGenerator.table": {"name": "table", "signature": "element.table(self, data=None)", "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a static table.", "args": [{"name": "data", "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", "default": null}]}, "DeltaGenerator.text": {"name": "text", "signature": "element.text(self, body)", "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "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)", "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n", "default": null}, {"name": "value", "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}, {"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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n", "default": null}, {"name": "value", "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}, {"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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be 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}]}, "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)", "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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", "is_optional": false, "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "DeltaGenerator.title": {"name": "title", "signature": "element.title(self, body, anchor=None)", "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in title 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}]}, "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\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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}]}, "DeltaGenerator.video": {"name": "video", "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)", "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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}]}, "DeltaGenerator.warning": {"name": "warning", "signature": "element.warning(self, body)", "example": "\n\n>>> st.warning('This is a warning')\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}]}, "DeltaGenerator.write": {"name": "write", "signature": "element.write(self, *args, **kwargs)", "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Write arguments to the app.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n", "default": "False."}]}}, "0.88.0": {"streamlit.altair_chart": {"name": "altair_chart", "signature": "st.altair_chart(altair_chart, use_container_width=False)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\nExamples 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}]}, "streamlit.area_chart": {"name": "area_chart", "signature": "st.area_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display an area chart.", "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": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "streamlit.audio": {"name": "audio", "signature": "st.audio(data, format=\"audio/wav\", start_time=0)", "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n", "default": "s"}]}, "streamlit.balloons": {"name": "balloons", "signature": "st.balloons()", "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n", "description": "Draw celebratory balloons.", "args": []}, "streamlit.bar_chart": {"name": "bar_chart", "signature": "st.bar_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a bar chart.", "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": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "streamlit.beta_columns": {"name": "beta_columns", "signature": "st.beta_columns(*args, **kwargs)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor 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}]}, "streamlit.beta_container": {"name": "beta_container", "signature": "st.beta_container(*args, **kwargs)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "streamlit.beta_expander": {"name": "beta_expander", "signature": "st.beta_expander(*args, **kwargs)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "streamlit.bokeh_chart": {"name": "bokeh_chart", "signature": "st.bokeh_chart(figure, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.", "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}, {"name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Bokeh's `show`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "streamlit.button": {"name": "button", "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None)", "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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}]}, "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\n... def fetch_and_clean_data(url):\n... # Fetch data from URL here, and then clean it up.\n... return data\n...\n>>> d1 = fetch_and_clean_data(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> d2 = 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>>>\n>>> d3 = fetch_and_clean_data(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nTo 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
\nTo 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
\nTo 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
\nAlternatively, 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", "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 normally shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.
\nIf 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 functions 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."}]}, "streamlit.caption": {"name": "caption", "signature": "st.caption(body)", "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in small font.", "args": [{"name": "body", "type_name": "str", "is_optional": false, "description": "The text to display.
\n", "default": null}]}, "streamlit.checkbox": {"name": "checkbox", "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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}]}, "streamlit.code": {"name": "code", "signature": "st.code(body, language=\"python\")", "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a code block with optional syntax highlighting.", "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", "default": null}]}, "streamlit.color_picker": {"name": "color_picker", "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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}]}, "streamlit.columns": {"name": "columns", "signature": "st.columns(spec)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor 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}]}, "streamlit.container": {"name": "container", "signature": "st.container()", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "streamlit.dataframe": {"name": "dataframe", "signature": "st.dataframe(data=None, width=None, height=None)", "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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.
\nIf '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 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 UI element expressed in pixels. If None, a\ndefault height is used.
\n", "default": "height"}]}, "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)", "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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}]}, "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)", "examples": "\nWhile download button can be used to download arbitrary files, here are\nsome common use-cases to get you started.
\nDownload a large DataFrame:
\n\n>>> @st.cache\n... def convert_df(df):\n... # Cache the conversion to prevent computation on every rerun\n... return df.to_csv().encode('utf-8')\n>>> csv = convert_df(my_large_df)\n>>> st.download_button(\n... label="Press to Download",\n... data=csv,\n... file_name='large_df.csv',\n... mime='text/csv',\n... )\n
\nDownload a CSV file:
\n\n>>> text_contents = '''\n... Col1, Col2\n... 123, 456\n... 789, 000\n... '''\n>>> st.download_button(\n... label='Download CSV', data=text_contents,\n... file_name='file.csv', mime='text/csv'\n... )\n
\nDownload a binary file:
\n\n>>> binary_contents = b'example content'\n... # Defaults to 'application/octet-stream'\n>>> st.download_button('Download binary file', binary_contents)\n
\nDownload an image:
\n\n>>> with 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", "description": "Display a download button widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to 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.
\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,\neg. 'my_file.csv'. If file name is not specified, then we provide\na generic name for the download.
\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" or\n"application/octet-stream" depending on the data type.
\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}]}, "streamlit.echo": {"name": "echo", "signature": "st.echo(code_location=\"above\")", "example": "\n\n>>> with 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}]}, "streamlit.empty": {"name": "empty", "signature": "st.empty()", "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n", "description": "Insert a single-element container.", "args": []}, "streamlit.error": {"name": "error", "signature": "st.error(body)", "example": "\n\n>>> st.error('This is an error')\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}]}, "streamlit.exception": {"name": "exception", "signature": "st.exception(exception)", "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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}]}, "streamlit.expander": {"name": "expander", "signature": "st.expander(label, expanded=False)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "streamlit.experimental_get_query_params": {"name": "experimental_get_query_params", "signature": "st.experimental_get_query_params()", "example": "\nLet'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\n>>> st.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\nNote 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": []}, "streamlit.experimental_rerun": {"name": "experimental_rerun", "signature": "st.experimental_rerun()", "description": "Rerun the script immediately.", "args": []}, "streamlit.experimental_set_query_params": {"name": "experimental_set_query_params", "signature": "st.experimental_set_query_params(**query_params)", "example": "\nTo 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\n>>> st.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}]}, "streamlit.experimental_show": {"name": "experimental_show", "signature": "st.experimental_show(*args)", "notes": "\nThis 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- When passing multiple arguments the inclusion of , or ) in a string
\n
\n \nargument may cause an error.
\n
\n", "example": "\n\n>>> dataframe = pd.DataFrame({\n... 'first column': [1, 2, 3, 4],\n... 'second column': [10, 20, 30, 40],\n... }))\n>>> st.experimental_show(dataframe)\n
\n
\n", "description": "Write arguments and *argument names* to your app for debugging purposes.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to debug in the App.
\n", "default": null}]}, "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)", "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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", "description": "Display a file uploader widget.", "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", "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}]}, "streamlit.form": {"name": "form", "signature": "st.form(key, clear_on_submit=False)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n", "description": "Create a form that batches elements together with a \"Submit\" button.", "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"}]}, "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.", "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}]}, "streamlit.get_option": {"name": "get_option", "signature": "st.get_option(key)", "description": "Return the current value of a given Streamlit config option.", "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}]}, "streamlit.graphviz_chart": {"name": "graphviz_chart", "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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}]}, "streamlit.header": {"name": "header", "signature": "st.header(body, anchor=None)", "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "streamlit.help": {"name": "help", "signature": "st.help(obj)", "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n", "description": "Display object's doc string, nicely formatted.", "args": [{"name": "obj", "type_name": "Object", "is_optional": false, "description": "The object whose docstring should be displayed.
\n", "default": null}]}, "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"}]}, "streamlit.info": {"name": "info", "signature": "st.info(body)", "example": "\n\n>>> st.info('This is a purely informational message')\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}]}, "streamlit.json": {"name": "json", "signature": "st.json(body)", "example": "\n\n>>> st.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}]}, "streamlit.latex": {"name": "latex", "signature": "st.latex(body)", "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display mathematical expressions formatted as LaTeX.", "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}]}, "streamlit.line_chart": {"name": "line_chart", "signature": "st.line_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a line chart.", "args": [{"name": "data", "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", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "streamlit.map": {"name": "map", "signature": "st.map(data=None, zoom=None, use_container_width=True)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a map with points on it.", "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}]}, "streamlit.markdown": {"name": "markdown", "signature": "st.markdown(body, unsafe_allow_html=False)", "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n", "default": null}]}, "streamlit.metric": {"name": "metric", "signature": "st.metric(label, value, delta=None, delta_color=\"normal\")", "example": "\n\n>>> st.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\n>>> col1, col2, col3 = st.columns(3)\n>>> col1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\n>>> col2.metric("Wind", "9 mph", "-8%")\n>>> col3.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\n>>> st.metric(label="Gas price", value=4, delta=-0.5,\n... delta_color="inverse")\n>>>\n>>> st.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.", "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}]}, "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)", "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n", "description": "Display a multiselect widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this select widget 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 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": "[str] or None", "is_optional": false, "description": "List of default values.
\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 selectbox.
\n", "default": null}, {"name": "key", "type_name": "str or int", "is_optional": false, "description": "An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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}]}, "streamlit.plotly_chart": {"name": "plotly_chart", "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)", "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.", "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
\nSee 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://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}, {"name": "To show Plotly charts in Streamlit, call `st.plotly_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Plotly's `py.plot` or `py.iplot`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "streamlit.progress": {"name": "progress", "signature": "st.progress(value)", "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n", "default": null}]}, "streamlit.pydeck_chart": {"name": "pydeck_chart", "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)", "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.", "args": [{"name": "spec", "type_name": "pydeck.Deck or None", "is_optional": false, "description": "Object specifying the PyDeck chart to draw.
\n", "default": null}]}, "streamlit.pyplot": {"name": "pyplot", "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)", "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n", "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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}]}, "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)", "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\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}]}, "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)", "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n", "description": "Display a slider widget to select items from a list.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "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": "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}]}, "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)", "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\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}]}, "streamlit.set_option": {"name": "set_option", "signature": "st.set_option(key, value)", "description": "Set config option.", "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}]}, "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\")", "example": "\n>>> st.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... )\n
\n", "description": "Configures the default settings of the page.", "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"}]}, "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)", "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n", "description": "Display a slider widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this slider is for.
\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}]}, "streamlit.spinner": {"name": "spinner", "signature": "st.spinner(text=\"In progress...\")", "example": "\n\n>>> with st.spinner('Wait for it...'):\n>>> time.sleep(5)\n>>> st.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}]}, "streamlit.stop": {"name": "stop", "signature": "st.stop()", "example": "\n\n>>> name = st.text_input('Name')\n>>> if not name:\n>>> st.warning('Please input a name.')\n>>> st.stop()\n>>> st.success('Thank you for inputting a name.')\n
\n
\n", "description": "Stops execution immediately.", "args": []}, "streamlit.subheader": {"name": "subheader", "signature": "st.subheader(body, anchor=None)", "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "streamlit.success": {"name": "success", "signature": "st.success(body)", "example": "\n\n>>> st.success('This is a success message!')\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}]}, "streamlit.table": {"name": "table", "signature": "st.table(data=None)", "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a static table.", "args": [{"name": "data", "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", "default": null}]}, "streamlit.text": {"name": "text", "signature": "st.text(body)", "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "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)", "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n", "default": null}, {"name": "value", "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}, {"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}]}, "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)", "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n", "default": null}, {"name": "value", "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}, {"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}]}, "streamlit.time_input": {"name": "time_input", "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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}]}, "streamlit.title": {"name": "title", "signature": "st.title(body, anchor=None)", "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in title 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}]}, "streamlit.vega_lite_chart": {"name": "vega_lite_chart", "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, **kwargs)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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}]}, "streamlit.video": {"name": "video", "signature": "st.video(data, format=\"video/mp4\", start_time=0)", "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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}]}, "streamlit.warning": {"name": "warning", "signature": "st.warning(body)", "example": "\n\n>>> st.warning('This is a warning')\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}]}, "streamlit.write": {"name": "write", "signature": "st.write(*args, **kwargs)", "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Write arguments to the app.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n", "default": "False."}]}, "DeltaGenerator.add_rows": {"name": "add_rows", "signature": "element.add_rows(self, data=None, **kwargs)", "example": "\n\n>>> df1 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_table = st.table(df1)\n>>>\n>>> df2 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_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
\nYou 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...\n>>> my_chart = st.line_chart(df1)\n>>> my_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
\nAnd for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:
\n\n>>> my_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... }),\n>>> my_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": "**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}]}, "DeltaGenerator.altair_chart": {"name": "altair_chart", "signature": "element.altair_chart(self, altair_chart, use_container_width=False)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\nExamples 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}]}, "DeltaGenerator.area_chart": {"name": "area_chart", "signature": "element.area_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display an area chart.", "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": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "DeltaGenerator.audio": {"name": "audio", "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0)", "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n", "default": "s"}]}, "DeltaGenerator.balloons": {"name": "balloons", "signature": "element.balloons(self)", "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n", "description": "Draw celebratory balloons.", "args": []}, "DeltaGenerator.bar_chart": {"name": "bar_chart", "signature": "element.bar_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a bar chart.", "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": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "DeltaGenerator.beta_columns": {"name": "beta_columns", "signature": "element.beta_columns(*args, **kwargs)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor 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}]}, "DeltaGenerator.beta_container": {"name": "beta_container", "signature": "element.beta_container(*args, **kwargs)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "DeltaGenerator.beta_expander": {"name": "beta_expander", "signature": "element.beta_expander(*args, **kwargs)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "DeltaGenerator.bokeh_chart": {"name": "bokeh_chart", "signature": "element.bokeh_chart(self, figure, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.", "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}, {"name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Bokeh's `show`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "DeltaGenerator.button": {"name": "button", "signature": "element.button(self, label, key=None, help=None, on_click=None, args=None, kwargs=None)", "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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}]}, "DeltaGenerator.caption": {"name": "caption", "signature": "element.caption(self, body)", "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in small font.", "args": [{"name": "body", "type_name": "str", "is_optional": false, "description": "The text to display.
\n", "default": null}]}, "DeltaGenerator.checkbox": {"name": "checkbox", "signature": "element.checkbox(self, label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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}]}, "DeltaGenerator.code": {"name": "code", "signature": "element.code(self, body, language=\"python\")", "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a code block with optional syntax highlighting.", "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", "default": null}]}, "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)", "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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}]}, "DeltaGenerator.columns": {"name": "columns", "signature": "element.columns(self, spec)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor 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}]}, "DeltaGenerator.container": {"name": "container", "signature": "element.container(self)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "DeltaGenerator.dataframe": {"name": "dataframe", "signature": "element.dataframe(self, data=None, width=None, height=None)", "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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.
\nIf '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 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 UI element expressed in pixels. If None, a\ndefault height is used.
\n", "default": "height"}]}, "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)", "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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}]}, "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)", "examples": "\nWhile download button can be used to download arbitrary files, here are\nsome common use-cases to get you started.
\nDownload a large DataFrame:
\n\n>>> @st.cache\n... def convert_df(df):\n... # Cache the conversion to prevent computation on every rerun\n... return df.to_csv().encode('utf-8')\n>>> csv = convert_df(my_large_df)\n>>> st.download_button(\n... label="Press to Download",\n... data=csv,\n... file_name='large_df.csv',\n... mime='text/csv',\n... )\n
\nDownload a CSV file:
\n\n>>> text_contents = '''\n... Col1, Col2\n... 123, 456\n... 789, 000\n... '''\n>>> st.download_button(\n... label='Download CSV', data=text_contents,\n... file_name='file.csv', mime='text/csv'\n... )\n
\nDownload a binary file:
\n\n>>> binary_contents = b'example content'\n... # Defaults to 'application/octet-stream'\n>>> st.download_button('Download binary file', binary_contents)\n
\nDownload an image:
\n\n>>> with 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", "description": "Display a download button widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to 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.
\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,\neg. 'my_file.csv'. If file name is not specified, then we provide\na generic name for the download.
\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" or\n"application/octet-stream" depending on the data type.
\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}]}, "DeltaGenerator.empty": {"name": "empty", "signature": "element.empty(self)", "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n", "description": "Insert a single-element container.", "args": []}, "DeltaGenerator.error": {"name": "error", "signature": "element.error(self, body)", "example": "\n\n>>> st.error('This is an error')\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}]}, "DeltaGenerator.exception": {"name": "exception", "signature": "element.exception(self, exception)", "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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}]}, "DeltaGenerator.expander": {"name": "expander", "signature": "element.expander(self, label, expanded=False)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "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)", "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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", "description": "Display a file uploader widget.", "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", "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}]}, "DeltaGenerator.form": {"name": "form", "signature": "element.form(self, key, clear_on_submit=False)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n", "description": "Create a form that batches elements together with a \"Submit\" button.", "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"}]}, "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.", "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}]}, "DeltaGenerator.graphviz_chart": {"name": "graphviz_chart", "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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}]}, "DeltaGenerator.header": {"name": "header", "signature": "element.header(self, body, anchor=None)", "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "DeltaGenerator.help": {"name": "help", "signature": "element.help(self, obj)", "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n", "description": "Display object's doc string, nicely formatted.", "args": [{"name": "obj", "type_name": "Object", "is_optional": false, "description": "The object whose docstring should be displayed.
\n", "default": null}]}, "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"}]}, "DeltaGenerator.info": {"name": "info", "signature": "element.info(self, body)", "example": "\n\n>>> st.info('This is a purely informational message')\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}]}, "DeltaGenerator.is_negative": {"name": "is_negative", "signature": "element.is_negative(self, delta)"}, "DeltaGenerator.json": {"name": "json", "signature": "element.json(self, body)", "example": "\n\n>>> st.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}]}, "DeltaGenerator.latex": {"name": "latex", "signature": "element.latex(self, body)", "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display mathematical expressions formatted as LaTeX.", "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}]}, "DeltaGenerator.line_chart": {"name": "line_chart", "signature": "element.line_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a line chart.", "args": [{"name": "data", "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", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "DeltaGenerator.map": {"name": "map", "signature": "element.map(self, data=None, zoom=None, use_container_width=True)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a map with points on it.", "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}]}, "DeltaGenerator.markdown": {"name": "markdown", "signature": "element.markdown(self, body, unsafe_allow_html=False)", "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n", "default": null}]}, "DeltaGenerator.metric": {"name": "metric", "signature": "element.metric(self, label, value, delta=None, delta_color=\"normal\")", "example": "\n\n>>> st.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\n>>> col1, col2, col3 = st.columns(3)\n>>> col1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\n>>> col2.metric("Wind", "9 mph", "-8%")\n>>> col3.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\n>>> st.metric(label="Gas price", value=4, delta=-0.5,\n... delta_color="inverse")\n>>>\n>>> st.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.", "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}]}, "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)", "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n", "description": "Display a multiselect widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this select widget 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 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": "[str] or None", "is_optional": false, "description": "List of default values.
\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 selectbox.
\n", "default": null}, {"name": "key", "type_name": "str or int", "is_optional": false, "description": "An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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}]}, "DeltaGenerator.parse_delta": {"name": "parse_delta", "signature": "element.parse_delta(self, delta)"}, "DeltaGenerator.parse_label": {"name": "parse_label", "signature": "element.parse_label(self, label)"}, "DeltaGenerator.parse_value": {"name": "parse_value", "signature": "element.parse_value(self, value)"}, "DeltaGenerator.plotly_chart": {"name": "plotly_chart", "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)", "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.", "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
\nSee 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://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}, {"name": "To show Plotly charts in Streamlit, call `st.plotly_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Plotly's `py.plot` or `py.iplot`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "DeltaGenerator.progress": {"name": "progress", "signature": "element.progress(self, value)", "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n", "default": null}]}, "DeltaGenerator.pydeck_chart": {"name": "pydeck_chart", "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)", "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.", "args": [{"name": "spec", "type_name": "pydeck.Deck or None", "is_optional": false, "description": "Object specifying the PyDeck chart to draw.
\n", "default": null}]}, "DeltaGenerator.pyplot": {"name": "pyplot", "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)", "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n", "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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}]}, "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)", "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\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}]}, "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)", "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n", "description": "Display a slider widget to select items from a list.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "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": "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}]}, "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)", "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\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}]}, "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)", "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n", "description": "Display a slider widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this slider is for.
\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}]}, "DeltaGenerator.subheader": {"name": "subheader", "signature": "element.subheader(self, body, anchor=None)", "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "DeltaGenerator.success": {"name": "success", "signature": "element.success(self, body)", "example": "\n\n>>> st.success('This is a success message!')\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}]}, "DeltaGenerator.table": {"name": "table", "signature": "element.table(self, data=None)", "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a static table.", "args": [{"name": "data", "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", "default": null}]}, "DeltaGenerator.text": {"name": "text", "signature": "element.text(self, body)", "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "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)", "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n", "default": null}, {"name": "value", "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}, {"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}]}, "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)", "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n", "default": null}, {"name": "value", "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}, {"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}]}, "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)", "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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}]}, "DeltaGenerator.title": {"name": "title", "signature": "element.title(self, body, anchor=None)", "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in title 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}]}, "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\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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}]}, "DeltaGenerator.video": {"name": "video", "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)", "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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}]}, "DeltaGenerator.warning": {"name": "warning", "signature": "element.warning(self, body)", "example": "\n\n>>> st.warning('This is a warning')\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}]}, "DeltaGenerator.write": {"name": "write", "signature": "element.write(self, *args, **kwargs)", "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Write arguments to the app.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n", "default": "False."}]}}, "0.89.0": {"streamlit.altair_chart": {"name": "altair_chart", "signature": "st.altair_chart(altair_chart, use_container_width=False)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\nExamples 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}]}, "streamlit.area_chart": {"name": "area_chart", "signature": "st.area_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display an area chart.", "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": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "streamlit.audio": {"name": "audio", "signature": "st.audio(data, format=\"audio/wav\", start_time=0)", "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n", "default": "s"}]}, "streamlit.balloons": {"name": "balloons", "signature": "st.balloons()", "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n", "description": "Draw celebratory balloons.", "args": []}, "streamlit.bar_chart": {"name": "bar_chart", "signature": "st.bar_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a bar chart.", "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": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "streamlit.beta_columns": {"name": "beta_columns", "signature": "st.beta_columns(*args, **kwargs)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor 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}]}, "streamlit.beta_container": {"name": "beta_container", "signature": "st.beta_container(*args, **kwargs)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "streamlit.beta_expander": {"name": "beta_expander", "signature": "st.beta_expander(*args, **kwargs)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "streamlit.bokeh_chart": {"name": "bokeh_chart", "signature": "st.bokeh_chart(figure, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.", "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}, {"name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Bokeh's `show`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "streamlit.button": {"name": "button", "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None)", "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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}]}, "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\n... def fetch_and_clean_data(url):\n... # Fetch data from URL here, and then clean it up.\n... return data\n...\n>>> d1 = fetch_and_clean_data(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> d2 = 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>>>\n>>> d3 = fetch_and_clean_data(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nTo 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
\nTo 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
\nTo 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
\nAlternatively, 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", "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 normally shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.
\nIf 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 functions 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."}]}, "streamlit.caption": {"name": "caption", "signature": "st.caption(body)", "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in small font.", "args": [{"name": "body", "type_name": "str", "is_optional": false, "description": "The text to display.
\n", "default": null}]}, "streamlit.checkbox": {"name": "checkbox", "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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}]}, "streamlit.code": {"name": "code", "signature": "st.code(body, language=\"python\")", "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a code block with optional syntax highlighting.", "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", "default": null}]}, "streamlit.color_picker": {"name": "color_picker", "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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}]}, "streamlit.columns": {"name": "columns", "signature": "st.columns(spec)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor 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}]}, "streamlit.container": {"name": "container", "signature": "st.container()", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "streamlit.dataframe": {"name": "dataframe", "signature": "st.dataframe(data=None, width=None, height=None)", "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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.
\nIf '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 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 UI element expressed in pixels. If None, a\ndefault height is used.
\n", "default": "height"}]}, "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)", "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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}]}, "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)", "examples": "\nDownload 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>>>\n>>> csv = convert_df(my_large_df)\n>>>\n>>> st.download_button(\n... label="Download data as CSV",\n... data=csv,\n... file_name='large_df.csv',\n... mime='text/csv',\n... )\n
\nDownload a string as a file:
\n\n>>> text_contents = '''This is some text'''\n>>> st.download_button('Download some text', text_contents)\n
\nDownload a binary file:
\n\n>>> binary_contents = b'example content'\n>>> # Defaults to 'application/octet-stream'\n>>> st.download_button('Download binary file', binary_contents)\n
\nDownload an image:
\n\n>>> with 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", "description": "Display a download 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": "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}]}, "streamlit.echo": {"name": "echo", "signature": "st.echo(code_location=\"above\")", "example": "\n\n>>> with 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}]}, "streamlit.empty": {"name": "empty", "signature": "st.empty()", "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n", "description": "Insert a single-element container.", "args": []}, "streamlit.error": {"name": "error", "signature": "st.error(body)", "example": "\n\n>>> st.error('This is an error')\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}]}, "streamlit.exception": {"name": "exception", "signature": "st.exception(exception)", "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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}]}, "streamlit.expander": {"name": "expander", "signature": "st.expander(label, expanded=False)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "streamlit.experimental_get_query_params": {"name": "experimental_get_query_params", "signature": "st.experimental_get_query_params()", "example": "\nLet'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\n>>> st.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\nNote 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": []}, "streamlit.experimental_memo": {"name": "memo", "signature": "st.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...\n>>> d1 = fetch_and_clean_data(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> d2 = 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>>>\n>>> d3 = fetch_and_clean_data(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nTo 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
\nBy 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...\n>>> connection = make_database_connection()\n>>> d1 = fetch_and_clean_data(connection, num_rows=10)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> another_connection = make_database_connection()\n>>> d2 = 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
\n", "description": "Function decorator to memoize function executions.", "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 functions 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 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."}]}, "streamlit.experimental_rerun": {"name": "experimental_rerun", "signature": "st.experimental_rerun()", "description": "Rerun the script immediately.", "args": []}, "streamlit.experimental_set_query_params": {"name": "experimental_set_query_params", "signature": "st.experimental_set_query_params(**query_params)", "example": "\nTo 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\n>>> st.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}]}, "streamlit.experimental_show": {"name": "experimental_show", "signature": "st.experimental_show(*args)", "notes": "\nThis 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- When passing multiple arguments the inclusion of , or ) in a string
\n
\n \nargument may cause an error.
\n
\n", "example": "\n\n>>> dataframe = pd.DataFrame({\n... 'first column': [1, 2, 3, 4],\n... 'second column': [10, 20, 30, 40],\n... }))\n>>> st.experimental_show(dataframe)\n
\n
\n", "description": "Write arguments and *argument names* to your app for debugging purposes.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to debug in the App.
\n", "default": null}]}, "streamlit.experimental_singleton": {"name": "singleton", "signature": "st.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...\n>>> s1 = get_database_session(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> s2 = get_database_session(DATA_URL_1)\n>>> # Does not execute the function. Instead, returns its previously computed\n>>> # value. This means that now the connection object in d1 is the same as in d2.\n>>>\n>>> s3 = get_database_session(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nBy 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...\n>>> s1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> s2 = 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
\n", "description": "Function decorator to store singleton objects.", "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}]}, "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)", "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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", "description": "Display a file uploader widget.", "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", "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}]}, "streamlit.form": {"name": "form", "signature": "st.form(key, clear_on_submit=False)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n", "description": "Create a form that batches elements together with a \"Submit\" button.", "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"}]}, "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.", "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}]}, "streamlit.get_option": {"name": "get_option", "signature": "st.get_option(key)", "description": "Return the current value of a given Streamlit config option.", "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}]}, "streamlit.graphviz_chart": {"name": "graphviz_chart", "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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}]}, "streamlit.header": {"name": "header", "signature": "st.header(body, anchor=None)", "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "streamlit.help": {"name": "help", "signature": "st.help(obj)", "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n", "description": "Display object's doc string, nicely formatted.", "args": [{"name": "obj", "type_name": "Object", "is_optional": false, "description": "The object whose docstring should be displayed.
\n", "default": null}]}, "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"}]}, "streamlit.info": {"name": "info", "signature": "st.info(body)", "example": "\n\n>>> st.info('This is a purely informational message')\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}]}, "streamlit.json": {"name": "json", "signature": "st.json(body)", "example": "\n\n>>> st.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}]}, "streamlit.latex": {"name": "latex", "signature": "st.latex(body)", "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display mathematical expressions formatted as LaTeX.", "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}]}, "streamlit.line_chart": {"name": "line_chart", "signature": "st.line_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a line chart.", "args": [{"name": "data", "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", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "streamlit.map": {"name": "map", "signature": "st.map(data=None, zoom=None, use_container_width=True)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a map with points on it.", "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}]}, "streamlit.markdown": {"name": "markdown", "signature": "st.markdown(body, unsafe_allow_html=False)", "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n", "default": null}]}, "streamlit.metric": {"name": "metric", "signature": "st.metric(label, value, delta=None, delta_color=\"normal\")", "example": "\n\n>>> st.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\n>>> col1, col2, col3 = st.columns(3)\n>>> col1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\n>>> col2.metric("Wind", "9 mph", "-8%")\n>>> col3.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\n>>> st.metric(label="Gas price", value=4, delta=-0.5,\n... delta_color="inverse")\n>>>\n>>> st.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.", "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}]}, "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)", "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n", "description": "Display a multiselect widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this select widget 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 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": "[str] or None", "is_optional": false, "description": "List of default values.
\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 selectbox.
\n", "default": null}, {"name": "key", "type_name": "str or int", "is_optional": false, "description": "An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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}]}, "streamlit.plotly_chart": {"name": "plotly_chart", "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)", "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.", "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
\nSee 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://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}, {"name": "To show Plotly charts in Streamlit, call `st.plotly_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Plotly's `py.plot` or `py.iplot`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "streamlit.progress": {"name": "progress", "signature": "st.progress(value)", "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n", "default": null}]}, "streamlit.pydeck_chart": {"name": "pydeck_chart", "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)", "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.", "args": [{"name": "spec", "type_name": "pydeck.Deck or None", "is_optional": false, "description": "Object specifying the PyDeck chart to draw.
\n", "default": null}]}, "streamlit.pyplot": {"name": "pyplot", "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)", "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n", "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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}]}, "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)", "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\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}]}, "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)", "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n", "description": "Display a slider widget to select items from a list.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "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": "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}]}, "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)", "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\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}]}, "streamlit.set_option": {"name": "set_option", "signature": "st.set_option(key, value)", "description": "Set config option.", "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}]}, "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": "\n>>> st.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.", "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\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
\n", "default": "About"}]}, "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)", "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n", "description": "Display a slider widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this slider is for.
\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}]}, "streamlit.spinner": {"name": "spinner", "signature": "st.spinner(text=\"In progress...\")", "example": "\n\n>>> with st.spinner('Wait for it...'):\n>>> time.sleep(5)\n>>> st.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}]}, "streamlit.stop": {"name": "stop", "signature": "st.stop()", "example": "\n\n>>> name = st.text_input('Name')\n>>> if not name:\n>>> st.warning('Please input a name.')\n>>> st.stop()\n>>> st.success('Thank you for inputting a name.')\n
\n
\n", "description": "Stops execution immediately.", "args": []}, "streamlit.subheader": {"name": "subheader", "signature": "st.subheader(body, anchor=None)", "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "streamlit.success": {"name": "success", "signature": "st.success(body)", "example": "\n\n>>> st.success('This is a success message!')\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}]}, "streamlit.table": {"name": "table", "signature": "st.table(data=None)", "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a static table.", "args": [{"name": "data", "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", "default": null}]}, "streamlit.text": {"name": "text", "signature": "st.text(body)", "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "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)", "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n", "default": null}, {"name": "value", "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}, {"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}]}, "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)", "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n", "default": null}, {"name": "value", "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}, {"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}]}, "streamlit.time_input": {"name": "time_input", "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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}]}, "streamlit.title": {"name": "title", "signature": "st.title(body, anchor=None)", "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in title 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}]}, "streamlit.vega_lite_chart": {"name": "vega_lite_chart", "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, **kwargs)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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}]}, "streamlit.video": {"name": "video", "signature": "st.video(data, format=\"video/mp4\", start_time=0)", "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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}]}, "streamlit.warning": {"name": "warning", "signature": "st.warning(body)", "example": "\n\n>>> st.warning('This is a warning')\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}]}, "streamlit.write": {"name": "write", "signature": "st.write(*args, **kwargs)", "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Write arguments to the app.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n", "default": "False."}]}, "DeltaGenerator.add_rows": {"name": "add_rows", "signature": "element.add_rows(self, data=None, **kwargs)", "example": "\n\n>>> df1 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_table = st.table(df1)\n>>>\n>>> df2 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_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
\nYou 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...\n>>> my_chart = st.line_chart(df1)\n>>> my_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
\nAnd for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:
\n\n>>> my_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... }),\n>>> my_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": "**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}]}, "DeltaGenerator.altair_chart": {"name": "altair_chart", "signature": "element.altair_chart(self, altair_chart, use_container_width=False)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\nExamples 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}]}, "DeltaGenerator.area_chart": {"name": "area_chart", "signature": "element.area_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display an area chart.", "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": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "DeltaGenerator.audio": {"name": "audio", "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0)", "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n", "default": "s"}]}, "DeltaGenerator.balloons": {"name": "balloons", "signature": "element.balloons(self)", "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n", "description": "Draw celebratory balloons.", "args": []}, "DeltaGenerator.bar_chart": {"name": "bar_chart", "signature": "element.bar_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a bar chart.", "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": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "DeltaGenerator.beta_columns": {"name": "beta_columns", "signature": "element.beta_columns(*args, **kwargs)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor 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}]}, "DeltaGenerator.beta_container": {"name": "beta_container", "signature": "element.beta_container(*args, **kwargs)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "DeltaGenerator.beta_expander": {"name": "beta_expander", "signature": "element.beta_expander(*args, **kwargs)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "DeltaGenerator.bokeh_chart": {"name": "bokeh_chart", "signature": "element.bokeh_chart(self, figure, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.", "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}, {"name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Bokeh's `show`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "DeltaGenerator.button": {"name": "button", "signature": "element.button(self, label, key=None, help=None, on_click=None, args=None, kwargs=None)", "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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}]}, "DeltaGenerator.caption": {"name": "caption", "signature": "element.caption(self, body)", "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in small font.", "args": [{"name": "body", "type_name": "str", "is_optional": false, "description": "The text to display.
\n", "default": null}]}, "DeltaGenerator.checkbox": {"name": "checkbox", "signature": "element.checkbox(self, label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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}]}, "DeltaGenerator.code": {"name": "code", "signature": "element.code(self, body, language=\"python\")", "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a code block with optional syntax highlighting.", "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", "default": null}]}, "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)", "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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}]}, "DeltaGenerator.columns": {"name": "columns", "signature": "element.columns(self, spec)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor 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}]}, "DeltaGenerator.container": {"name": "container", "signature": "element.container(self)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "DeltaGenerator.dataframe": {"name": "dataframe", "signature": "element.dataframe(self, data=None, width=None, height=None)", "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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.
\nIf '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 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 UI element expressed in pixels. If None, a\ndefault height is used.
\n", "default": "height"}]}, "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)", "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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}]}, "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)", "examples": "\nDownload 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>>>\n>>> csv = convert_df(my_large_df)\n>>>\n>>> st.download_button(\n... label="Download data as CSV",\n... data=csv,\n... file_name='large_df.csv',\n... mime='text/csv',\n... )\n
\nDownload a string as a file:
\n\n>>> text_contents = '''This is some text'''\n>>> st.download_button('Download some text', text_contents)\n
\nDownload a binary file:
\n\n>>> binary_contents = b'example content'\n>>> # Defaults to 'application/octet-stream'\n>>> st.download_button('Download binary file', binary_contents)\n
\nDownload an image:
\n\n>>> with 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", "description": "Display a download 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": "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}]}, "DeltaGenerator.empty": {"name": "empty", "signature": "element.empty(self)", "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n", "description": "Insert a single-element container.", "args": []}, "DeltaGenerator.error": {"name": "error", "signature": "element.error(self, body)", "example": "\n\n>>> st.error('This is an error')\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}]}, "DeltaGenerator.exception": {"name": "exception", "signature": "element.exception(self, exception)", "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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}]}, "DeltaGenerator.expander": {"name": "expander", "signature": "element.expander(self, label, expanded=False)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "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)", "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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", "description": "Display a file uploader widget.", "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", "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}]}, "DeltaGenerator.form": {"name": "form", "signature": "element.form(self, key, clear_on_submit=False)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n", "description": "Create a form that batches elements together with a \"Submit\" button.", "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"}]}, "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.", "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}]}, "DeltaGenerator.graphviz_chart": {"name": "graphviz_chart", "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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}]}, "DeltaGenerator.header": {"name": "header", "signature": "element.header(self, body, anchor=None)", "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "DeltaGenerator.help": {"name": "help", "signature": "element.help(self, obj)", "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n", "description": "Display object's doc string, nicely formatted.", "args": [{"name": "obj", "type_name": "Object", "is_optional": false, "description": "The object whose docstring should be displayed.
\n", "default": null}]}, "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"}]}, "DeltaGenerator.info": {"name": "info", "signature": "element.info(self, body)", "example": "\n\n>>> st.info('This is a purely informational message')\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}]}, "DeltaGenerator.is_negative": {"name": "is_negative", "signature": "element.is_negative(self, delta)"}, "DeltaGenerator.json": {"name": "json", "signature": "element.json(self, body)", "example": "\n\n>>> st.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}]}, "DeltaGenerator.latex": {"name": "latex", "signature": "element.latex(self, body)", "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display mathematical expressions formatted as LaTeX.", "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}]}, "DeltaGenerator.line_chart": {"name": "line_chart", "signature": "element.line_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a line chart.", "args": [{"name": "data", "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", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "DeltaGenerator.map": {"name": "map", "signature": "element.map(self, data=None, zoom=None, use_container_width=True)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a map with points on it.", "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}]}, "DeltaGenerator.markdown": {"name": "markdown", "signature": "element.markdown(self, body, unsafe_allow_html=False)", "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n", "default": null}]}, "DeltaGenerator.metric": {"name": "metric", "signature": "element.metric(self, label, value, delta=None, delta_color=\"normal\")", "example": "\n\n>>> st.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\n>>> col1, col2, col3 = st.columns(3)\n>>> col1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\n>>> col2.metric("Wind", "9 mph", "-8%")\n>>> col3.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\n>>> st.metric(label="Gas price", value=4, delta=-0.5,\n... delta_color="inverse")\n>>>\n>>> st.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.", "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}]}, "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)", "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n", "description": "Display a multiselect widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this select widget 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 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": "[str] or None", "is_optional": false, "description": "List of default values.
\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 selectbox.
\n", "default": null}, {"name": "key", "type_name": "str or int", "is_optional": false, "description": "An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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}]}, "DeltaGenerator.parse_delta": {"name": "parse_delta", "signature": "element.parse_delta(self, delta)"}, "DeltaGenerator.parse_label": {"name": "parse_label", "signature": "element.parse_label(self, label)"}, "DeltaGenerator.parse_value": {"name": "parse_value", "signature": "element.parse_value(self, value)"}, "DeltaGenerator.plotly_chart": {"name": "plotly_chart", "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)", "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.", "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
\nSee 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://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}, {"name": "To show Plotly charts in Streamlit, call `st.plotly_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Plotly's `py.plot` or `py.iplot`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "DeltaGenerator.progress": {"name": "progress", "signature": "element.progress(self, value)", "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n", "default": null}]}, "DeltaGenerator.pydeck_chart": {"name": "pydeck_chart", "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)", "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.", "args": [{"name": "spec", "type_name": "pydeck.Deck or None", "is_optional": false, "description": "Object specifying the PyDeck chart to draw.
\n", "default": null}]}, "DeltaGenerator.pyplot": {"name": "pyplot", "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)", "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n", "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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}]}, "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)", "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\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}]}, "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)", "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n", "description": "Display a slider widget to select items from a list.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "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": "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}]}, "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)", "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\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}]}, "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)", "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n", "description": "Display a slider widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this slider is for.
\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}]}, "DeltaGenerator.subheader": {"name": "subheader", "signature": "element.subheader(self, body, anchor=None)", "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "DeltaGenerator.success": {"name": "success", "signature": "element.success(self, body)", "example": "\n\n>>> st.success('This is a success message!')\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}]}, "DeltaGenerator.table": {"name": "table", "signature": "element.table(self, data=None)", "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a static table.", "args": [{"name": "data", "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", "default": null}]}, "DeltaGenerator.text": {"name": "text", "signature": "element.text(self, body)", "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "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)", "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n", "default": null}, {"name": "value", "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}, {"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}]}, "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)", "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n", "default": null}, {"name": "value", "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}, {"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}]}, "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)", "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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}]}, "DeltaGenerator.title": {"name": "title", "signature": "element.title(self, body, anchor=None)", "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in title 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}]}, "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\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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}]}, "DeltaGenerator.video": {"name": "video", "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)", "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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}]}, "DeltaGenerator.warning": {"name": "warning", "signature": "element.warning(self, body)", "example": "\n\n>>> st.warning('This is a warning')\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}]}, "DeltaGenerator.write": {"name": "write", "signature": "element.write(self, *args, **kwargs)", "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Write arguments to the app.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n", "default": "False."}]}}, "1.0.0": {"streamlit.altair_chart": {"name": "altair_chart", "signature": "st.altair_chart(altair_chart, use_container_width=False)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\nExamples 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}]}, "streamlit.area_chart": {"name": "area_chart", "signature": "st.area_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display an area chart.", "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": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "streamlit.audio": {"name": "audio", "signature": "st.audio(data, format=\"audio/wav\", start_time=0)", "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n", "default": "s"}]}, "streamlit.balloons": {"name": "balloons", "signature": "st.balloons()", "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n", "description": "Draw celebratory balloons.", "args": []}, "streamlit.bar_chart": {"name": "bar_chart", "signature": "st.bar_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a bar chart.", "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": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "streamlit.beta_columns": {"name": "beta_columns", "signature": "st.beta_columns(*args, **kwargs)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor 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}]}, "streamlit.beta_container": {"name": "beta_container", "signature": "st.beta_container(*args, **kwargs)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "streamlit.beta_expander": {"name": "beta_expander", "signature": "st.beta_expander(*args, **kwargs)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "streamlit.bokeh_chart": {"name": "bokeh_chart", "signature": "st.bokeh_chart(figure, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.", "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}, {"name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Bokeh's `show`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "streamlit.button": {"name": "button", "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None)", "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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}]}, "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\n... def fetch_and_clean_data(url):\n... # Fetch data from URL here, and then clean it up.\n... return data\n...\n>>> d1 = fetch_and_clean_data(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> d2 = 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>>>\n>>> d3 = fetch_and_clean_data(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nTo 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
\nTo 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
\nTo 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
\nAlternatively, 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", "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 normally shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.
\nIf 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 functions 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."}]}, "streamlit.caption": {"name": "caption", "signature": "st.caption(body)", "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in small font.", "args": [{"name": "body", "type_name": "str", "is_optional": false, "description": "The text to display.
\n", "default": null}]}, "streamlit.checkbox": {"name": "checkbox", "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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}]}, "streamlit.code": {"name": "code", "signature": "st.code(body, language=\"python\")", "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a code block with optional syntax highlighting.", "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", "default": null}]}, "streamlit.color_picker": {"name": "color_picker", "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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}]}, "streamlit.columns": {"name": "columns", "signature": "st.columns(spec)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor 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}]}, "streamlit.container": {"name": "container", "signature": "st.container()", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "streamlit.dataframe": {"name": "dataframe", "signature": "st.dataframe(data=None, width=None, height=None)", "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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.
\nIf '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 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 UI element expressed in pixels. If None, a\ndefault height is used.
\n", "default": "height"}]}, "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)", "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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}]}, "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)", "examples": "\nDownload 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>>>\n>>> csv = convert_df(my_large_df)\n>>>\n>>> st.download_button(\n... label="Download data as CSV",\n... data=csv,\n... file_name='large_df.csv',\n... mime='text/csv',\n... )\n
\nDownload a string as a file:
\n\n>>> text_contents = '''This is some text'''\n>>> st.download_button('Download some text', text_contents)\n
\nDownload a binary file:
\n\n>>> binary_contents = b'example content'\n>>> # Defaults to 'application/octet-stream'\n>>> st.download_button('Download binary file', binary_contents)\n
\nDownload an image:
\n\n>>> with 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", "description": "Display a download 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": "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}]}, "streamlit.echo": {"name": "echo", "signature": "st.echo(code_location=\"above\")", "example": "\n\n>>> with 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}]}, "streamlit.empty": {"name": "empty", "signature": "st.empty()", "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n", "description": "Insert a single-element container.", "args": []}, "streamlit.error": {"name": "error", "signature": "st.error(body)", "example": "\n\n>>> st.error('This is an error')\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}]}, "streamlit.exception": {"name": "exception", "signature": "st.exception(exception)", "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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}]}, "streamlit.expander": {"name": "expander", "signature": "st.expander(label, expanded=False)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "streamlit.experimental_get_query_params": {"name": "experimental_get_query_params", "signature": "st.experimental_get_query_params()", "example": "\nLet'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\n>>> st.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\nNote 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": []}, "streamlit.experimental_memo": {"name": "memo", "signature": "st.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...\n>>> d1 = fetch_and_clean_data(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> d2 = 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>>>\n>>> d3 = fetch_and_clean_data(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nTo 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
\nBy 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...\n>>> connection = make_database_connection()\n>>> d1 = fetch_and_clean_data(connection, num_rows=10)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> another_connection = make_database_connection()\n>>> d2 = 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
\n", "description": "Function decorator to memoize function executions.", "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 functions 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 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."}]}, "streamlit.experimental_rerun": {"name": "experimental_rerun", "signature": "st.experimental_rerun()", "description": "Rerun the script immediately.", "args": []}, "streamlit.experimental_set_query_params": {"name": "experimental_set_query_params", "signature": "st.experimental_set_query_params(**query_params)", "example": "\nTo 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\n>>> st.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}]}, "streamlit.experimental_show": {"name": "experimental_show", "signature": "st.experimental_show(*args)", "notes": "\nThis 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- When passing multiple arguments the inclusion of , or ) in a string
\n
\n \nargument may cause an error.
\n
\n", "example": "\n\n>>> dataframe = pd.DataFrame({\n... 'first column': [1, 2, 3, 4],\n... 'second column': [10, 20, 30, 40],\n... }))\n>>> st.experimental_show(dataframe)\n
\n
\n", "description": "Write arguments and *argument names* to your app for debugging purposes.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to debug in the App.
\n", "default": null}]}, "streamlit.experimental_singleton": {"name": "singleton", "signature": "st.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...\n>>> s1 = get_database_session(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> s2 = get_database_session(DATA_URL_1)\n>>> # Does not execute the function. Instead, returns its previously computed\n>>> # value. This means that now the connection object in d1 is the same as in d2.\n>>>\n>>> s3 = get_database_session(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nBy 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...\n>>> s1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> s2 = 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
\n", "description": "Function decorator to store singleton objects.", "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}]}, "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)", "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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", "description": "Display a file uploader widget.", "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", "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}]}, "streamlit.form": {"name": "form", "signature": "st.form(key, clear_on_submit=False)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n", "description": "Create a form that batches elements together with a \"Submit\" button.", "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"}]}, "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.", "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}]}, "streamlit.get_option": {"name": "get_option", "signature": "st.get_option(key)", "description": "Return the current value of a given Streamlit config option.", "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}]}, "streamlit.graphviz_chart": {"name": "graphviz_chart", "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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}]}, "streamlit.header": {"name": "header", "signature": "st.header(body, anchor=None)", "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "streamlit.help": {"name": "help", "signature": "st.help(obj)", "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n", "description": "Display object's doc string, nicely formatted.", "args": [{"name": "obj", "type_name": "Object", "is_optional": false, "description": "The object whose docstring should be displayed.
\n", "default": null}]}, "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"}]}, "streamlit.info": {"name": "info", "signature": "st.info(body)", "example": "\n\n>>> st.info('This is a purely informational message')\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}]}, "streamlit.json": {"name": "json", "signature": "st.json(body)", "example": "\n\n>>> st.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}]}, "streamlit.latex": {"name": "latex", "signature": "st.latex(body)", "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display mathematical expressions formatted as LaTeX.", "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}]}, "streamlit.line_chart": {"name": "line_chart", "signature": "st.line_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a line chart.", "args": [{"name": "data", "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", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "streamlit.map": {"name": "map", "signature": "st.map(data=None, zoom=None, use_container_width=True)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a map with points on it.", "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}]}, "streamlit.markdown": {"name": "markdown", "signature": "st.markdown(body, unsafe_allow_html=False)", "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n", "default": null}]}, "streamlit.metric": {"name": "metric", "signature": "st.metric(label, value, delta=None, delta_color=\"normal\")", "example": "\n\n>>> st.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\n>>> col1, col2, col3 = st.columns(3)\n>>> col1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\n>>> col2.metric("Wind", "9 mph", "-8%")\n>>> col3.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\n>>> st.metric(label="Gas price", value=4, delta=-0.5,\n... delta_color="inverse")\n>>>\n>>> st.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.", "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}]}, "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)", "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n", "description": "Display a multiselect widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this select widget 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 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": "[str] or None", "is_optional": false, "description": "List of default values.
\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 selectbox.
\n", "default": null}, {"name": "key", "type_name": "str or int", "is_optional": false, "description": "An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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}]}, "streamlit.plotly_chart": {"name": "plotly_chart", "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)", "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.", "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
\nSee 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://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}, {"name": "To show Plotly charts in Streamlit, call `st.plotly_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Plotly's `py.plot` or `py.iplot`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "streamlit.progress": {"name": "progress", "signature": "st.progress(value)", "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n", "default": null}]}, "streamlit.pydeck_chart": {"name": "pydeck_chart", "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)", "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.", "args": [{"name": "spec", "type_name": "pydeck.Deck or None", "is_optional": false, "description": "Object specifying the PyDeck chart to draw.
\n", "default": null}]}, "streamlit.pyplot": {"name": "pyplot", "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)", "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n", "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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}]}, "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)", "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\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}]}, "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)", "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n", "description": "Display a slider widget to select items from a list.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "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": "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}]}, "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)", "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\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}]}, "streamlit.set_option": {"name": "set_option", "signature": "st.set_option(key, value)", "description": "Set config option.", "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}]}, "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": "\n>>> st.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.", "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\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
\n", "default": "About"}]}, "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)", "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n", "description": "Display a slider widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this slider is for.
\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}]}, "streamlit.spinner": {"name": "spinner", "signature": "st.spinner(text=\"In progress...\")", "example": "\n\n>>> with st.spinner('Wait for it...'):\n>>> time.sleep(5)\n>>> st.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}]}, "streamlit.stop": {"name": "stop", "signature": "st.stop()", "example": "\n\n>>> name = st.text_input('Name')\n>>> if not name:\n>>> st.warning('Please input a name.')\n>>> st.stop()\n>>> st.success('Thank you for inputting a name.')\n
\n
\n", "description": "Stops execution immediately.", "args": []}, "streamlit.subheader": {"name": "subheader", "signature": "st.subheader(body, anchor=None)", "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "streamlit.success": {"name": "success", "signature": "st.success(body)", "example": "\n\n>>> st.success('This is a success message!')\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}]}, "streamlit.table": {"name": "table", "signature": "st.table(data=None)", "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a static table.", "args": [{"name": "data", "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", "default": null}]}, "streamlit.text": {"name": "text", "signature": "st.text(body)", "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "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)", "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n", "default": null}, {"name": "value", "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}, {"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}]}, "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)", "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n", "default": null}, {"name": "value", "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}, {"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}]}, "streamlit.time_input": {"name": "time_input", "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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}]}, "streamlit.title": {"name": "title", "signature": "st.title(body, anchor=None)", "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in title 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}]}, "streamlit.vega_lite_chart": {"name": "vega_lite_chart", "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, **kwargs)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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}]}, "streamlit.video": {"name": "video", "signature": "st.video(data, format=\"video/mp4\", start_time=0)", "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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}]}, "streamlit.warning": {"name": "warning", "signature": "st.warning(body)", "example": "\n\n>>> st.warning('This is a warning')\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}]}, "streamlit.write": {"name": "write", "signature": "st.write(*args, **kwargs)", "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Write arguments to the app.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n", "default": "False."}]}, "DeltaGenerator.add_rows": {"name": "add_rows", "signature": "element.add_rows(self, data=None, **kwargs)", "example": "\n\n>>> df1 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_table = st.table(df1)\n>>>\n>>> df2 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_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
\nYou 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...\n>>> my_chart = st.line_chart(df1)\n>>> my_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
\nAnd for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:
\n\n>>> my_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... }),\n>>> my_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": "**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}]}, "DeltaGenerator.altair_chart": {"name": "altair_chart", "signature": "element.altair_chart(self, altair_chart, use_container_width=False)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\nExamples 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}]}, "DeltaGenerator.area_chart": {"name": "area_chart", "signature": "element.area_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display an area chart.", "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": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "DeltaGenerator.audio": {"name": "audio", "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0)", "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n", "default": "s"}]}, "DeltaGenerator.balloons": {"name": "balloons", "signature": "element.balloons(self)", "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n", "description": "Draw celebratory balloons.", "args": []}, "DeltaGenerator.bar_chart": {"name": "bar_chart", "signature": "element.bar_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a bar chart.", "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": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "DeltaGenerator.beta_columns": {"name": "beta_columns", "signature": "element.beta_columns(*args, **kwargs)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor 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}]}, "DeltaGenerator.beta_container": {"name": "beta_container", "signature": "element.beta_container(*args, **kwargs)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "DeltaGenerator.beta_expander": {"name": "beta_expander", "signature": "element.beta_expander(*args, **kwargs)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "DeltaGenerator.bokeh_chart": {"name": "bokeh_chart", "signature": "element.bokeh_chart(self, figure, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.", "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}, {"name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Bokeh's `show`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "DeltaGenerator.button": {"name": "button", "signature": "element.button(self, label, key=None, help=None, on_click=None, args=None, kwargs=None)", "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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}]}, "DeltaGenerator.caption": {"name": "caption", "signature": "element.caption(self, body)", "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in small font.", "args": [{"name": "body", "type_name": "str", "is_optional": false, "description": "The text to display.
\n", "default": null}]}, "DeltaGenerator.checkbox": {"name": "checkbox", "signature": "element.checkbox(self, label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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}]}, "DeltaGenerator.code": {"name": "code", "signature": "element.code(self, body, language=\"python\")", "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a code block with optional syntax highlighting.", "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", "default": null}]}, "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)", "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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}]}, "DeltaGenerator.columns": {"name": "columns", "signature": "element.columns(self, spec)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor 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}]}, "DeltaGenerator.container": {"name": "container", "signature": "element.container(self)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "DeltaGenerator.dataframe": {"name": "dataframe", "signature": "element.dataframe(self, data=None, width=None, height=None)", "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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.
\nIf '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 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 UI element expressed in pixels. If None, a\ndefault height is used.
\n", "default": "height"}]}, "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)", "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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}]}, "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)", "examples": "\nDownload 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>>>\n>>> csv = convert_df(my_large_df)\n>>>\n>>> st.download_button(\n... label="Download data as CSV",\n... data=csv,\n... file_name='large_df.csv',\n... mime='text/csv',\n... )\n
\nDownload a string as a file:
\n\n>>> text_contents = '''This is some text'''\n>>> st.download_button('Download some text', text_contents)\n
\nDownload a binary file:
\n\n>>> binary_contents = b'example content'\n>>> # Defaults to 'application/octet-stream'\n>>> st.download_button('Download binary file', binary_contents)\n
\nDownload an image:
\n\n>>> with 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", "description": "Display a download 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": "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}]}, "DeltaGenerator.empty": {"name": "empty", "signature": "element.empty(self)", "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n", "description": "Insert a single-element container.", "args": []}, "DeltaGenerator.error": {"name": "error", "signature": "element.error(self, body)", "example": "\n\n>>> st.error('This is an error')\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}]}, "DeltaGenerator.exception": {"name": "exception", "signature": "element.exception(self, exception)", "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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}]}, "DeltaGenerator.expander": {"name": "expander", "signature": "element.expander(self, label, expanded=False)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "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)", "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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", "description": "Display a file uploader widget.", "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", "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}]}, "DeltaGenerator.form": {"name": "form", "signature": "element.form(self, key, clear_on_submit=False)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n", "description": "Create a form that batches elements together with a \"Submit\" button.", "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"}]}, "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.", "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}]}, "DeltaGenerator.graphviz_chart": {"name": "graphviz_chart", "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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}]}, "DeltaGenerator.header": {"name": "header", "signature": "element.header(self, body, anchor=None)", "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "DeltaGenerator.help": {"name": "help", "signature": "element.help(self, obj)", "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n", "description": "Display object's doc string, nicely formatted.", "args": [{"name": "obj", "type_name": "Object", "is_optional": false, "description": "The object whose docstring should be displayed.
\n", "default": null}]}, "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"}]}, "DeltaGenerator.info": {"name": "info", "signature": "element.info(self, body)", "example": "\n\n>>> st.info('This is a purely informational message')\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}]}, "DeltaGenerator.is_negative": {"name": "is_negative", "signature": "element.is_negative(self, delta)"}, "DeltaGenerator.json": {"name": "json", "signature": "element.json(self, body)", "example": "\n\n>>> st.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}]}, "DeltaGenerator.latex": {"name": "latex", "signature": "element.latex(self, body)", "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display mathematical expressions formatted as LaTeX.", "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}]}, "DeltaGenerator.line_chart": {"name": "line_chart", "signature": "element.line_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a line chart.", "args": [{"name": "data", "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", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "DeltaGenerator.map": {"name": "map", "signature": "element.map(self, data=None, zoom=None, use_container_width=True)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a map with points on it.", "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}]}, "DeltaGenerator.markdown": {"name": "markdown", "signature": "element.markdown(self, body, unsafe_allow_html=False)", "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n", "default": null}]}, "DeltaGenerator.metric": {"name": "metric", "signature": "element.metric(self, label, value, delta=None, delta_color=\"normal\")", "example": "\n\n>>> st.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\n>>> col1, col2, col3 = st.columns(3)\n>>> col1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\n>>> col2.metric("Wind", "9 mph", "-8%")\n>>> col3.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\n>>> st.metric(label="Gas price", value=4, delta=-0.5,\n... delta_color="inverse")\n>>>\n>>> st.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.", "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}]}, "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)", "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n", "description": "Display a multiselect widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this select widget 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 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": "[str] or None", "is_optional": false, "description": "List of default values.
\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 selectbox.
\n", "default": null}, {"name": "key", "type_name": "str or int", "is_optional": false, "description": "An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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}]}, "DeltaGenerator.parse_delta": {"name": "parse_delta", "signature": "element.parse_delta(self, delta)"}, "DeltaGenerator.parse_label": {"name": "parse_label", "signature": "element.parse_label(self, label)"}, "DeltaGenerator.parse_value": {"name": "parse_value", "signature": "element.parse_value(self, value)"}, "DeltaGenerator.plotly_chart": {"name": "plotly_chart", "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)", "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.", "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
\nSee 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://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}, {"name": "To show Plotly charts in Streamlit, call `st.plotly_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Plotly's `py.plot` or `py.iplot`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "DeltaGenerator.progress": {"name": "progress", "signature": "element.progress(self, value)", "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n", "default": null}]}, "DeltaGenerator.pydeck_chart": {"name": "pydeck_chart", "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)", "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.", "args": [{"name": "spec", "type_name": "pydeck.Deck or None", "is_optional": false, "description": "Object specifying the PyDeck chart to draw.
\n", "default": null}]}, "DeltaGenerator.pyplot": {"name": "pyplot", "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)", "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n", "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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}]}, "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)", "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\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}]}, "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)", "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n", "description": "Display a slider widget to select items from a list.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "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": "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}]}, "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)", "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\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}]}, "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)", "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n", "description": "Display a slider widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this slider is for.
\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}]}, "DeltaGenerator.subheader": {"name": "subheader", "signature": "element.subheader(self, body, anchor=None)", "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "DeltaGenerator.success": {"name": "success", "signature": "element.success(self, body)", "example": "\n\n>>> st.success('This is a success message!')\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}]}, "DeltaGenerator.table": {"name": "table", "signature": "element.table(self, data=None)", "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a static table.", "args": [{"name": "data", "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", "default": null}]}, "DeltaGenerator.text": {"name": "text", "signature": "element.text(self, body)", "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "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)", "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n", "default": null}, {"name": "value", "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}, {"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}]}, "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)", "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n", "default": null}, {"name": "value", "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}, {"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}]}, "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)", "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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}]}, "DeltaGenerator.title": {"name": "title", "signature": "element.title(self, body, anchor=None)", "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in title 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}]}, "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\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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}]}, "DeltaGenerator.video": {"name": "video", "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)", "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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}]}, "DeltaGenerator.warning": {"name": "warning", "signature": "element.warning(self, body)", "example": "\n\n>>> st.warning('This is a warning')\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}]}, "DeltaGenerator.write": {"name": "write", "signature": "element.write(self, *args, **kwargs)", "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Write arguments to the app.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n", "default": "False."}]}}, "1.1.0": {"streamlit.altair_chart": {"name": "altair_chart", "signature": "st.altair_chart(altair_chart, use_container_width=False)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\nExamples 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}]}, "streamlit.area_chart": {"name": "area_chart", "signature": "st.area_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display an area chart.", "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": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "streamlit.audio": {"name": "audio", "signature": "st.audio(data, format=\"audio/wav\", start_time=0)", "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n", "default": "s"}]}, "streamlit.balloons": {"name": "balloons", "signature": "st.balloons()", "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n", "description": "Draw celebratory balloons.", "args": []}, "streamlit.bar_chart": {"name": "bar_chart", "signature": "st.bar_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a bar chart.", "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": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "streamlit.beta_columns": {"name": "beta_columns", "signature": "st.beta_columns(*args, **kwargs)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor 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}]}, "streamlit.beta_container": {"name": "beta_container", "signature": "st.beta_container(*args, **kwargs)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "streamlit.beta_expander": {"name": "beta_expander", "signature": "st.beta_expander(*args, **kwargs)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "streamlit.bokeh_chart": {"name": "bokeh_chart", "signature": "st.bokeh_chart(figure, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.", "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}, {"name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Bokeh's `show`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "streamlit.button": {"name": "button", "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None)", "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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}]}, "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\n... def fetch_and_clean_data(url):\n... # Fetch data from URL here, and then clean it up.\n... return data\n...\n>>> d1 = fetch_and_clean_data(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> d2 = 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>>>\n>>> d3 = fetch_and_clean_data(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nTo 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
\nTo 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
\nTo 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
\nAlternatively, 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", "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 normally shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.
\nIf 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 functions 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."}]}, "streamlit.caption": {"name": "caption", "signature": "st.caption(body)", "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in small font.", "args": [{"name": "body", "type_name": "str", "is_optional": false, "description": "The text to display.
\n", "default": null}]}, "streamlit.checkbox": {"name": "checkbox", "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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}]}, "streamlit.code": {"name": "code", "signature": "st.code(body, language=\"python\")", "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a code block with optional syntax highlighting.", "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", "default": null}]}, "streamlit.color_picker": {"name": "color_picker", "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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}]}, "streamlit.columns": {"name": "columns", "signature": "st.columns(spec)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor 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}]}, "streamlit.container": {"name": "container", "signature": "st.container()", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "streamlit.dataframe": {"name": "dataframe", "signature": "st.dataframe(data=None, width=None, height=None)", "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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.
\nIf '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 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 UI element expressed in pixels. If None, a\ndefault height is used.
\n", "default": "height"}]}, "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)", "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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}]}, "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)", "examples": "\nDownload 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>>>\n>>> csv = convert_df(my_large_df)\n>>>\n>>> st.download_button(\n... label="Download data as CSV",\n... data=csv,\n... file_name='large_df.csv',\n... mime='text/csv',\n... )\n
\nDownload a string as a file:
\n\n>>> text_contents = '''This is some text'''\n>>> st.download_button('Download some text', text_contents)\n
\nDownload a binary file:
\n\n>>> binary_contents = b'example content'\n>>> # Defaults to 'application/octet-stream'\n>>> st.download_button('Download binary file', binary_contents)\n
\nDownload an image:
\n\n>>> with 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", "description": "Display a download 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": "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}]}, "streamlit.echo": {"name": "echo", "signature": "st.echo(code_location=\"above\")", "example": "\n\n>>> with 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}]}, "streamlit.empty": {"name": "empty", "signature": "st.empty()", "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n", "description": "Insert a single-element container.", "args": []}, "streamlit.error": {"name": "error", "signature": "st.error(body)", "example": "\n\n>>> st.error('This is an error')\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}]}, "streamlit.exception": {"name": "exception", "signature": "st.exception(exception)", "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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}]}, "streamlit.expander": {"name": "expander", "signature": "st.expander(label, expanded=False)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "streamlit.experimental_get_query_params": {"name": "experimental_get_query_params", "signature": "st.experimental_get_query_params()", "example": "\nLet'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\n>>> st.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\nNote 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": []}, "streamlit.experimental_memo": {"name": "memo", "signature": "st.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...\n>>> d1 = fetch_and_clean_data(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> d2 = 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>>>\n>>> d3 = fetch_and_clean_data(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nTo 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
\nBy 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...\n>>> connection = make_database_connection()\n>>> d1 = fetch_and_clean_data(connection, num_rows=10)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> another_connection = make_database_connection()\n>>> d2 = 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
\n", "description": "Function decorator to memoize function executions.", "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 functions 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 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."}]}, "streamlit.experimental_rerun": {"name": "experimental_rerun", "signature": "st.experimental_rerun()", "description": "Rerun the script immediately.", "args": []}, "streamlit.experimental_set_query_params": {"name": "experimental_set_query_params", "signature": "st.experimental_set_query_params(**query_params)", "example": "\nTo 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\n>>> st.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}]}, "streamlit.experimental_show": {"name": "experimental_show", "signature": "st.experimental_show(*args)", "notes": "\nThis 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- When passing multiple arguments the inclusion of , or ) in a string
\n
\n \nargument may cause an error.
\n
\n", "example": "\n\n>>> dataframe = pd.DataFrame({\n... 'first column': [1, 2, 3, 4],\n... 'second column': [10, 20, 30, 40],\n... }))\n>>> st.experimental_show(dataframe)\n
\n
\n", "description": "Write arguments and *argument names* to your app for debugging purposes.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to debug in the App.
\n", "default": null}]}, "streamlit.experimental_singleton": {"name": "singleton", "signature": "st.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...\n>>> s1 = get_database_session(SESSION_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> s2 = 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>>>\n>>> s3 = get_database_session(SESSION_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nBy 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...\n>>> s1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> s2 = 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
\n", "description": "Function decorator to store singleton objects.", "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}]}, "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)", "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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", "description": "Display a file uploader widget.", "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", "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}]}, "streamlit.form": {"name": "form", "signature": "st.form(key, clear_on_submit=False)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n", "description": "Create a form that batches elements together with a \"Submit\" button.", "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"}]}, "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.", "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}]}, "streamlit.get_option": {"name": "get_option", "signature": "st.get_option(key)", "description": "Return the current value of a given Streamlit config option.", "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}]}, "streamlit.graphviz_chart": {"name": "graphviz_chart", "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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}]}, "streamlit.header": {"name": "header", "signature": "st.header(body, anchor=None)", "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "streamlit.help": {"name": "help", "signature": "st.help(obj)", "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n", "description": "Display object's doc string, nicely formatted.", "args": [{"name": "obj", "type_name": "Object", "is_optional": false, "description": "The object whose docstring should be displayed.
\n", "default": null}]}, "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"}]}, "streamlit.info": {"name": "info", "signature": "st.info(body)", "example": "\n\n>>> st.info('This is a purely informational message')\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}]}, "streamlit.json": {"name": "json", "signature": "st.json(body)", "example": "\n\n>>> st.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}]}, "streamlit.latex": {"name": "latex", "signature": "st.latex(body)", "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display mathematical expressions formatted as LaTeX.", "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}]}, "streamlit.line_chart": {"name": "line_chart", "signature": "st.line_chart(data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a line chart.", "args": [{"name": "data", "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", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "streamlit.map": {"name": "map", "signature": "st.map(data=None, zoom=None, use_container_width=True)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a map with points on it.", "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}]}, "streamlit.markdown": {"name": "markdown", "signature": "st.markdown(body, unsafe_allow_html=False)", "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n", "default": null}]}, "streamlit.metric": {"name": "metric", "signature": "st.metric(label, value, delta=None, delta_color=\"normal\")", "example": "\n\n>>> st.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\n>>> col1, col2, col3 = st.columns(3)\n>>> col1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\n>>> col2.metric("Wind", "9 mph", "-8%")\n>>> col3.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\n>>> st.metric(label="Gas price", value=4, delta=-0.5,\n... delta_color="inverse")\n>>>\n>>> st.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.", "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}]}, "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)", "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n", "description": "Display a multiselect widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this select widget 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 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": "[str] or None", "is_optional": false, "description": "List of default values.
\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 selectbox.
\n", "default": null}, {"name": "key", "type_name": "str or int", "is_optional": false, "description": "An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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}]}, "streamlit.plotly_chart": {"name": "plotly_chart", "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)", "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.", "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
\nSee 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://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}, {"name": "To show Plotly charts in Streamlit, call `st.plotly_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Plotly's `py.plot` or `py.iplot`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "streamlit.progress": {"name": "progress", "signature": "st.progress(value)", "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n", "default": null}]}, "streamlit.pydeck_chart": {"name": "pydeck_chart", "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)", "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.", "args": [{"name": "spec", "type_name": "pydeck.Deck or None", "is_optional": false, "description": "Object specifying the PyDeck chart to draw.
\n", "default": null}]}, "streamlit.pyplot": {"name": "pyplot", "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)", "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n", "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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}]}, "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)", "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\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}]}, "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)", "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n", "description": "Display a slider widget to select items from a list.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "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": "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}]}, "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)", "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\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}]}, "streamlit.set_option": {"name": "set_option", "signature": "st.set_option(key, value)", "description": "Set config option.", "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}]}, "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": "\n>>> st.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.", "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", "default": "About"}]}, "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)", "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n", "description": "Display a slider widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this slider is for.
\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}]}, "streamlit.spinner": {"name": "spinner", "signature": "st.spinner(text=\"In progress...\")", "example": "\n\n>>> with st.spinner('Wait for it...'):\n>>> time.sleep(5)\n>>> st.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}]}, "streamlit.stop": {"name": "stop", "signature": "st.stop()", "example": "\n\n>>> name = st.text_input('Name')\n>>> if not name:\n>>> st.warning('Please input a name.')\n>>> st.stop()\n>>> st.success('Thank you for inputting a name.')\n
\n
\n", "description": "Stops execution immediately.", "args": []}, "streamlit.subheader": {"name": "subheader", "signature": "st.subheader(body, anchor=None)", "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "streamlit.success": {"name": "success", "signature": "st.success(body)", "example": "\n\n>>> st.success('This is a success message!')\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}]}, "streamlit.table": {"name": "table", "signature": "st.table(data=None)", "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a static table.", "args": [{"name": "data", "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", "default": null}]}, "streamlit.text": {"name": "text", "signature": "st.text(body)", "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "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)", "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n", "default": null}, {"name": "value", "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}, {"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}]}, "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)", "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n", "default": null}, {"name": "value", "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}, {"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}]}, "streamlit.time_input": {"name": "time_input", "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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}]}, "streamlit.title": {"name": "title", "signature": "st.title(body, anchor=None)", "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in title 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}]}, "streamlit.vega_lite_chart": {"name": "vega_lite_chart", "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, **kwargs)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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}]}, "streamlit.video": {"name": "video", "signature": "st.video(data, format=\"video/mp4\", start_time=0)", "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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}]}, "streamlit.warning": {"name": "warning", "signature": "st.warning(body)", "example": "\n\n>>> st.warning('This is a warning')\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}]}, "streamlit.write": {"name": "write", "signature": "st.write(*args, **kwargs)", "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Write arguments to the app.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n", "default": "False."}]}, "DeltaGenerator.add_rows": {"name": "add_rows", "signature": "element.add_rows(self, data=None, **kwargs)", "example": "\n\n>>> df1 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_table = st.table(df1)\n>>>\n>>> df2 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_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
\nYou 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...\n>>> my_chart = st.line_chart(df1)\n>>> my_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
\nAnd for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:
\n\n>>> my_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... }),\n>>> my_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": "**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}]}, "DeltaGenerator.altair_chart": {"name": "altair_chart", "signature": "element.altair_chart(self, altair_chart, use_container_width=False)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\nExamples 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}]}, "DeltaGenerator.area_chart": {"name": "area_chart", "signature": "element.area_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display an area chart.", "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": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "DeltaGenerator.audio": {"name": "audio", "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0)", "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n", "default": "s"}]}, "DeltaGenerator.balloons": {"name": "balloons", "signature": "element.balloons(self)", "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n", "description": "Draw celebratory balloons.", "args": []}, "DeltaGenerator.bar_chart": {"name": "bar_chart", "signature": "element.bar_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a bar chart.", "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": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "DeltaGenerator.beta_columns": {"name": "beta_columns", "signature": "element.beta_columns(*args, **kwargs)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor 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}]}, "DeltaGenerator.beta_container": {"name": "beta_container", "signature": "element.beta_container(*args, **kwargs)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "DeltaGenerator.beta_expander": {"name": "beta_expander", "signature": "element.beta_expander(*args, **kwargs)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "DeltaGenerator.bokeh_chart": {"name": "bokeh_chart", "signature": "element.bokeh_chart(self, figure, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.", "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}, {"name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Bokeh's `show`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "DeltaGenerator.button": {"name": "button", "signature": "element.button(self, label, key=None, help=None, on_click=None, args=None, kwargs=None)", "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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}]}, "DeltaGenerator.caption": {"name": "caption", "signature": "element.caption(self, body)", "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in small font.", "args": [{"name": "body", "type_name": "str", "is_optional": false, "description": "The text to display.
\n", "default": null}]}, "DeltaGenerator.checkbox": {"name": "checkbox", "signature": "element.checkbox(self, label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)", "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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}]}, "DeltaGenerator.code": {"name": "code", "signature": "element.code(self, body, language=\"python\")", "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a code block with optional syntax highlighting.", "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", "default": null}]}, "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)", "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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}]}, "DeltaGenerator.columns": {"name": "columns", "signature": "element.columns(self, spec)", "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert containers laid out as side-by-side columns.", "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
\nCreates 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.
\nFor 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}]}, "DeltaGenerator.container": {"name": "container", "signature": "element.container(self)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Insert a multi-element container.", "args": []}, "DeltaGenerator.dataframe": {"name": "dataframe", "signature": "element.dataframe(self, data=None, width=None, height=None)", "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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.
\nIf '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 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 UI element expressed in pixels. If None, a\ndefault height is used.
\n", "default": "height"}]}, "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)", "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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}]}, "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)", "examples": "\nDownload 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>>>\n>>> csv = convert_df(my_large_df)\n>>>\n>>> st.download_button(\n... label="Download data as CSV",\n... data=csv,\n... file_name='large_df.csv',\n... mime='text/csv',\n... )\n
\nDownload a string as a file:
\n\n>>> text_contents = '''This is some text'''\n>>> st.download_button('Download some text', text_contents)\n
\nDownload a binary file:
\n\n>>> binary_contents = b'example content'\n>>> # Defaults to 'application/octet-stream'\n>>> st.download_button('Download binary file', binary_contents)\n
\nDownload an image:
\n\n>>> with 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", "description": "Display a download 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": "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}]}, "DeltaGenerator.empty": {"name": "empty", "signature": "element.empty(self)", "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n", "description": "Insert a single-element container.", "args": []}, "DeltaGenerator.error": {"name": "error", "signature": "element.error(self, body)", "example": "\n\n>>> st.error('This is an error')\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}]}, "DeltaGenerator.exception": {"name": "exception", "signature": "element.exception(self, exception)", "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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}]}, "DeltaGenerator.expander": {"name": "expander", "signature": "element.expander(self, label, expanded=False)", "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n", "description": "Insert a multi-element container that can be expanded/collapsed.", "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"}]}, "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)", "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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", "description": "Display a file uploader widget.", "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", "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}]}, "DeltaGenerator.form": {"name": "form", "signature": "element.form(self, key, clear_on_submit=False)", "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n", "description": "Create a form that batches elements together with a \"Submit\" button.", "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"}]}, "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.", "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}]}, "DeltaGenerator.graphviz_chart": {"name": "graphviz_chart", "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)", "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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}]}, "DeltaGenerator.header": {"name": "header", "signature": "element.header(self, body, anchor=None)", "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "DeltaGenerator.help": {"name": "help", "signature": "element.help(self, obj)", "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n", "description": "Display object's doc string, nicely formatted.", "args": [{"name": "obj", "type_name": "Object", "is_optional": false, "description": "The object whose docstring should be displayed.
\n", "default": null}]}, "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"}]}, "DeltaGenerator.info": {"name": "info", "signature": "element.info(self, body)", "example": "\n\n>>> st.info('This is a purely informational message')\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}]}, "DeltaGenerator.is_negative": {"name": "is_negative", "signature": "element.is_negative(self, delta)"}, "DeltaGenerator.json": {"name": "json", "signature": "element.json(self, body)", "example": "\n\n>>> st.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}]}, "DeltaGenerator.latex": {"name": "latex", "signature": "element.latex(self, body)", "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display mathematical expressions formatted as LaTeX.", "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}]}, "DeltaGenerator.line_chart": {"name": "line_chart", "signature": "element.line_chart(self, data=None, width=0, height=0, use_container_width=True)", "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a line chart.", "args": [{"name": "data", "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", "default": null}, {"name": "width", "type_name": "int", "is_optional": false, "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.
\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.
\n", "default": null}]}, "DeltaGenerator.map": {"name": "map", "signature": "element.map(self, data=None, zoom=None, use_container_width=True)", "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a map with points on it.", "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}]}, "DeltaGenerator.markdown": {"name": "markdown", "signature": "element.markdown(self, body, unsafe_allow_html=False)", "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n", "default": null}]}, "DeltaGenerator.metric": {"name": "metric", "signature": "element.metric(self, label, value, delta=None, delta_color=\"normal\")", "example": "\n\n>>> st.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\n>>> col1, col2, col3 = st.columns(3)\n>>> col1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\n>>> col2.metric("Wind", "9 mph", "-8%")\n>>> col3.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\n>>> st.metric(label="Gas price", value=4, delta=-0.5,\n... delta_color="inverse")\n>>>\n>>> st.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.", "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}]}, "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)", "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n", "description": "Display a multiselect widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this select widget 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 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": "[str] or None", "is_optional": false, "description": "List of default values.
\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 selectbox.
\n", "default": null}, {"name": "key", "type_name": "str or int", "is_optional": false, "description": "An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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}]}, "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)", "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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}]}, "DeltaGenerator.parse_delta": {"name": "parse_delta", "signature": "element.parse_delta(self, delta)"}, "DeltaGenerator.parse_label": {"name": "parse_label", "signature": "element.parse_label(self, label)"}, "DeltaGenerator.parse_value": {"name": "parse_value", "signature": "element.parse_value(self, value)"}, "DeltaGenerator.plotly_chart": {"name": "plotly_chart", "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)", "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.", "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
\nSee 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://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}, {"name": "To show Plotly charts in Streamlit, call `st.plotly_chart`", "type_name": null, "is_optional": null, "description": "", "default": null}, {"name": "wherever you would call Plotly's `py.plot` or `py.iplot`.", "type_name": null, "is_optional": null, "description": "", "default": null}]}, "DeltaGenerator.progress": {"name": "progress", "signature": "element.progress(self, value)", "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n", "default": null}]}, "DeltaGenerator.pydeck_chart": {"name": "pydeck_chart", "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)", "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.", "args": [{"name": "spec", "type_name": "pydeck.Deck or None", "is_optional": false, "description": "Object specifying the PyDeck chart to draw.
\n", "default": null}]}, "DeltaGenerator.pyplot": {"name": "pyplot", "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)", "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n", "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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}]}, "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)", "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\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}]}, "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)", "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n", "description": "Display a slider widget to select items from a list.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "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": "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}]}, "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)", "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\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}]}, "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)", "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n", "description": "Display a slider widget.", "args": [{"name": "label", "type_name": "str", "is_optional": false, "description": "A short label explaining to the user what this slider is for.
\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}]}, "DeltaGenerator.subheader": {"name": "subheader", "signature": "element.subheader(self, body, anchor=None)", "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "DeltaGenerator.success": {"name": "success", "signature": "element.success(self, body)", "example": "\n\n>>> st.success('This is a success message!')\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}]}, "DeltaGenerator.table": {"name": "table", "signature": "element.table(self, data=None)", "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display a static table.", "args": [{"name": "data", "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", "default": null}]}, "DeltaGenerator.text": {"name": "text", "signature": "element.text(self, body)", "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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}]}, "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)", "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n", "default": null}, {"name": "value", "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}, {"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}]}, "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)", "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n", "default": null}, {"name": "value", "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}, {"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}]}, "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)", "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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}]}, "DeltaGenerator.title": {"name": "title", "signature": "element.title(self, body, anchor=None)", "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Display text in title 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}]}, "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\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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}]}, "DeltaGenerator.video": {"name": "video", "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)", "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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}]}, "DeltaGenerator.warning": {"name": "warning", "signature": "element.warning(self, body)", "example": "\n\n>>> st.warning('This is a warning')\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}]}, "DeltaGenerator.write": {"name": "write", "signature": "element.write(self, *args, **kwargs)", "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n", "description": "Write arguments to the app.", "args": [{"name": "*args", "type_name": "any", "is_optional": false, "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n", "default": "False."}]}}}
\ No newline at end of file
+{
+ "0.81.0": {
+ "streamlit.altair_chart": {
+ "name": "altair_chart",
+ "signature": "st.altair_chart(altair_chart, use_container_width=False)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.
\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
+ }
+ ]
+ },
+ "streamlit.area_chart": {
+ "name": "area_chart",
+ "signature": "st.area_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display an area chart.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict",
+ "is_optional": false,
+ "description": "Data to be plotted.
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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 width 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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.audio": {
+ "name": "audio",
+ "signature": "st.audio(data, format=\"audio/wav\", start_time=0)",
+ "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n",
+ "default": "s"
+ }
+ ]
+ },
+ "streamlit.balloons": {
+ "name": "balloons",
+ "signature": "st.balloons()",
+ "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n",
+ "description": "Draw celebratory balloons.",
+ "args": []
+ },
+ "streamlit.bar_chart": {
+ "name": "bar_chart",
+ "signature": "st.bar_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a bar chart.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict",
+ "is_optional": false,
+ "description": "Data to be plotted.
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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 width 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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.beta_columns": {
+ "name": "beta_columns",
+ "signature": "st.beta_columns(spec)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.beta_columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.beta_columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor example, st.beta_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
+ }
+ ]
+ },
+ "streamlit.beta_container": {
+ "name": "beta_container",
+ "signature": "st.beta_container()",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with st.beta_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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.beta_container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "streamlit.beta_expander": {
+ "name": "beta_expander",
+ "signature": "st.beta_expander(label=None, expanded=False)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with st.beta_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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "streamlit.bokeh_chart": {
+ "name": "bokeh_chart",
+ "signature": "st.bokeh_chart(figure, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.",
+ "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
+ },
+ {
+ "name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Bokeh's `show`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.button": {
+ "name": "button",
+ "signature": "st.button(label, key=None, help=None)",
+ "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 when the button is hovered over.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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\n... def fetch_and_clean_data(url):\n... # Fetch data from URL here, and then clean it up.\n... return data\n...\n>>> d1 = fetch_and_clean_data(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> d2 = 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>>>\n>>> d3 = fetch_and_clean_data(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nTo 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
\nTo 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
\nTo 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
\nAlternatively, 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",
+ "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 normally shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.
\nIf 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 functions 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."
+ }
+ ]
+ },
+ "streamlit.caption": {
+ "name": "caption",
+ "signature": "st.caption(body)",
+ "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in small font.",
+ "args": [
+ {
+ "name": "body",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "The text to display.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.checkbox": {
+ "name": "checkbox",
+ "signature": "st.checkbox(label, value=False, key=None, help=None)",
+ "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 checkbox.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.code": {
+ "name": "code",
+ "signature": "st.code(body, language=\"python\")",
+ "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a code block with optional syntax highlighting.",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.color_picker": {
+ "name": "color_picker",
+ "signature": "st.color_picker(label, value=None, key=None, help=None)",
+ "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "type_name": "str or None",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 color picker.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.dataframe": {
+ "name": "dataframe",
+ "signature": "st.dataframe(data=None, width=None, height=None)",
+ "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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, numpy.ndarray, Iterable, dict,",
+ "is_optional": false,
+ "description": "or None\nThe data to display.
\nIf '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!
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int or None",
+ "is_optional": false,
+ "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 UI element expressed in pixels. If None, a\ndefault height is used.
\n",
+ "default": "height"
+ }
+ ]
+ },
+ "streamlit.date_input": {
+ "name": "date_input",
+ "signature": "st.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None)",
+ "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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. Defaults to today-10y.
\n",
+ "default": "today-10y."
+ },
+ {
+ "name": "max_value",
+ "type_name": "datetime.date or datetime.datetime",
+ "is_optional": false,
+ "description": "The maximum selectable date. Defaults to today+10y.
\n",
+ "default": "today"
+ },
+ {
+ "name": "key",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.echo": {
+ "name": "echo",
+ "signature": "st.echo(code_location=\"above\")",
+ "example": "\n\n>>> with 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
+ }
+ ]
+ },
+ "streamlit.empty": {
+ "name": "empty",
+ "signature": "st.empty()",
+ "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.beta_container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n",
+ "description": "Insert a single-element container.",
+ "args": []
+ },
+ "streamlit.error": {
+ "name": "error",
+ "signature": "st.error(body)",
+ "example": "\n\n>>> st.error('This is an error')\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
+ }
+ ]
+ },
+ "streamlit.exception": {
+ "name": "exception",
+ "signature": "st.exception(exception)",
+ "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.experimental_get_query_params": {
+ "name": "experimental_get_query_params",
+ "signature": "st.experimental_get_query_params()",
+ "example": "\nLet'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\n>>> st.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\nNote 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": []
+ },
+ "streamlit.experimental_rerun": {
+ "name": "experimental_rerun",
+ "signature": "st.experimental_rerun()",
+ "description": "Rerun the script immediately.",
+ "args": []
+ },
+ "streamlit.experimental_set_query_params": {
+ "name": "experimental_set_query_params",
+ "signature": "st.experimental_set_query_params(**query_params)",
+ "example": "\nTo 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\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.experimental_show": {
+ "name": "experimental_show",
+ "signature": "st.experimental_show(*args)",
+ "notes": "\nThis 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- When passing multiple arguments the inclusion of , or ) in a string
\n
\n \nargument may cause an error.
\n
\n",
+ "example": "\n\n>>> dataframe = pd.DataFrame({\n... 'first column': [1, 2, 3, 4],\n... 'second column': [10, 20, 30, 40],\n... }))\n>>> st.experimental_show(dataframe)\n
\n
\n",
+ "description": "Write arguments and *argument names* to your app for debugging purposes.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to debug in the App.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.file_uploader": {
+ "name": "file_uploader",
+ "signature": "st.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None)",
+ "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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",
+ "description": "Display a file uploader widget.",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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
+ }
+ ]
+ },
+ "streamlit.form": {
+ "name": "form",
+ "signature": "st.form(key)",
+ "description": "Create a form that batches elements together with a \"Submit\" button.",
+ "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
+ }
+ ]
+ },
+ "streamlit.form_submit_button": {
+ "name": "form_submit_button",
+ "signature": "st.form_submit_button(label=\"Submit\")",
+ "description": "Display a form submit button.",
+ "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"
+ }
+ ]
+ },
+ "streamlit.get_option": {
+ "name": "get_option",
+ "signature": "st.get_option(key)",
+ "description": "Return the current value of a given Streamlit config option.",
+ "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
+ }
+ ]
+ },
+ "streamlit.graphviz_chart": {
+ "name": "graphviz_chart",
+ "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.header": {
+ "name": "header",
+ "signature": "st.header(body, anchor=None)",
+ "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "streamlit.help": {
+ "name": "help",
+ "signature": "st.help(obj)",
+ "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n",
+ "description": "Display object's doc string, nicely formatted.",
+ "args": [
+ {
+ "name": "obj",
+ "type_name": "Object",
+ "is_optional": false,
+ "description": "The object whose docstring should be displayed.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"
+ }
+ ]
+ },
+ "streamlit.info": {
+ "name": "info",
+ "signature": "st.info(body)",
+ "example": "\n\n>>> st.info('This is a purely informational message')\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
+ }
+ ]
+ },
+ "streamlit.json": {
+ "name": "json",
+ "signature": "st.json(body)",
+ "example": "\n\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.latex": {
+ "name": "latex",
+ "signature": "st.latex(body)",
+ "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display mathematical expressions formatted as LaTeX.",
+ "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
+ }
+ ]
+ },
+ "streamlit.line_chart": {
+ "name": "line_chart",
+ "signature": "st.line_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a line chart.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict",
+ "is_optional": false,
+ "description": "or None\nData to be plotted.
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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 width 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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.map": {
+ "name": "map",
+ "signature": "st.map(data=None, zoom=None, use_container_width=True)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a map with points on it.",
+ "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
+ }
+ ]
+ },
+ "streamlit.markdown": {
+ "name": "markdown",
+ "signature": "st.markdown(body, unsafe_allow_html=False)",
+ "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.multiselect": {
+ "name": "multiselect",
+ "signature": "st.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None)",
+ "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n",
+ "description": "Display a multiselect widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this select widget is for.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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": "[str] or None",
+ "is_optional": false,
+ "description": "List of default values.
\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 selectbox.
\n",
+ "default": null
+ },
+ {
+ "name": "key",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 multiselect.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.object_beta_warning": {
+ "name": "object_beta_warning",
+ "signature": "st.object_beta_warning(obj, obj_name, date)",
+ "description": "Wrapper for objects that are no longer in beta.",
+ "args": [
+ {
+ "name": "obj",
+ "type_name": "Any",
+ "is_optional": false,
+ "description": "The st. object that used to be in beta.
\n",
+ "default": null
+ },
+ {
+ "name": "obj_name",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "The name of the object within __init__.py
\n",
+ "default": null
+ },
+ {
+ "name": "date",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A date like "2020-01-01", indicating the last day we'll guarantee\nsupport for the beta_ prefix.
\n \n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.plotly_chart": {
+ "name": "plotly_chart",
+ "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)",
+ "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.",
+ "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
\nSee 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://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
+ },
+ {
+ "name": "To show Plotly charts in Streamlit, call `st.plotly_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Plotly's `py.plot` or `py.iplot`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.progress": {
+ "name": "progress",
+ "signature": "st.progress(value)",
+ "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.pydeck_chart": {
+ "name": "pydeck_chart",
+ "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)",
+ "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.",
+ "args": [
+ {
+ "name": "spec",
+ "type_name": "pydeck.Deck or None",
+ "is_optional": false,
+ "description": "Object specifying the PyDeck chart to draw.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.pyplot": {
+ "name": "pyplot",
+ "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)",
+ "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n",
+ "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.radio": {
+ "name": "radio",
+ "signature": "st.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None)",
+ "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 radio.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.select_slider": {
+ "name": "select_slider",
+ "signature": "st.select_slider(label, options=[], value=None, format_func=special_internal_function, key=None, help=None)",
+ "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n",
+ "description": "Display a slider widget to select items from a list.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this slider is for.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 select slider.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.selectbox": {
+ "name": "selectbox",
+ "signature": "st.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None)",
+ "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 selectbox.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.set_option": {
+ "name": "set_option",
+ "signature": "st.set_option(key, value)",
+ "description": "Set config option.",
+ "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
+ }
+ ]
+ },
+ "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\")",
+ "example": "\n>>> st.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... )\n
\n",
+ "description": "Configures the default settings of the page.",
+ "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"
+ }
+ ]
+ },
+ "streamlit.slider": {
+ "name": "slider",
+ "signature": "st.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None)",
+ "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n",
+ "description": "Display a slider widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this slider is for.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 slider.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.spinner": {
+ "name": "spinner",
+ "signature": "st.spinner(text=\"In progress...\")",
+ "example": "\n\n>>> with st.spinner('Wait for it...'):\n>>> time.sleep(5)\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.stop": {
+ "name": "stop",
+ "signature": "st.stop()",
+ "example": "\n\n>>> name = st.text_input('Name')\n>>> if not name:\n>>> st.warning('Please input a name.')\n>>> st.stop()\n>>> st.success('Thank you for inputting a name.')\n
\n
\n",
+ "description": "Stops execution immediately.",
+ "args": []
+ },
+ "streamlit.subheader": {
+ "name": "subheader",
+ "signature": "st.subheader(body, anchor=None)",
+ "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "streamlit.success": {
+ "name": "success",
+ "signature": "st.success(body)",
+ "example": "\n\n>>> st.success('This is a success message!')\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
+ }
+ ]
+ },
+ "streamlit.table": {
+ "name": "table",
+ "signature": "st.table(data=None)",
+ "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a static table.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,",
+ "is_optional": false,
+ "description": "or None\nThe table data.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.text": {
+ "name": "text",
+ "signature": "st.text(body)",
+ "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "streamlit.text_area": {
+ "name": "text_area",
+ "signature": "st.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None)",
+ "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 textarea.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.text_input": {
+ "name": "text_input",
+ "signature": "st.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None)",
+ "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be 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": "A tooltip that gets displayed next to the input.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.time_input": {
+ "name": "time_input",
+ "signature": "st.time_input(label, value=None, key=None, help=None)",
+ "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.title": {
+ "name": "title",
+ "signature": "st.title(body, anchor=None)",
+ "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in title 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
+ }
+ ]
+ },
+ "streamlit.vega_lite_chart": {
+ "name": "vega_lite_chart",
+ "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, **kwargs)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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, numpy.ndarray, Iterable, dict,",
+ "is_optional": false,
+ "description": "or None\nEither the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).
\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
+ }
+ ]
+ },
+ "streamlit.video": {
+ "name": "video",
+ "signature": "st.video(data, format=\"video/mp4\", start_time=0)",
+ "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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
+ }
+ ]
+ },
+ "streamlit.warning": {
+ "name": "warning",
+ "signature": "st.warning(body)",
+ "example": "\n\n>>> st.warning('This is a warning')\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
+ }
+ ]
+ },
+ "streamlit.write": {
+ "name": "write",
+ "signature": "st.write(*args, **kwargs)",
+ "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Write arguments to the app.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n",
+ "default": "False."
+ }
+ ]
+ },
+ "DeltaGenerator.add_rows": {
+ "name": "add_rows",
+ "signature": "element.add_rows(self, data=None, **kwargs)",
+ "example": "\n\n>>> df1 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_table = st.table(df1)\n>>>\n>>> df2 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_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
\nYou 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...\n>>> my_chart = st.line_chart(df1)\n>>> my_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
\nAnd for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:
\n\n>>> my_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... }),\n>>> my_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, numpy.ndarray, Iterable, dict,",
+ "is_optional": false,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "or None",
+ "type_name": null,
+ "is_optional": null,
+ "description": "Table to concat. Optional.
\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
+ }
+ ]
+ },
+ "DeltaGenerator.altair_chart": {
+ "name": "altair_chart",
+ "signature": "element.altair_chart(self, altair_chart, use_container_width=False)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.
\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
+ }
+ ]
+ },
+ "DeltaGenerator.area_chart": {
+ "name": "area_chart",
+ "signature": "element.area_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display an area chart.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict",
+ "is_optional": false,
+ "description": "Data to be plotted.
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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 width 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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.audio": {
+ "name": "audio",
+ "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0)",
+ "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n",
+ "default": "s"
+ }
+ ]
+ },
+ "DeltaGenerator.balloons": {
+ "name": "balloons",
+ "signature": "element.balloons(self)",
+ "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n",
+ "description": "Draw celebratory balloons.",
+ "args": []
+ },
+ "DeltaGenerator.bar_chart": {
+ "name": "bar_chart",
+ "signature": "element.bar_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a bar chart.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict",
+ "is_optional": false,
+ "description": "Data to be plotted.
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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 width 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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.beta_columns": {
+ "name": "beta_columns",
+ "signature": "element.beta_columns(self, spec)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.beta_columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.beta_columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor example, st.beta_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
+ }
+ ]
+ },
+ "DeltaGenerator.beta_container": {
+ "name": "beta_container",
+ "signature": "element.beta_container(self)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with st.beta_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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.beta_container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "DeltaGenerator.beta_expander": {
+ "name": "beta_expander",
+ "signature": "element.beta_expander(self, label=None, expanded=False)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with st.beta_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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "DeltaGenerator.bokeh_chart": {
+ "name": "bokeh_chart",
+ "signature": "element.bokeh_chart(self, figure, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.",
+ "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
+ },
+ {
+ "name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Bokeh's `show`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.button": {
+ "name": "button",
+ "signature": "element.button(self, label, key=None, help=None)",
+ "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 when the button is hovered over.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.caption": {
+ "name": "caption",
+ "signature": "element.caption(self, body)",
+ "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in small font.",
+ "args": [
+ {
+ "name": "body",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "The text to display.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.checkbox": {
+ "name": "checkbox",
+ "signature": "element.checkbox(self, label, value=False, key=None, help=None)",
+ "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 checkbox.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.code": {
+ "name": "code",
+ "signature": "element.code(self, body, language=\"python\")",
+ "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a code block with optional syntax highlighting.",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.color_picker": {
+ "name": "color_picker",
+ "signature": "element.color_picker(self, label, value=None, key=None, help=None)",
+ "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "type_name": "str or None",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 color picker.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.dataframe": {
+ "name": "dataframe",
+ "signature": "element.dataframe(self, data=None, width=None, height=None)",
+ "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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, numpy.ndarray, Iterable, dict,",
+ "is_optional": false,
+ "description": "or None\nThe data to display.
\nIf '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!
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int or None",
+ "is_optional": false,
+ "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 UI element expressed in pixels. If None, a\ndefault height is used.
\n",
+ "default": "height"
+ }
+ ]
+ },
+ "DeltaGenerator.date_input": {
+ "name": "date_input",
+ "signature": "element.date_input(self, label, value=None, min_value=None, max_value=None, key=None, help=None)",
+ "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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. Defaults to today-10y.
\n",
+ "default": "today-10y."
+ },
+ {
+ "name": "max_value",
+ "type_name": "datetime.date or datetime.datetime",
+ "is_optional": false,
+ "description": "The maximum selectable date. Defaults to today+10y.
\n",
+ "default": "today"
+ },
+ {
+ "name": "key",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.empty": {
+ "name": "empty",
+ "signature": "element.empty(self)",
+ "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.beta_container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n",
+ "description": "Insert a single-element container.",
+ "args": []
+ },
+ "DeltaGenerator.error": {
+ "name": "error",
+ "signature": "element.error(self, body)",
+ "example": "\n\n>>> st.error('This is an error')\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
+ }
+ ]
+ },
+ "DeltaGenerator.exception": {
+ "name": "exception",
+ "signature": "element.exception(self, exception)",
+ "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.file_uploader": {
+ "name": "file_uploader",
+ "signature": "element.file_uploader(self, label, type=None, accept_multiple_files=False, key=None, help=None)",
+ "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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",
+ "description": "Display a file uploader widget.",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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
+ }
+ ]
+ },
+ "DeltaGenerator.form": {
+ "name": "form",
+ "signature": "element.form(self, key)",
+ "description": "Create a form that batches elements together with a \"Submit\" button.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.form_submit_button": {
+ "name": "form_submit_button",
+ "signature": "element.form_submit_button(self, label=\"Submit\")",
+ "description": "Display a form submit button.",
+ "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"
+ }
+ ]
+ },
+ "DeltaGenerator.graphviz_chart": {
+ "name": "graphviz_chart",
+ "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.header": {
+ "name": "header",
+ "signature": "element.header(self, body, anchor=None)",
+ "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "DeltaGenerator.help": {
+ "name": "help",
+ "signature": "element.help(self, obj)",
+ "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n",
+ "description": "Display object's doc string, nicely formatted.",
+ "args": [
+ {
+ "name": "obj",
+ "type_name": "Object",
+ "is_optional": false,
+ "description": "The object whose docstring should be displayed.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"
+ }
+ ]
+ },
+ "DeltaGenerator.info": {
+ "name": "info",
+ "signature": "element.info(self, body)",
+ "example": "\n\n>>> st.info('This is a purely informational message')\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
+ }
+ ]
+ },
+ "DeltaGenerator.json": {
+ "name": "json",
+ "signature": "element.json(self, body)",
+ "example": "\n\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.latex": {
+ "name": "latex",
+ "signature": "element.latex(self, body)",
+ "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display mathematical expressions formatted as LaTeX.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.line_chart": {
+ "name": "line_chart",
+ "signature": "element.line_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a line chart.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict",
+ "is_optional": false,
+ "description": "or None\nData to be plotted.
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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 width 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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.map": {
+ "name": "map",
+ "signature": "element.map(self, data=None, zoom=None, use_container_width=True)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a map with points on it.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.markdown": {
+ "name": "markdown",
+ "signature": "element.markdown(self, body, unsafe_allow_html=False)",
+ "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.multiselect": {
+ "name": "multiselect",
+ "signature": "element.multiselect(self, label, options, default=None, format_func=special_internal_function, key=None, help=None)",
+ "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n",
+ "description": "Display a multiselect widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this select widget is for.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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": "[str] or None",
+ "is_optional": false,
+ "description": "List of default values.
\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 selectbox.
\n",
+ "default": null
+ },
+ {
+ "name": "key",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 multiselect.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.plotly_chart": {
+ "name": "plotly_chart",
+ "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)",
+ "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.",
+ "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
\nSee 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://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
+ },
+ {
+ "name": "To show Plotly charts in Streamlit, call `st.plotly_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Plotly's `py.plot` or `py.iplot`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.progress": {
+ "name": "progress",
+ "signature": "element.progress(self, value)",
+ "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.pydeck_chart": {
+ "name": "pydeck_chart",
+ "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)",
+ "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.",
+ "args": [
+ {
+ "name": "spec",
+ "type_name": "pydeck.Deck or None",
+ "is_optional": false,
+ "description": "Object specifying the PyDeck chart to draw.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.pyplot": {
+ "name": "pyplot",
+ "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)",
+ "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n",
+ "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.radio": {
+ "name": "radio",
+ "signature": "element.radio(self, label, options, index=0, format_func=special_internal_function, key=None, help=None)",
+ "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 radio.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.select_slider": {
+ "name": "select_slider",
+ "signature": "element.select_slider(self, label, options=[], value=None, format_func=special_internal_function, key=None, help=None)",
+ "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n",
+ "description": "Display a slider widget to select items from a list.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this slider is for.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 select slider.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.selectbox": {
+ "name": "selectbox",
+ "signature": "element.selectbox(self, label, options, index=0, format_func=special_internal_function, key=None, help=None)",
+ "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 selectbox.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n",
+ "description": "Display a slider widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this slider is for.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 slider.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.subheader": {
+ "name": "subheader",
+ "signature": "element.subheader(self, body, anchor=None)",
+ "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "DeltaGenerator.success": {
+ "name": "success",
+ "signature": "element.success(self, body)",
+ "example": "\n\n>>> st.success('This is a success message!')\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
+ }
+ ]
+ },
+ "DeltaGenerator.table": {
+ "name": "table",
+ "signature": "element.table(self, data=None)",
+ "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a static table.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,",
+ "is_optional": false,
+ "description": "or None\nThe table data.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.text": {
+ "name": "text",
+ "signature": "element.text(self, body)",
+ "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "DeltaGenerator.text_area": {
+ "name": "text_area",
+ "signature": "element.text_area(self, label, value=\"\", height=None, max_chars=None, key=None, help=None)",
+ "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 textarea.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.text_input": {
+ "name": "text_input",
+ "signature": "element.text_input(self, label, value=\"\", max_chars=None, key=None, type=\"default\", help=None)",
+ "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be 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": "A tooltip that gets displayed next to the input.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.time_input": {
+ "name": "time_input",
+ "signature": "element.time_input(self, label, value=None, key=None, help=None)",
+ "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.title": {
+ "name": "title",
+ "signature": "element.title(self, body, anchor=None)",
+ "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in title 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
+ }
+ ]
+ },
+ "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\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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, numpy.ndarray, Iterable, dict,",
+ "is_optional": false,
+ "description": "or None\nEither the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).
\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
+ }
+ ]
+ },
+ "DeltaGenerator.video": {
+ "name": "video",
+ "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)",
+ "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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
+ }
+ ]
+ },
+ "DeltaGenerator.warning": {
+ "name": "warning",
+ "signature": "element.warning(self, body)",
+ "example": "\n\n>>> st.warning('This is a warning')\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
+ }
+ ]
+ },
+ "DeltaGenerator.write": {
+ "name": "write",
+ "signature": "element.write(self, *args, **kwargs)",
+ "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Write arguments to the app.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n",
+ "default": "False."
+ }
+ ]
+ }
+ },
+ "0.82.0": {
+ "streamlit.altair_chart": {
+ "name": "altair_chart",
+ "signature": "st.altair_chart(altair_chart, use_container_width=False)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.
\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
+ }
+ ]
+ },
+ "streamlit.area_chart": {
+ "name": "area_chart",
+ "signature": "st.area_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display an area chart.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict",
+ "is_optional": false,
+ "description": "Data to be plotted.
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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 width 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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.audio": {
+ "name": "audio",
+ "signature": "st.audio(data, format=\"audio/wav\", start_time=0)",
+ "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n",
+ "default": "s"
+ }
+ ]
+ },
+ "streamlit.balloons": {
+ "name": "balloons",
+ "signature": "st.balloons()",
+ "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n",
+ "description": "Draw celebratory balloons.",
+ "args": []
+ },
+ "streamlit.bar_chart": {
+ "name": "bar_chart",
+ "signature": "st.bar_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a bar chart.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict",
+ "is_optional": false,
+ "description": "Data to be plotted.
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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 width 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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.beta_columns": {
+ "name": "beta_columns",
+ "signature": "st.beta_columns(spec)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.beta_columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.beta_columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor example, st.beta_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
+ }
+ ]
+ },
+ "streamlit.beta_container": {
+ "name": "beta_container",
+ "signature": "st.beta_container()",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with st.beta_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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.beta_container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "streamlit.beta_expander": {
+ "name": "beta_expander",
+ "signature": "st.beta_expander(label=None, expanded=False)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with st.beta_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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "streamlit.bokeh_chart": {
+ "name": "bokeh_chart",
+ "signature": "st.bokeh_chart(figure, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.",
+ "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
+ },
+ {
+ "name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Bokeh's `show`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.button": {
+ "name": "button",
+ "signature": "st.button(label, key=None, help=None)",
+ "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 when the button is hovered over.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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\n... def fetch_and_clean_data(url):\n... # Fetch data from URL here, and then clean it up.\n... return data\n...\n>>> d1 = fetch_and_clean_data(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> d2 = 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>>>\n>>> d3 = fetch_and_clean_data(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nTo 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
\nTo 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
\nTo 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
\nAlternatively, 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",
+ "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 normally shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.
\nIf 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 functions 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."
+ }
+ ]
+ },
+ "streamlit.caption": {
+ "name": "caption",
+ "signature": "st.caption(body)",
+ "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in small font.",
+ "args": [
+ {
+ "name": "body",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "The text to display.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.checkbox": {
+ "name": "checkbox",
+ "signature": "st.checkbox(label, value=False, key=None, help=None)",
+ "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 checkbox.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.code": {
+ "name": "code",
+ "signature": "st.code(body, language=\"python\")",
+ "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a code block with optional syntax highlighting.",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.color_picker": {
+ "name": "color_picker",
+ "signature": "st.color_picker(label, value=None, key=None, help=None)",
+ "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "type_name": "str or None",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 color picker.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.dataframe": {
+ "name": "dataframe",
+ "signature": "st.dataframe(data=None, width=None, height=None)",
+ "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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, numpy.ndarray, Iterable, dict,",
+ "is_optional": false,
+ "description": "or None\nThe data to display.
\nIf '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!
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int or None",
+ "is_optional": false,
+ "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 UI element expressed in pixels. If None, a\ndefault height is used.
\n",
+ "default": "height"
+ }
+ ]
+ },
+ "streamlit.date_input": {
+ "name": "date_input",
+ "signature": "st.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None)",
+ "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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. Defaults to today-10y.
\n",
+ "default": "today-10y."
+ },
+ {
+ "name": "max_value",
+ "type_name": "datetime.date or datetime.datetime",
+ "is_optional": false,
+ "description": "The maximum selectable date. Defaults to today+10y.
\n",
+ "default": "today"
+ },
+ {
+ "name": "key",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.echo": {
+ "name": "echo",
+ "signature": "st.echo(code_location=\"above\")",
+ "example": "\n\n>>> with 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
+ }
+ ]
+ },
+ "streamlit.empty": {
+ "name": "empty",
+ "signature": "st.empty()",
+ "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.beta_container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n",
+ "description": "Insert a single-element container.",
+ "args": []
+ },
+ "streamlit.error": {
+ "name": "error",
+ "signature": "st.error(body)",
+ "example": "\n\n>>> st.error('This is an error')\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
+ }
+ ]
+ },
+ "streamlit.exception": {
+ "name": "exception",
+ "signature": "st.exception(exception)",
+ "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.experimental_get_query_params": {
+ "name": "experimental_get_query_params",
+ "signature": "st.experimental_get_query_params()",
+ "example": "\nLet'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\n>>> st.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\nNote 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": []
+ },
+ "streamlit.experimental_rerun": {
+ "name": "experimental_rerun",
+ "signature": "st.experimental_rerun()",
+ "description": "Rerun the script immediately.",
+ "args": []
+ },
+ "streamlit.experimental_set_query_params": {
+ "name": "experimental_set_query_params",
+ "signature": "st.experimental_set_query_params(**query_params)",
+ "example": "\nTo 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\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.experimental_show": {
+ "name": "experimental_show",
+ "signature": "st.experimental_show(*args)",
+ "notes": "\nThis 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- When passing multiple arguments the inclusion of , or ) in a string
\n
\n \nargument may cause an error.
\n
\n",
+ "example": "\n\n>>> dataframe = pd.DataFrame({\n... 'first column': [1, 2, 3, 4],\n... 'second column': [10, 20, 30, 40],\n... }))\n>>> st.experimental_show(dataframe)\n
\n
\n",
+ "description": "Write arguments and *argument names* to your app for debugging purposes.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to debug in the App.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.file_uploader": {
+ "name": "file_uploader",
+ "signature": "st.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None)",
+ "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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",
+ "description": "Display a file uploader widget.",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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
+ }
+ ]
+ },
+ "streamlit.form": {
+ "name": "form",
+ "signature": "st.form(key)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n",
+ "description": "Create a form that batches elements together with a \"Submit\" button.",
+ "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
+ }
+ ]
+ },
+ "streamlit.form_submit_button": {
+ "name": "form_submit_button",
+ "signature": "st.form_submit_button(label=\"Submit\")",
+ "description": "Display a form submit button.",
+ "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"
+ }
+ ]
+ },
+ "streamlit.get_option": {
+ "name": "get_option",
+ "signature": "st.get_option(key)",
+ "description": "Return the current value of a given Streamlit config option.",
+ "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
+ }
+ ]
+ },
+ "streamlit.graphviz_chart": {
+ "name": "graphviz_chart",
+ "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.header": {
+ "name": "header",
+ "signature": "st.header(body, anchor=None)",
+ "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "streamlit.help": {
+ "name": "help",
+ "signature": "st.help(obj)",
+ "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n",
+ "description": "Display object's doc string, nicely formatted.",
+ "args": [
+ {
+ "name": "obj",
+ "type_name": "Object",
+ "is_optional": false,
+ "description": "The object whose docstring should be displayed.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"
+ }
+ ]
+ },
+ "streamlit.info": {
+ "name": "info",
+ "signature": "st.info(body)",
+ "example": "\n\n>>> st.info('This is a purely informational message')\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
+ }
+ ]
+ },
+ "streamlit.json": {
+ "name": "json",
+ "signature": "st.json(body)",
+ "example": "\n\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.latex": {
+ "name": "latex",
+ "signature": "st.latex(body)",
+ "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display mathematical expressions formatted as LaTeX.",
+ "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
+ }
+ ]
+ },
+ "streamlit.line_chart": {
+ "name": "line_chart",
+ "signature": "st.line_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a line chart.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict",
+ "is_optional": false,
+ "description": "or None\nData to be plotted.
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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 width 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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.map": {
+ "name": "map",
+ "signature": "st.map(data=None, zoom=None, use_container_width=True)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a map with points on it.",
+ "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
+ }
+ ]
+ },
+ "streamlit.markdown": {
+ "name": "markdown",
+ "signature": "st.markdown(body, unsafe_allow_html=False)",
+ "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.multiselect": {
+ "name": "multiselect",
+ "signature": "st.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None)",
+ "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n",
+ "description": "Display a multiselect widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this select widget is for.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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": "[str] or None",
+ "is_optional": false,
+ "description": "List of default values.
\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 selectbox.
\n",
+ "default": null
+ },
+ {
+ "name": "key",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 multiselect.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.object_beta_warning": {
+ "name": "object_beta_warning",
+ "signature": "st.object_beta_warning(obj, obj_name, date)",
+ "description": "Wrapper for objects that are no longer in beta.",
+ "args": [
+ {
+ "name": "obj",
+ "type_name": "Any",
+ "is_optional": false,
+ "description": "The st. object that used to be in beta.
\n",
+ "default": null
+ },
+ {
+ "name": "obj_name",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "The name of the object within __init__.py
\n",
+ "default": null
+ },
+ {
+ "name": "date",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A date like "2020-01-01", indicating the last day we'll guarantee\nsupport for the beta_ prefix.
\n \n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.plotly_chart": {
+ "name": "plotly_chart",
+ "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)",
+ "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.",
+ "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
\nSee 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://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
+ },
+ {
+ "name": "To show Plotly charts in Streamlit, call `st.plotly_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Plotly's `py.plot` or `py.iplot`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.progress": {
+ "name": "progress",
+ "signature": "st.progress(value)",
+ "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.pydeck_chart": {
+ "name": "pydeck_chart",
+ "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)",
+ "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.",
+ "args": [
+ {
+ "name": "spec",
+ "type_name": "pydeck.Deck or None",
+ "is_optional": false,
+ "description": "Object specifying the PyDeck chart to draw.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.pyplot": {
+ "name": "pyplot",
+ "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)",
+ "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n",
+ "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.radio": {
+ "name": "radio",
+ "signature": "st.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None)",
+ "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 radio.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.select_slider": {
+ "name": "select_slider",
+ "signature": "st.select_slider(label, options=[], value=None, format_func=special_internal_function, key=None, help=None)",
+ "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n",
+ "description": "Display a slider widget to select items from a list.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this slider is for.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 select slider.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.selectbox": {
+ "name": "selectbox",
+ "signature": "st.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None)",
+ "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 selectbox.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.set_option": {
+ "name": "set_option",
+ "signature": "st.set_option(key, value)",
+ "description": "Set config option.",
+ "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
+ }
+ ]
+ },
+ "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\")",
+ "example": "\n>>> st.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... )\n
\n",
+ "description": "Configures the default settings of the page.",
+ "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"
+ }
+ ]
+ },
+ "streamlit.slider": {
+ "name": "slider",
+ "signature": "st.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None)",
+ "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n",
+ "description": "Display a slider widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this slider is for.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 slider.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.spinner": {
+ "name": "spinner",
+ "signature": "st.spinner(text=\"In progress...\")",
+ "example": "\n\n>>> with st.spinner('Wait for it...'):\n>>> time.sleep(5)\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.stop": {
+ "name": "stop",
+ "signature": "st.stop()",
+ "example": "\n\n>>> name = st.text_input('Name')\n>>> if not name:\n>>> st.warning('Please input a name.')\n>>> st.stop()\n>>> st.success('Thank you for inputting a name.')\n
\n
\n",
+ "description": "Stops execution immediately.",
+ "args": []
+ },
+ "streamlit.subheader": {
+ "name": "subheader",
+ "signature": "st.subheader(body, anchor=None)",
+ "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "streamlit.success": {
+ "name": "success",
+ "signature": "st.success(body)",
+ "example": "\n\n>>> st.success('This is a success message!')\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
+ }
+ ]
+ },
+ "streamlit.table": {
+ "name": "table",
+ "signature": "st.table(data=None)",
+ "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a static table.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,",
+ "is_optional": false,
+ "description": "or None\nThe table data.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.text": {
+ "name": "text",
+ "signature": "st.text(body)",
+ "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "streamlit.text_area": {
+ "name": "text_area",
+ "signature": "st.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None)",
+ "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 textarea.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.text_input": {
+ "name": "text_input",
+ "signature": "st.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None)",
+ "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be 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": "A tooltip that gets displayed next to the input.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.time_input": {
+ "name": "time_input",
+ "signature": "st.time_input(label, value=None, key=None, help=None)",
+ "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.title": {
+ "name": "title",
+ "signature": "st.title(body, anchor=None)",
+ "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in title 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
+ }
+ ]
+ },
+ "streamlit.vega_lite_chart": {
+ "name": "vega_lite_chart",
+ "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, **kwargs)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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, numpy.ndarray, Iterable, dict,",
+ "is_optional": false,
+ "description": "or None\nEither the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).
\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
+ }
+ ]
+ },
+ "streamlit.video": {
+ "name": "video",
+ "signature": "st.video(data, format=\"video/mp4\", start_time=0)",
+ "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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
+ }
+ ]
+ },
+ "streamlit.warning": {
+ "name": "warning",
+ "signature": "st.warning(body)",
+ "example": "\n\n>>> st.warning('This is a warning')\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
+ }
+ ]
+ },
+ "streamlit.write": {
+ "name": "write",
+ "signature": "st.write(*args, **kwargs)",
+ "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Write arguments to the app.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n",
+ "default": "False."
+ }
+ ]
+ },
+ "DeltaGenerator.add_rows": {
+ "name": "add_rows",
+ "signature": "element.add_rows(self, data=None, **kwargs)",
+ "example": "\n\n>>> df1 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_table = st.table(df1)\n>>>\n>>> df2 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_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
\nYou 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...\n>>> my_chart = st.line_chart(df1)\n>>> my_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
\nAnd for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:
\n\n>>> my_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... }),\n>>> my_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, numpy.ndarray, Iterable, dict,",
+ "is_optional": false,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "or None",
+ "type_name": null,
+ "is_optional": null,
+ "description": "Table to concat. Optional.
\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
+ }
+ ]
+ },
+ "DeltaGenerator.altair_chart": {
+ "name": "altair_chart",
+ "signature": "element.altair_chart(self, altair_chart, use_container_width=False)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.
\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
+ }
+ ]
+ },
+ "DeltaGenerator.area_chart": {
+ "name": "area_chart",
+ "signature": "element.area_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display an area chart.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict",
+ "is_optional": false,
+ "description": "Data to be plotted.
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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 width 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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.audio": {
+ "name": "audio",
+ "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0)",
+ "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n",
+ "default": "s"
+ }
+ ]
+ },
+ "DeltaGenerator.balloons": {
+ "name": "balloons",
+ "signature": "element.balloons(self)",
+ "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n",
+ "description": "Draw celebratory balloons.",
+ "args": []
+ },
+ "DeltaGenerator.bar_chart": {
+ "name": "bar_chart",
+ "signature": "element.bar_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a bar chart.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict",
+ "is_optional": false,
+ "description": "Data to be plotted.
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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 width 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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.beta_columns": {
+ "name": "beta_columns",
+ "signature": "element.beta_columns(self, spec)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.beta_columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.beta_columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor example, st.beta_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
+ }
+ ]
+ },
+ "DeltaGenerator.beta_container": {
+ "name": "beta_container",
+ "signature": "element.beta_container(self)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with st.beta_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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.beta_container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "DeltaGenerator.beta_expander": {
+ "name": "beta_expander",
+ "signature": "element.beta_expander(self, label=None, expanded=False)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with st.beta_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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "DeltaGenerator.bokeh_chart": {
+ "name": "bokeh_chart",
+ "signature": "element.bokeh_chart(self, figure, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.",
+ "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
+ },
+ {
+ "name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Bokeh's `show`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.button": {
+ "name": "button",
+ "signature": "element.button(self, label, key=None, help=None)",
+ "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 when the button is hovered over.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.caption": {
+ "name": "caption",
+ "signature": "element.caption(self, body)",
+ "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in small font.",
+ "args": [
+ {
+ "name": "body",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "The text to display.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.checkbox": {
+ "name": "checkbox",
+ "signature": "element.checkbox(self, label, value=False, key=None, help=None)",
+ "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 checkbox.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.code": {
+ "name": "code",
+ "signature": "element.code(self, body, language=\"python\")",
+ "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a code block with optional syntax highlighting.",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.color_picker": {
+ "name": "color_picker",
+ "signature": "element.color_picker(self, label, value=None, key=None, help=None)",
+ "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "type_name": "str or None",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 color picker.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.dataframe": {
+ "name": "dataframe",
+ "signature": "element.dataframe(self, data=None, width=None, height=None)",
+ "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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, numpy.ndarray, Iterable, dict,",
+ "is_optional": false,
+ "description": "or None\nThe data to display.
\nIf '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!
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int or None",
+ "is_optional": false,
+ "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 UI element expressed in pixels. If None, a\ndefault height is used.
\n",
+ "default": "height"
+ }
+ ]
+ },
+ "DeltaGenerator.date_input": {
+ "name": "date_input",
+ "signature": "element.date_input(self, label, value=None, min_value=None, max_value=None, key=None, help=None)",
+ "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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. Defaults to today-10y.
\n",
+ "default": "today-10y."
+ },
+ {
+ "name": "max_value",
+ "type_name": "datetime.date or datetime.datetime",
+ "is_optional": false,
+ "description": "The maximum selectable date. Defaults to today+10y.
\n",
+ "default": "today"
+ },
+ {
+ "name": "key",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.empty": {
+ "name": "empty",
+ "signature": "element.empty(self)",
+ "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.beta_container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n",
+ "description": "Insert a single-element container.",
+ "args": []
+ },
+ "DeltaGenerator.error": {
+ "name": "error",
+ "signature": "element.error(self, body)",
+ "example": "\n\n>>> st.error('This is an error')\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
+ }
+ ]
+ },
+ "DeltaGenerator.exception": {
+ "name": "exception",
+ "signature": "element.exception(self, exception)",
+ "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.file_uploader": {
+ "name": "file_uploader",
+ "signature": "element.file_uploader(self, label, type=None, accept_multiple_files=False, key=None, help=None)",
+ "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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",
+ "description": "Display a file uploader widget.",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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
+ }
+ ]
+ },
+ "DeltaGenerator.form": {
+ "name": "form",
+ "signature": "element.form(self, key)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n",
+ "description": "Create a form that batches elements together with a \"Submit\" button.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.form_submit_button": {
+ "name": "form_submit_button",
+ "signature": "element.form_submit_button(self, label=\"Submit\")",
+ "description": "Display a form submit button.",
+ "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"
+ }
+ ]
+ },
+ "DeltaGenerator.graphviz_chart": {
+ "name": "graphviz_chart",
+ "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.header": {
+ "name": "header",
+ "signature": "element.header(self, body, anchor=None)",
+ "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "DeltaGenerator.help": {
+ "name": "help",
+ "signature": "element.help(self, obj)",
+ "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n",
+ "description": "Display object's doc string, nicely formatted.",
+ "args": [
+ {
+ "name": "obj",
+ "type_name": "Object",
+ "is_optional": false,
+ "description": "The object whose docstring should be displayed.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"
+ }
+ ]
+ },
+ "DeltaGenerator.info": {
+ "name": "info",
+ "signature": "element.info(self, body)",
+ "example": "\n\n>>> st.info('This is a purely informational message')\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
+ }
+ ]
+ },
+ "DeltaGenerator.json": {
+ "name": "json",
+ "signature": "element.json(self, body)",
+ "example": "\n\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.latex": {
+ "name": "latex",
+ "signature": "element.latex(self, body)",
+ "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display mathematical expressions formatted as LaTeX.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.line_chart": {
+ "name": "line_chart",
+ "signature": "element.line_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a line chart.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict",
+ "is_optional": false,
+ "description": "or None\nData to be plotted.
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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 width 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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.map": {
+ "name": "map",
+ "signature": "element.map(self, data=None, zoom=None, use_container_width=True)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a map with points on it.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.markdown": {
+ "name": "markdown",
+ "signature": "element.markdown(self, body, unsafe_allow_html=False)",
+ "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.multiselect": {
+ "name": "multiselect",
+ "signature": "element.multiselect(self, label, options, default=None, format_func=special_internal_function, key=None, help=None)",
+ "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n",
+ "description": "Display a multiselect widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this select widget is for.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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": "[str] or None",
+ "is_optional": false,
+ "description": "List of default values.
\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 selectbox.
\n",
+ "default": null
+ },
+ {
+ "name": "key",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 multiselect.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.plotly_chart": {
+ "name": "plotly_chart",
+ "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)",
+ "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.",
+ "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
\nSee 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://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
+ },
+ {
+ "name": "To show Plotly charts in Streamlit, call `st.plotly_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Plotly's `py.plot` or `py.iplot`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.progress": {
+ "name": "progress",
+ "signature": "element.progress(self, value)",
+ "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.pydeck_chart": {
+ "name": "pydeck_chart",
+ "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)",
+ "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.",
+ "args": [
+ {
+ "name": "spec",
+ "type_name": "pydeck.Deck or None",
+ "is_optional": false,
+ "description": "Object specifying the PyDeck chart to draw.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.pyplot": {
+ "name": "pyplot",
+ "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)",
+ "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n",
+ "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.radio": {
+ "name": "radio",
+ "signature": "element.radio(self, label, options, index=0, format_func=special_internal_function, key=None, help=None)",
+ "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 radio.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.select_slider": {
+ "name": "select_slider",
+ "signature": "element.select_slider(self, label, options=[], value=None, format_func=special_internal_function, key=None, help=None)",
+ "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n",
+ "description": "Display a slider widget to select items from a list.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this slider is for.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 select slider.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.selectbox": {
+ "name": "selectbox",
+ "signature": "element.selectbox(self, label, options, index=0, format_func=special_internal_function, key=None, help=None)",
+ "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 selectbox.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n",
+ "description": "Display a slider widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this slider is for.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 slider.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.subheader": {
+ "name": "subheader",
+ "signature": "element.subheader(self, body, anchor=None)",
+ "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "DeltaGenerator.success": {
+ "name": "success",
+ "signature": "element.success(self, body)",
+ "example": "\n\n>>> st.success('This is a success message!')\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
+ }
+ ]
+ },
+ "DeltaGenerator.table": {
+ "name": "table",
+ "signature": "element.table(self, data=None)",
+ "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a static table.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,",
+ "is_optional": false,
+ "description": "or None\nThe table data.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.text": {
+ "name": "text",
+ "signature": "element.text(self, body)",
+ "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "DeltaGenerator.text_area": {
+ "name": "text_area",
+ "signature": "element.text_area(self, label, value=\"\", height=None, max_chars=None, key=None, help=None)",
+ "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 textarea.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.text_input": {
+ "name": "text_input",
+ "signature": "element.text_input(self, label, value=\"\", max_chars=None, key=None, type=\"default\", help=None)",
+ "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be 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": "A tooltip that gets displayed next to the input.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.time_input": {
+ "name": "time_input",
+ "signature": "element.time_input(self, label, value=None, key=None, help=None)",
+ "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.title": {
+ "name": "title",
+ "signature": "element.title(self, body, anchor=None)",
+ "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in title 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
+ }
+ ]
+ },
+ "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\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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, numpy.ndarray, Iterable, dict,",
+ "is_optional": false,
+ "description": "or None\nEither the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).
\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
+ }
+ ]
+ },
+ "DeltaGenerator.video": {
+ "name": "video",
+ "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)",
+ "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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
+ }
+ ]
+ },
+ "DeltaGenerator.warning": {
+ "name": "warning",
+ "signature": "element.warning(self, body)",
+ "example": "\n\n>>> st.warning('This is a warning')\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
+ }
+ ]
+ },
+ "DeltaGenerator.write": {
+ "name": "write",
+ "signature": "element.write(self, *args, **kwargs)",
+ "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Write arguments to the app.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n",
+ "default": "False."
+ }
+ ]
+ }
+ },
+ "0.83.0": {
+ "streamlit.altair_chart": {
+ "name": "altair_chart",
+ "signature": "st.altair_chart(altair_chart, use_container_width=False)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.
\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
+ }
+ ]
+ },
+ "streamlit.area_chart": {
+ "name": "area_chart",
+ "signature": "st.area_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display an area chart.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict",
+ "is_optional": false,
+ "description": "Data to be plotted.
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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 width 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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.audio": {
+ "name": "audio",
+ "signature": "st.audio(data, format=\"audio/wav\", start_time=0)",
+ "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n",
+ "default": "s"
+ }
+ ]
+ },
+ "streamlit.balloons": {
+ "name": "balloons",
+ "signature": "st.balloons()",
+ "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n",
+ "description": "Draw celebratory balloons.",
+ "args": []
+ },
+ "streamlit.bar_chart": {
+ "name": "bar_chart",
+ "signature": "st.bar_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a bar chart.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict",
+ "is_optional": false,
+ "description": "Data to be plotted.
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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 width 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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.beta_columns": {
+ "name": "beta_columns",
+ "signature": "st.beta_columns(spec)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.beta_columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.beta_columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor example, st.beta_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
+ }
+ ]
+ },
+ "streamlit.beta_container": {
+ "name": "beta_container",
+ "signature": "st.beta_container()",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with st.beta_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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.beta_container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "streamlit.beta_expander": {
+ "name": "beta_expander",
+ "signature": "st.beta_expander(label=None, expanded=False)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with st.beta_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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "streamlit.bokeh_chart": {
+ "name": "bokeh_chart",
+ "signature": "st.bokeh_chart(figure, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.",
+ "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
+ },
+ {
+ "name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Bokeh's `show`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.button": {
+ "name": "button",
+ "signature": "st.button(label, key=None, help=None)",
+ "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 when the button is hovered over.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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\n... def fetch_and_clean_data(url):\n... # Fetch data from URL here, and then clean it up.\n... return data\n...\n>>> d1 = fetch_and_clean_data(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> d2 = 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>>>\n>>> d3 = fetch_and_clean_data(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nTo 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
\nTo 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
\nTo 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
\nAlternatively, 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",
+ "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 normally shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.
\nIf 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 functions 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."
+ }
+ ]
+ },
+ "streamlit.caption": {
+ "name": "caption",
+ "signature": "st.caption(body)",
+ "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in small font.",
+ "args": [
+ {
+ "name": "body",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "The text to display.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.checkbox": {
+ "name": "checkbox",
+ "signature": "st.checkbox(label, value=False, key=None, help=None)",
+ "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 checkbox.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.code": {
+ "name": "code",
+ "signature": "st.code(body, language=\"python\")",
+ "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a code block with optional syntax highlighting.",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.color_picker": {
+ "name": "color_picker",
+ "signature": "st.color_picker(label, value=None, key=None, help=None)",
+ "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "type_name": "str or None",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 color picker.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.dataframe": {
+ "name": "dataframe",
+ "signature": "st.dataframe(data=None, width=None, height=None)",
+ "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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, numpy.ndarray, Iterable, dict,",
+ "is_optional": false,
+ "description": "or None\nThe data to display.
\nIf '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!
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int or None",
+ "is_optional": false,
+ "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 UI element expressed in pixels. If None, a\ndefault height is used.
\n",
+ "default": "height"
+ }
+ ]
+ },
+ "streamlit.date_input": {
+ "name": "date_input",
+ "signature": "st.date_input(label, value=None, min_value=None, max_value=None, key=None, help=None)",
+ "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.echo": {
+ "name": "echo",
+ "signature": "st.echo(code_location=\"above\")",
+ "example": "\n\n>>> with 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
+ }
+ ]
+ },
+ "streamlit.empty": {
+ "name": "empty",
+ "signature": "st.empty()",
+ "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.beta_container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n",
+ "description": "Insert a single-element container.",
+ "args": []
+ },
+ "streamlit.error": {
+ "name": "error",
+ "signature": "st.error(body)",
+ "example": "\n\n>>> st.error('This is an error')\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
+ }
+ ]
+ },
+ "streamlit.exception": {
+ "name": "exception",
+ "signature": "st.exception(exception)",
+ "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.experimental_get_query_params": {
+ "name": "experimental_get_query_params",
+ "signature": "st.experimental_get_query_params()",
+ "example": "\nLet'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\n>>> st.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\nNote 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": []
+ },
+ "streamlit.experimental_rerun": {
+ "name": "experimental_rerun",
+ "signature": "st.experimental_rerun()",
+ "description": "Rerun the script immediately.",
+ "args": []
+ },
+ "streamlit.experimental_set_query_params": {
+ "name": "experimental_set_query_params",
+ "signature": "st.experimental_set_query_params(**query_params)",
+ "example": "\nTo 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\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.experimental_show": {
+ "name": "experimental_show",
+ "signature": "st.experimental_show(*args)",
+ "notes": "\nThis 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- When passing multiple arguments the inclusion of , or ) in a string
\n
\n \nargument may cause an error.
\n
\n",
+ "example": "\n\n>>> dataframe = pd.DataFrame({\n... 'first column': [1, 2, 3, 4],\n... 'second column': [10, 20, 30, 40],\n... }))\n>>> st.experimental_show(dataframe)\n
\n
\n",
+ "description": "Write arguments and *argument names* to your app for debugging purposes.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to debug in the App.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.file_uploader": {
+ "name": "file_uploader",
+ "signature": "st.file_uploader(label, type=None, accept_multiple_files=False, key=None, help=None)",
+ "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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",
+ "description": "Display a file uploader widget.",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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
+ }
+ ]
+ },
+ "streamlit.form": {
+ "name": "form",
+ "signature": "st.form(key, clear_on_submit=False)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n",
+ "description": "Create a form that batches elements together with a \"Submit\" button.",
+ "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"
+ }
+ ]
+ },
+ "streamlit.form_submit_button": {
+ "name": "form_submit_button",
+ "signature": "st.form_submit_button(label=\"Submit\", help=None)",
+ "description": "Display a form submit button.",
+ "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."
+ }
+ ]
+ },
+ "streamlit.get_option": {
+ "name": "get_option",
+ "signature": "st.get_option(key)",
+ "description": "Return the current value of a given Streamlit config option.",
+ "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
+ }
+ ]
+ },
+ "streamlit.graphviz_chart": {
+ "name": "graphviz_chart",
+ "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.header": {
+ "name": "header",
+ "signature": "st.header(body, anchor=None)",
+ "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "streamlit.help": {
+ "name": "help",
+ "signature": "st.help(obj)",
+ "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n",
+ "description": "Display object's doc string, nicely formatted.",
+ "args": [
+ {
+ "name": "obj",
+ "type_name": "Object",
+ "is_optional": false,
+ "description": "The object whose docstring should be displayed.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"
+ }
+ ]
+ },
+ "streamlit.info": {
+ "name": "info",
+ "signature": "st.info(body)",
+ "example": "\n\n>>> st.info('This is a purely informational message')\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
+ }
+ ]
+ },
+ "streamlit.json": {
+ "name": "json",
+ "signature": "st.json(body)",
+ "example": "\n\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.latex": {
+ "name": "latex",
+ "signature": "st.latex(body)",
+ "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display mathematical expressions formatted as LaTeX.",
+ "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
+ }
+ ]
+ },
+ "streamlit.line_chart": {
+ "name": "line_chart",
+ "signature": "st.line_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a line chart.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict",
+ "is_optional": false,
+ "description": "or None\nData to be plotted.
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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 width 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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.map": {
+ "name": "map",
+ "signature": "st.map(data=None, zoom=None, use_container_width=True)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a map with points on it.",
+ "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
+ }
+ ]
+ },
+ "streamlit.markdown": {
+ "name": "markdown",
+ "signature": "st.markdown(body, unsafe_allow_html=False)",
+ "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.multiselect": {
+ "name": "multiselect",
+ "signature": "st.multiselect(label, options, default=None, format_func=special_internal_function, key=None, help=None)",
+ "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n",
+ "description": "Display a multiselect widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this select widget is for.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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": "[str] or None",
+ "is_optional": false,
+ "description": "List of default values.
\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 selectbox.
\n",
+ "default": null
+ },
+ {
+ "name": "key",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 multiselect.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.object_beta_warning": {
+ "name": "object_beta_warning",
+ "signature": "st.object_beta_warning(obj, obj_name, date)",
+ "description": "Wrapper for objects that are no longer in beta.",
+ "args": [
+ {
+ "name": "obj",
+ "type_name": "Any",
+ "is_optional": false,
+ "description": "The st. object that used to be in beta.
\n",
+ "default": null
+ },
+ {
+ "name": "obj_name",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "The name of the object within __init__.py
\n",
+ "default": null
+ },
+ {
+ "name": "date",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A date like "2020-01-01", indicating the last day we'll guarantee\nsupport for the beta_ prefix.
\n \n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.plotly_chart": {
+ "name": "plotly_chart",
+ "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)",
+ "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.",
+ "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
\nSee 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://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
+ },
+ {
+ "name": "To show Plotly charts in Streamlit, call `st.plotly_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Plotly's `py.plot` or `py.iplot`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.progress": {
+ "name": "progress",
+ "signature": "st.progress(value)",
+ "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.pydeck_chart": {
+ "name": "pydeck_chart",
+ "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)",
+ "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.",
+ "args": [
+ {
+ "name": "spec",
+ "type_name": "pydeck.Deck or None",
+ "is_optional": false,
+ "description": "Object specifying the PyDeck chart to draw.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.pyplot": {
+ "name": "pyplot",
+ "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)",
+ "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n",
+ "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.radio": {
+ "name": "radio",
+ "signature": "st.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None)",
+ "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 radio.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.select_slider": {
+ "name": "select_slider",
+ "signature": "st.select_slider(label, options=[], value=None, format_func=special_internal_function, key=None, help=None)",
+ "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n",
+ "description": "Display a slider widget to select items from a list.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this slider is for.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 select slider.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.selectbox": {
+ "name": "selectbox",
+ "signature": "st.selectbox(label, options, index=0, format_func=special_internal_function, key=None, help=None)",
+ "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 selectbox.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.set_option": {
+ "name": "set_option",
+ "signature": "st.set_option(key, value)",
+ "description": "Set config option.",
+ "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
+ }
+ ]
+ },
+ "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\")",
+ "example": "\n>>> st.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... )\n
\n",
+ "description": "Configures the default settings of the page.",
+ "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"
+ }
+ ]
+ },
+ "streamlit.slider": {
+ "name": "slider",
+ "signature": "st.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None, help=None)",
+ "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n",
+ "description": "Display a slider widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this slider is for.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 slider.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.spinner": {
+ "name": "spinner",
+ "signature": "st.spinner(text=\"In progress...\")",
+ "example": "\n\n>>> with st.spinner('Wait for it...'):\n>>> time.sleep(5)\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.stop": {
+ "name": "stop",
+ "signature": "st.stop()",
+ "example": "\n\n>>> name = st.text_input('Name')\n>>> if not name:\n>>> st.warning('Please input a name.')\n>>> st.stop()\n>>> st.success('Thank you for inputting a name.')\n
\n
\n",
+ "description": "Stops execution immediately.",
+ "args": []
+ },
+ "streamlit.subheader": {
+ "name": "subheader",
+ "signature": "st.subheader(body, anchor=None)",
+ "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "streamlit.success": {
+ "name": "success",
+ "signature": "st.success(body)",
+ "example": "\n\n>>> st.success('This is a success message!')\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
+ }
+ ]
+ },
+ "streamlit.table": {
+ "name": "table",
+ "signature": "st.table(data=None)",
+ "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a static table.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,",
+ "is_optional": false,
+ "description": "or None\nThe table data.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.text": {
+ "name": "text",
+ "signature": "st.text(body)",
+ "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "streamlit.text_area": {
+ "name": "text_area",
+ "signature": "st.text_area(label, value=\"\", height=None, max_chars=None, key=None, help=None)",
+ "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 textarea.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.text_input": {
+ "name": "text_input",
+ "signature": "st.text_input(label, value=\"\", max_chars=None, key=None, type=\"default\", help=None)",
+ "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be 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": "A tooltip that gets displayed next to the input.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.time_input": {
+ "name": "time_input",
+ "signature": "st.time_input(label, value=None, key=None, help=None)",
+ "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.title": {
+ "name": "title",
+ "signature": "st.title(body, anchor=None)",
+ "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in title 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
+ }
+ ]
+ },
+ "streamlit.vega_lite_chart": {
+ "name": "vega_lite_chart",
+ "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, **kwargs)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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, numpy.ndarray, Iterable, dict,",
+ "is_optional": false,
+ "description": "or None\nEither the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).
\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
+ }
+ ]
+ },
+ "streamlit.video": {
+ "name": "video",
+ "signature": "st.video(data, format=\"video/mp4\", start_time=0)",
+ "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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
+ }
+ ]
+ },
+ "streamlit.warning": {
+ "name": "warning",
+ "signature": "st.warning(body)",
+ "example": "\n\n>>> st.warning('This is a warning')\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
+ }
+ ]
+ },
+ "streamlit.write": {
+ "name": "write",
+ "signature": "st.write(*args, **kwargs)",
+ "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Write arguments to the app.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n",
+ "default": "False."
+ }
+ ]
+ },
+ "DeltaGenerator.add_rows": {
+ "name": "add_rows",
+ "signature": "element.add_rows(self, data=None, **kwargs)",
+ "example": "\n\n>>> df1 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_table = st.table(df1)\n>>>\n>>> df2 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_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
\nYou 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...\n>>> my_chart = st.line_chart(df1)\n>>> my_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
\nAnd for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:
\n\n>>> my_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... }),\n>>> my_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, numpy.ndarray, Iterable, dict,",
+ "is_optional": false,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "or None",
+ "type_name": null,
+ "is_optional": null,
+ "description": "Table to concat. Optional.
\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
+ }
+ ]
+ },
+ "DeltaGenerator.altair_chart": {
+ "name": "altair_chart",
+ "signature": "element.altair_chart(self, altair_chart, use_container_width=False)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.
\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
+ }
+ ]
+ },
+ "DeltaGenerator.area_chart": {
+ "name": "area_chart",
+ "signature": "element.area_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display an area chart.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict",
+ "is_optional": false,
+ "description": "Data to be plotted.
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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 width 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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.audio": {
+ "name": "audio",
+ "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0)",
+ "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n",
+ "default": "s"
+ }
+ ]
+ },
+ "DeltaGenerator.balloons": {
+ "name": "balloons",
+ "signature": "element.balloons(self)",
+ "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n",
+ "description": "Draw celebratory balloons.",
+ "args": []
+ },
+ "DeltaGenerator.bar_chart": {
+ "name": "bar_chart",
+ "signature": "element.bar_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a bar chart.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict",
+ "is_optional": false,
+ "description": "Data to be plotted.
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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 width 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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.beta_columns": {
+ "name": "beta_columns",
+ "signature": "element.beta_columns(self, spec)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.beta_columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.beta_columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor example, st.beta_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
+ }
+ ]
+ },
+ "DeltaGenerator.beta_container": {
+ "name": "beta_container",
+ "signature": "element.beta_container(self)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with st.beta_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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.beta_container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "DeltaGenerator.beta_expander": {
+ "name": "beta_expander",
+ "signature": "element.beta_expander(self, label=None, expanded=False)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with st.beta_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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "DeltaGenerator.bokeh_chart": {
+ "name": "bokeh_chart",
+ "signature": "element.bokeh_chart(self, figure, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.",
+ "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
+ },
+ {
+ "name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Bokeh's `show`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.button": {
+ "name": "button",
+ "signature": "element.button(self, label, key=None, help=None)",
+ "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 when the button is hovered over.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.caption": {
+ "name": "caption",
+ "signature": "element.caption(self, body)",
+ "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in small font.",
+ "args": [
+ {
+ "name": "body",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "The text to display.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.checkbox": {
+ "name": "checkbox",
+ "signature": "element.checkbox(self, label, value=False, key=None, help=None)",
+ "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 checkbox.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.code": {
+ "name": "code",
+ "signature": "element.code(self, body, language=\"python\")",
+ "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a code block with optional syntax highlighting.",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.color_picker": {
+ "name": "color_picker",
+ "signature": "element.color_picker(self, label, value=None, key=None, help=None)",
+ "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "type_name": "str or None",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 color picker.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.dataframe": {
+ "name": "dataframe",
+ "signature": "element.dataframe(self, data=None, width=None, height=None)",
+ "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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, numpy.ndarray, Iterable, dict,",
+ "is_optional": false,
+ "description": "or None\nThe data to display.
\nIf '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!
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int or None",
+ "is_optional": false,
+ "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 UI element expressed in pixels. If None, a\ndefault height is used.
\n",
+ "default": "height"
+ }
+ ]
+ },
+ "DeltaGenerator.date_input": {
+ "name": "date_input",
+ "signature": "element.date_input(self, label, value=None, min_value=None, max_value=None, key=None, help=None)",
+ "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.empty": {
+ "name": "empty",
+ "signature": "element.empty(self)",
+ "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.beta_container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n",
+ "description": "Insert a single-element container.",
+ "args": []
+ },
+ "DeltaGenerator.error": {
+ "name": "error",
+ "signature": "element.error(self, body)",
+ "example": "\n\n>>> st.error('This is an error')\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
+ }
+ ]
+ },
+ "DeltaGenerator.exception": {
+ "name": "exception",
+ "signature": "element.exception(self, exception)",
+ "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.file_uploader": {
+ "name": "file_uploader",
+ "signature": "element.file_uploader(self, label, type=None, accept_multiple_files=False, key=None, help=None)",
+ "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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",
+ "description": "Display a file uploader widget.",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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
+ }
+ ]
+ },
+ "DeltaGenerator.form": {
+ "name": "form",
+ "signature": "element.form(self, key, clear_on_submit=False)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n",
+ "description": "Create a form that batches elements together with a \"Submit\" button.",
+ "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"
+ }
+ ]
+ },
+ "DeltaGenerator.form_submit_button": {
+ "name": "form_submit_button",
+ "signature": "element.form_submit_button(self, label=\"Submit\", help=None)",
+ "description": "Display a form submit button.",
+ "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."
+ }
+ ]
+ },
+ "DeltaGenerator.graphviz_chart": {
+ "name": "graphviz_chart",
+ "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.header": {
+ "name": "header",
+ "signature": "element.header(self, body, anchor=None)",
+ "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "DeltaGenerator.help": {
+ "name": "help",
+ "signature": "element.help(self, obj)",
+ "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n",
+ "description": "Display object's doc string, nicely formatted.",
+ "args": [
+ {
+ "name": "obj",
+ "type_name": "Object",
+ "is_optional": false,
+ "description": "The object whose docstring should be displayed.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"
+ }
+ ]
+ },
+ "DeltaGenerator.info": {
+ "name": "info",
+ "signature": "element.info(self, body)",
+ "example": "\n\n>>> st.info('This is a purely informational message')\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
+ }
+ ]
+ },
+ "DeltaGenerator.json": {
+ "name": "json",
+ "signature": "element.json(self, body)",
+ "example": "\n\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.latex": {
+ "name": "latex",
+ "signature": "element.latex(self, body)",
+ "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display mathematical expressions formatted as LaTeX.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.line_chart": {
+ "name": "line_chart",
+ "signature": "element.line_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a line chart.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict",
+ "is_optional": false,
+ "description": "or None\nData to be plotted.
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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 width 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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.map": {
+ "name": "map",
+ "signature": "element.map(self, data=None, zoom=None, use_container_width=True)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a map with points on it.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.markdown": {
+ "name": "markdown",
+ "signature": "element.markdown(self, body, unsafe_allow_html=False)",
+ "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.multiselect": {
+ "name": "multiselect",
+ "signature": "element.multiselect(self, label, options, default=None, format_func=special_internal_function, key=None, help=None)",
+ "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n",
+ "description": "Display a multiselect widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this select widget is for.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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": "[str] or None",
+ "is_optional": false,
+ "description": "List of default values.
\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 selectbox.
\n",
+ "default": null
+ },
+ {
+ "name": "key",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 multiselect.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.plotly_chart": {
+ "name": "plotly_chart",
+ "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)",
+ "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.",
+ "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
\nSee 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://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
+ },
+ {
+ "name": "To show Plotly charts in Streamlit, call `st.plotly_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Plotly's `py.plot` or `py.iplot`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.progress": {
+ "name": "progress",
+ "signature": "element.progress(self, value)",
+ "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.pydeck_chart": {
+ "name": "pydeck_chart",
+ "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)",
+ "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.",
+ "args": [
+ {
+ "name": "spec",
+ "type_name": "pydeck.Deck or None",
+ "is_optional": false,
+ "description": "Object specifying the PyDeck chart to draw.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.pyplot": {
+ "name": "pyplot",
+ "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)",
+ "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n",
+ "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.radio": {
+ "name": "radio",
+ "signature": "element.radio(self, label, options, index=0, format_func=special_internal_function, key=None, help=None)",
+ "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 radio.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.select_slider": {
+ "name": "select_slider",
+ "signature": "element.select_slider(self, label, options=[], value=None, format_func=special_internal_function, key=None, help=None)",
+ "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n",
+ "description": "Display a slider widget to select items from a list.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this slider is for.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 select slider.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.selectbox": {
+ "name": "selectbox",
+ "signature": "element.selectbox(self, label, options, index=0, format_func=special_internal_function, key=None, help=None)",
+ "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 selectbox.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n",
+ "description": "Display a slider widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this slider is for.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 slider.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.subheader": {
+ "name": "subheader",
+ "signature": "element.subheader(self, body, anchor=None)",
+ "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "DeltaGenerator.success": {
+ "name": "success",
+ "signature": "element.success(self, body)",
+ "example": "\n\n>>> st.success('This is a success message!')\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
+ }
+ ]
+ },
+ "DeltaGenerator.table": {
+ "name": "table",
+ "signature": "element.table(self, data=None)",
+ "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a static table.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,",
+ "is_optional": false,
+ "description": "or None\nThe table data.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.text": {
+ "name": "text",
+ "signature": "element.text(self, body)",
+ "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "DeltaGenerator.text_area": {
+ "name": "text_area",
+ "signature": "element.text_area(self, label, value=\"\", height=None, max_chars=None, key=None, help=None)",
+ "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 textarea.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.text_input": {
+ "name": "text_input",
+ "signature": "element.text_input(self, label, value=\"\", max_chars=None, key=None, type=\"default\", help=None)",
+ "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be 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": "A tooltip that gets displayed next to the input.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.time_input": {
+ "name": "time_input",
+ "signature": "element.time_input(self, label, value=None, key=None, help=None)",
+ "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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 input.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.title": {
+ "name": "title",
+ "signature": "element.title(self, body, anchor=None)",
+ "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in title 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
+ }
+ ]
+ },
+ "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\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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, numpy.ndarray, Iterable, dict,",
+ "is_optional": false,
+ "description": "or None\nEither the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).
\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
+ }
+ ]
+ },
+ "DeltaGenerator.video": {
+ "name": "video",
+ "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)",
+ "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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
+ }
+ ]
+ },
+ "DeltaGenerator.warning": {
+ "name": "warning",
+ "signature": "element.warning(self, body)",
+ "example": "\n\n>>> st.warning('This is a warning')\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
+ }
+ ]
+ },
+ "DeltaGenerator.write": {
+ "name": "write",
+ "signature": "element.write(self, *args, **kwargs)",
+ "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Write arguments to the app.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n",
+ "default": "False."
+ }
+ ]
+ }
+ },
+ "0.84.0": {
+ "streamlit.altair_chart": {
+ "name": "altair_chart",
+ "signature": "st.altair_chart(altair_chart, use_container_width=False)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.
\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
+ }
+ ]
+ },
+ "streamlit.area_chart": {
+ "name": "area_chart",
+ "signature": "st.area_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display an area chart.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict",
+ "is_optional": false,
+ "description": "Data to be plotted.
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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 width 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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.audio": {
+ "name": "audio",
+ "signature": "st.audio(data, format=\"audio/wav\", start_time=0)",
+ "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n",
+ "default": "s"
+ }
+ ]
+ },
+ "streamlit.balloons": {
+ "name": "balloons",
+ "signature": "st.balloons()",
+ "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n",
+ "description": "Draw celebratory balloons.",
+ "args": []
+ },
+ "streamlit.bar_chart": {
+ "name": "bar_chart",
+ "signature": "st.bar_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a bar chart.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict",
+ "is_optional": false,
+ "description": "Data to be plotted.
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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 width 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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.beta_columns": {
+ "name": "beta_columns",
+ "signature": "st.beta_columns(spec)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.beta_columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.beta_columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor example, st.beta_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
+ }
+ ]
+ },
+ "streamlit.beta_container": {
+ "name": "beta_container",
+ "signature": "st.beta_container()",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with st.beta_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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.beta_container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "streamlit.beta_expander": {
+ "name": "beta_expander",
+ "signature": "st.beta_expander(label, expanded=False)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with st.beta_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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "streamlit.bokeh_chart": {
+ "name": "bokeh_chart",
+ "signature": "st.bokeh_chart(figure, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.",
+ "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
+ },
+ {
+ "name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Bokeh's `show`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.button": {
+ "name": "button",
+ "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None)",
+ "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type 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
+ }
+ ]
+ },
+ "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\n... def fetch_and_clean_data(url):\n... # Fetch data from URL here, and then clean it up.\n... return data\n...\n>>> d1 = fetch_and_clean_data(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> d2 = 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>>>\n>>> d3 = fetch_and_clean_data(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nTo 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
\nTo 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
\nTo 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
\nAlternatively, 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",
+ "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 normally shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.
\nIf 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 functions 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."
+ }
+ ]
+ },
+ "streamlit.caption": {
+ "name": "caption",
+ "signature": "st.caption(body)",
+ "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in small font.",
+ "args": [
+ {
+ "name": "body",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "The text to display.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.checkbox": {
+ "name": "checkbox",
+ "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "streamlit.code": {
+ "name": "code",
+ "signature": "st.code(body, language=\"python\")",
+ "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a code block with optional syntax highlighting.",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.color_picker": {
+ "name": "color_picker",
+ "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "streamlit.dataframe": {
+ "name": "dataframe",
+ "signature": "st.dataframe(data=None, width=None, height=None)",
+ "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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, numpy.ndarray, Iterable, dict,",
+ "is_optional": false,
+ "description": "or None\nThe data to display.
\nIf '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!
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int or None",
+ "is_optional": false,
+ "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 UI element expressed in pixels. If None, a\ndefault height is used.
\n",
+ "default": "height"
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "streamlit.echo": {
+ "name": "echo",
+ "signature": "st.echo(code_location=\"above\")",
+ "example": "\n\n>>> with 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
+ }
+ ]
+ },
+ "streamlit.empty": {
+ "name": "empty",
+ "signature": "st.empty()",
+ "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.beta_container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n",
+ "description": "Insert a single-element container.",
+ "args": []
+ },
+ "streamlit.error": {
+ "name": "error",
+ "signature": "st.error(body)",
+ "example": "\n\n>>> st.error('This is an error')\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
+ }
+ ]
+ },
+ "streamlit.exception": {
+ "name": "exception",
+ "signature": "st.exception(exception)",
+ "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.experimental_get_query_params": {
+ "name": "experimental_get_query_params",
+ "signature": "st.experimental_get_query_params()",
+ "example": "\nLet'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\n>>> st.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\nNote 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": []
+ },
+ "streamlit.experimental_rerun": {
+ "name": "experimental_rerun",
+ "signature": "st.experimental_rerun()",
+ "description": "Rerun the script immediately.",
+ "args": []
+ },
+ "streamlit.experimental_set_query_params": {
+ "name": "experimental_set_query_params",
+ "signature": "st.experimental_set_query_params(**query_params)",
+ "example": "\nTo 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\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.experimental_show": {
+ "name": "experimental_show",
+ "signature": "st.experimental_show(*args)",
+ "notes": "\nThis 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- When passing multiple arguments the inclusion of , or ) in a string
\n
\n \nargument may cause an error.
\n
\n",
+ "example": "\n\n>>> dataframe = pd.DataFrame({\n... 'first column': [1, 2, 3, 4],\n... 'second column': [10, 20, 30, 40],\n... }))\n>>> st.experimental_show(dataframe)\n
\n
\n",
+ "description": "Write arguments and *argument names* to your app for debugging purposes.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to debug in the App.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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)",
+ "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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",
+ "description": "Display a file uploader widget.",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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
+ }
+ ]
+ },
+ "streamlit.form": {
+ "name": "form",
+ "signature": "st.form(key, clear_on_submit=False)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n",
+ "description": "Create a form that batches elements together with a \"Submit\" button.",
+ "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"
+ }
+ ]
+ },
+ "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.",
+ "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
+ }
+ ]
+ },
+ "streamlit.get_option": {
+ "name": "get_option",
+ "signature": "st.get_option(key)",
+ "description": "Return the current value of a given Streamlit config option.",
+ "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
+ }
+ ]
+ },
+ "streamlit.graphviz_chart": {
+ "name": "graphviz_chart",
+ "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.header": {
+ "name": "header",
+ "signature": "st.header(body, anchor=None)",
+ "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "streamlit.help": {
+ "name": "help",
+ "signature": "st.help(obj)",
+ "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n",
+ "description": "Display object's doc string, nicely formatted.",
+ "args": [
+ {
+ "name": "obj",
+ "type_name": "Object",
+ "is_optional": false,
+ "description": "The object whose docstring should be displayed.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"
+ }
+ ]
+ },
+ "streamlit.info": {
+ "name": "info",
+ "signature": "st.info(body)",
+ "example": "\n\n>>> st.info('This is a purely informational message')\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
+ }
+ ]
+ },
+ "streamlit.json": {
+ "name": "json",
+ "signature": "st.json(body)",
+ "example": "\n\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.latex": {
+ "name": "latex",
+ "signature": "st.latex(body)",
+ "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display mathematical expressions formatted as LaTeX.",
+ "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
+ }
+ ]
+ },
+ "streamlit.line_chart": {
+ "name": "line_chart",
+ "signature": "st.line_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a line chart.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict",
+ "is_optional": false,
+ "description": "or None\nData to be plotted.
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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 width 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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.map": {
+ "name": "map",
+ "signature": "st.map(data=None, zoom=None, use_container_width=True)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a map with points on it.",
+ "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
+ }
+ ]
+ },
+ "streamlit.markdown": {
+ "name": "markdown",
+ "signature": "st.markdown(body, unsafe_allow_html=False)",
+ "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n",
+ "description": "Display a multiselect widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this select widget is for.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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": "[str] or None",
+ "is_optional": false,
+ "description": "List of default values.
\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 selectbox.
\n",
+ "default": null
+ },
+ {
+ "name": "key",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "streamlit.object_beta_warning": {
+ "name": "object_beta_warning",
+ "signature": "st.object_beta_warning(obj, obj_name, date)",
+ "description": "Wrapper for objects that are no longer in beta.",
+ "args": [
+ {
+ "name": "obj",
+ "type_name": "Any",
+ "is_optional": false,
+ "description": "The st. object that used to be in beta.
\n",
+ "default": null
+ },
+ {
+ "name": "obj_name",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "The name of the object within __init__.py
\n",
+ "default": null
+ },
+ {
+ "name": "date",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A date like "2020-01-01", indicating the last day we'll guarantee\nsupport for the beta_ prefix.
\n \n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.plotly_chart": {
+ "name": "plotly_chart",
+ "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)",
+ "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.",
+ "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
\nSee 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://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
+ },
+ {
+ "name": "To show Plotly charts in Streamlit, call `st.plotly_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Plotly's `py.plot` or `py.iplot`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.progress": {
+ "name": "progress",
+ "signature": "st.progress(value)",
+ "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.pydeck_chart": {
+ "name": "pydeck_chart",
+ "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)",
+ "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.",
+ "args": [
+ {
+ "name": "spec",
+ "type_name": "pydeck.Deck or None",
+ "is_optional": false,
+ "description": "Object specifying the PyDeck chart to draw.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.pyplot": {
+ "name": "pyplot",
+ "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)",
+ "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n",
+ "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n",
+ "description": "Display a slider widget to select items from a list.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this slider is for.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "streamlit.set_option": {
+ "name": "set_option",
+ "signature": "st.set_option(key, value)",
+ "description": "Set config option.",
+ "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
+ }
+ ]
+ },
+ "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\")",
+ "example": "\n>>> st.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... )\n
\n",
+ "description": "Configures the default settings of the page.",
+ "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"
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n",
+ "description": "Display a slider widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this slider is for.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "streamlit.spinner": {
+ "name": "spinner",
+ "signature": "st.spinner(text=\"In progress...\")",
+ "example": "\n\n>>> with st.spinner('Wait for it...'):\n>>> time.sleep(5)\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.stop": {
+ "name": "stop",
+ "signature": "st.stop()",
+ "example": "\n\n>>> name = st.text_input('Name')\n>>> if not name:\n>>> st.warning('Please input a name.')\n>>> st.stop()\n>>> st.success('Thank you for inputting a name.')\n
\n
\n",
+ "description": "Stops execution immediately.",
+ "args": []
+ },
+ "streamlit.subheader": {
+ "name": "subheader",
+ "signature": "st.subheader(body, anchor=None)",
+ "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "streamlit.success": {
+ "name": "success",
+ "signature": "st.success(body)",
+ "example": "\n\n>>> st.success('This is a success message!')\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
+ }
+ ]
+ },
+ "streamlit.table": {
+ "name": "table",
+ "signature": "st.table(data=None)",
+ "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a static table.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,",
+ "is_optional": false,
+ "description": "or None\nThe table data.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.text": {
+ "name": "text",
+ "signature": "st.text(body)",
+ "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be 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
+ }
+ ]
+ },
+ "streamlit.time_input": {
+ "name": "time_input",
+ "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "streamlit.title": {
+ "name": "title",
+ "signature": "st.title(body, anchor=None)",
+ "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in title 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
+ }
+ ]
+ },
+ "streamlit.vega_lite_chart": {
+ "name": "vega_lite_chart",
+ "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, **kwargs)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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, numpy.ndarray, Iterable, dict,",
+ "is_optional": false,
+ "description": "or None\nEither the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).
\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
+ }
+ ]
+ },
+ "streamlit.video": {
+ "name": "video",
+ "signature": "st.video(data, format=\"video/mp4\", start_time=0)",
+ "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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
+ }
+ ]
+ },
+ "streamlit.warning": {
+ "name": "warning",
+ "signature": "st.warning(body)",
+ "example": "\n\n>>> st.warning('This is a warning')\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
+ }
+ ]
+ },
+ "streamlit.write": {
+ "name": "write",
+ "signature": "st.write(*args, **kwargs)",
+ "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Write arguments to the app.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n",
+ "default": "False."
+ }
+ ]
+ },
+ "DeltaGenerator.add_rows": {
+ "name": "add_rows",
+ "signature": "element.add_rows(self, data=None, **kwargs)",
+ "example": "\n\n>>> df1 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_table = st.table(df1)\n>>>\n>>> df2 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_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
\nYou 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...\n>>> my_chart = st.line_chart(df1)\n>>> my_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
\nAnd for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:
\n\n>>> my_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... }),\n>>> my_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, numpy.ndarray, Iterable, dict,",
+ "is_optional": false,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "or None",
+ "type_name": null,
+ "is_optional": null,
+ "description": "Table to concat. Optional.
\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
+ }
+ ]
+ },
+ "DeltaGenerator.altair_chart": {
+ "name": "altair_chart",
+ "signature": "element.altair_chart(self, altair_chart, use_container_width=False)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\n\n \n \n (view standalone Streamlit app)\n \n Examples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.
\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
+ }
+ ]
+ },
+ "DeltaGenerator.area_chart": {
+ "name": "area_chart",
+ "signature": "element.area_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display an area chart.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict",
+ "is_optional": false,
+ "description": "Data to be plotted.
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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 width 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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.audio": {
+ "name": "audio",
+ "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0)",
+ "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n",
+ "default": "s"
+ }
+ ]
+ },
+ "DeltaGenerator.balloons": {
+ "name": "balloons",
+ "signature": "element.balloons(self)",
+ "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n",
+ "description": "Draw celebratory balloons.",
+ "args": []
+ },
+ "DeltaGenerator.bar_chart": {
+ "name": "bar_chart",
+ "signature": "element.bar_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a bar chart.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict",
+ "is_optional": false,
+ "description": "Data to be plotted.
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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 width 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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.beta_columns": {
+ "name": "beta_columns",
+ "signature": "element.beta_columns(self, spec)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.beta_columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.beta_columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor example, st.beta_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
+ }
+ ]
+ },
+ "DeltaGenerator.beta_container": {
+ "name": "beta_container",
+ "signature": "element.beta_container(self)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with st.beta_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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.beta_container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "DeltaGenerator.beta_expander": {
+ "name": "beta_expander",
+ "signature": "element.beta_expander(self, label, expanded=False)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with st.beta_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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "DeltaGenerator.bokeh_chart": {
+ "name": "bokeh_chart",
+ "signature": "element.bokeh_chart(self, figure, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.",
+ "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
+ },
+ {
+ "name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Bokeh's `show`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.button": {
+ "name": "button",
+ "signature": "element.button(self, label, key=None, help=None, on_click=None, args=None, kwargs=None)",
+ "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type 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
+ }
+ ]
+ },
+ "DeltaGenerator.caption": {
+ "name": "caption",
+ "signature": "element.caption(self, body)",
+ "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in small font.",
+ "args": [
+ {
+ "name": "body",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "The text to display.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.checkbox": {
+ "name": "checkbox",
+ "signature": "element.checkbox(self, label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "DeltaGenerator.code": {
+ "name": "code",
+ "signature": "element.code(self, body, language=\"python\")",
+ "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a code block with optional syntax highlighting.",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "DeltaGenerator.dataframe": {
+ "name": "dataframe",
+ "signature": "element.dataframe(self, data=None, width=None, height=None)",
+ "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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, numpy.ndarray, Iterable, dict,",
+ "is_optional": false,
+ "description": "or None\nThe data to display.
\nIf '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!
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int or None",
+ "is_optional": false,
+ "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 UI element expressed in pixels. If None, a\ndefault height is used.
\n",
+ "default": "height"
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "DeltaGenerator.empty": {
+ "name": "empty",
+ "signature": "element.empty(self)",
+ "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.beta_container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n",
+ "description": "Insert a single-element container.",
+ "args": []
+ },
+ "DeltaGenerator.error": {
+ "name": "error",
+ "signature": "element.error(self, body)",
+ "example": "\n\n>>> st.error('This is an error')\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
+ }
+ ]
+ },
+ "DeltaGenerator.exception": {
+ "name": "exception",
+ "signature": "element.exception(self, exception)",
+ "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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",
+ "description": "Display a file uploader widget.",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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
+ }
+ ]
+ },
+ "DeltaGenerator.form": {
+ "name": "form",
+ "signature": "element.form(self, key, clear_on_submit=False)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n",
+ "description": "Create a form that batches elements together with a \"Submit\" button.",
+ "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"
+ }
+ ]
+ },
+ "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.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.graphviz_chart": {
+ "name": "graphviz_chart",
+ "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.header": {
+ "name": "header",
+ "signature": "element.header(self, body, anchor=None)",
+ "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "DeltaGenerator.help": {
+ "name": "help",
+ "signature": "element.help(self, obj)",
+ "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n",
+ "description": "Display object's doc string, nicely formatted.",
+ "args": [
+ {
+ "name": "obj",
+ "type_name": "Object",
+ "is_optional": false,
+ "description": "The object whose docstring should be displayed.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"
+ }
+ ]
+ },
+ "DeltaGenerator.info": {
+ "name": "info",
+ "signature": "element.info(self, body)",
+ "example": "\n\n>>> st.info('This is a purely informational message')\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
+ }
+ ]
+ },
+ "DeltaGenerator.json": {
+ "name": "json",
+ "signature": "element.json(self, body)",
+ "example": "\n\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.latex": {
+ "name": "latex",
+ "signature": "element.latex(self, body)",
+ "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display mathematical expressions formatted as LaTeX.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.line_chart": {
+ "name": "line_chart",
+ "signature": "element.line_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a line chart.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict",
+ "is_optional": false,
+ "description": "or None\nData to be plotted.
\n",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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 width 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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.map": {
+ "name": "map",
+ "signature": "element.map(self, data=None, zoom=None, use_container_width=True)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a map with points on it.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.markdown": {
+ "name": "markdown",
+ "signature": "element.markdown(self, body, unsafe_allow_html=False)",
+ "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n",
+ "description": "Display a multiselect widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this select widget is for.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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": "[str] or None",
+ "is_optional": false,
+ "description": "List of default values.
\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 selectbox.
\n",
+ "default": null
+ },
+ {
+ "name": "key",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "DeltaGenerator.plotly_chart": {
+ "name": "plotly_chart",
+ "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)",
+ "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.",
+ "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
\nSee 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://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
+ },
+ {
+ "name": "To show Plotly charts in Streamlit, call `st.plotly_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Plotly's `py.plot` or `py.iplot`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.progress": {
+ "name": "progress",
+ "signature": "element.progress(self, value)",
+ "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.pydeck_chart": {
+ "name": "pydeck_chart",
+ "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)",
+ "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.",
+ "args": [
+ {
+ "name": "spec",
+ "type_name": "pydeck.Deck or None",
+ "is_optional": false,
+ "description": "Object specifying the PyDeck chart to draw.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.pyplot": {
+ "name": "pyplot",
+ "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)",
+ "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n",
+ "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n",
+ "description": "Display a slider widget to select items from a list.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this slider is for.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "options",
+ "type_name": "list, tuple, numpy.ndarray, pandas.Series, or pandas.DataFrame",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n",
+ "description": "Display a slider widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this slider is for.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "DeltaGenerator.subheader": {
+ "name": "subheader",
+ "signature": "element.subheader(self, body, anchor=None)",
+ "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "DeltaGenerator.success": {
+ "name": "success",
+ "signature": "element.success(self, body)",
+ "example": "\n\n>>> st.success('This is a success message!')\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
+ }
+ ]
+ },
+ "DeltaGenerator.table": {
+ "name": "table",
+ "signature": "element.table(self, data=None)",
+ "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a static table.",
+ "args": [
+ {
+ "name": "data",
+ "type_name": "pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,",
+ "is_optional": false,
+ "description": "or None\nThe table data.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.text": {
+ "name": "text",
+ "signature": "element.text(self, body)",
+ "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "DeltaGenerator.title": {
+ "name": "title",
+ "signature": "element.title(self, body, anchor=None)",
+ "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in title 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
+ }
+ ]
+ },
+ "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\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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, numpy.ndarray, Iterable, dict,",
+ "is_optional": false,
+ "description": "or None\nEither the data to be plotted or a Vega-Lite spec containing the\ndata (which more closely follows the Vega-Lite API).
\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
+ }
+ ]
+ },
+ "DeltaGenerator.video": {
+ "name": "video",
+ "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)",
+ "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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
+ }
+ ]
+ },
+ "DeltaGenerator.warning": {
+ "name": "warning",
+ "signature": "element.warning(self, body)",
+ "example": "\n\n>>> st.warning('This is a warning')\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
+ }
+ ]
+ },
+ "DeltaGenerator.write": {
+ "name": "write",
+ "signature": "element.write(self, *args, **kwargs)",
+ "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Write arguments to the app.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n",
+ "default": "False."
+ }
+ ]
+ }
+ },
+ "0.85.0": {
+ "streamlit.altair_chart": {
+ "name": "altair_chart",
+ "signature": "st.altair_chart(altair_chart, use_container_width=False)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\nExamples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.
\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
+ }
+ ]
+ },
+ "streamlit.area_chart": {
+ "name": "area_chart",
+ "signature": "st.area_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n
\n",
+ "description": "Display an area chart.",
+ "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": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.audio": {
+ "name": "audio",
+ "signature": "st.audio(data, format=\"audio/wav\", start_time=0)",
+ "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n",
+ "default": "s"
+ }
+ ]
+ },
+ "streamlit.balloons": {
+ "name": "balloons",
+ "signature": "st.balloons()",
+ "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n",
+ "description": "Draw celebratory balloons.",
+ "args": []
+ },
+ "streamlit.bar_chart": {
+ "name": "bar_chart",
+ "signature": "st.bar_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n
\n",
+ "description": "Display a bar chart.",
+ "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": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.beta_columns": {
+ "name": "beta_columns",
+ "signature": "st.beta_columns(spec)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.beta_columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.beta_columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor example, st.beta_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
+ }
+ ]
+ },
+ "streamlit.beta_container": {
+ "name": "beta_container",
+ "signature": "st.beta_container()",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with st.beta_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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.beta_container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "streamlit.beta_expander": {
+ "name": "beta_expander",
+ "signature": "st.beta_expander(label, expanded=False)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with st.beta_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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "streamlit.bokeh_chart": {
+ "name": "bokeh_chart",
+ "signature": "st.bokeh_chart(figure, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.",
+ "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
+ },
+ {
+ "name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Bokeh's `show`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.button": {
+ "name": "button",
+ "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None)",
+ "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type 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
+ }
+ ]
+ },
+ "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\n... def fetch_and_clean_data(url):\n... # Fetch data from URL here, and then clean it up.\n... return data\n...\n>>> d1 = fetch_and_clean_data(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> d2 = 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>>>\n>>> d3 = fetch_and_clean_data(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nTo 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
\nTo 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
\nTo 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
\nAlternatively, 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",
+ "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 normally shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.
\nIf 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 functions 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."
+ }
+ ]
+ },
+ "streamlit.caption": {
+ "name": "caption",
+ "signature": "st.caption(body)",
+ "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in small font.",
+ "args": [
+ {
+ "name": "body",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "The text to display.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.checkbox": {
+ "name": "checkbox",
+ "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "streamlit.code": {
+ "name": "code",
+ "signature": "st.code(body, language=\"python\")",
+ "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a code block with optional syntax highlighting.",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.color_picker": {
+ "name": "color_picker",
+ "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "streamlit.dataframe": {
+ "name": "dataframe",
+ "signature": "st.dataframe(data=None, width=None, height=None)",
+ "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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.
\nIf '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 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 UI element expressed in pixels. If None, a\ndefault height is used.
\n",
+ "default": "height"
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "streamlit.echo": {
+ "name": "echo",
+ "signature": "st.echo(code_location=\"above\")",
+ "example": "\n\n>>> with 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
+ }
+ ]
+ },
+ "streamlit.empty": {
+ "name": "empty",
+ "signature": "st.empty()",
+ "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.beta_container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n",
+ "description": "Insert a single-element container.",
+ "args": []
+ },
+ "streamlit.error": {
+ "name": "error",
+ "signature": "st.error(body)",
+ "example": "\n\n>>> st.error('This is an error')\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
+ }
+ ]
+ },
+ "streamlit.exception": {
+ "name": "exception",
+ "signature": "st.exception(exception)",
+ "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.experimental_get_query_params": {
+ "name": "experimental_get_query_params",
+ "signature": "st.experimental_get_query_params()",
+ "example": "\nLet'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\n>>> st.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\nNote 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": []
+ },
+ "streamlit.experimental_rerun": {
+ "name": "experimental_rerun",
+ "signature": "st.experimental_rerun()",
+ "description": "Rerun the script immediately.",
+ "args": []
+ },
+ "streamlit.experimental_set_query_params": {
+ "name": "experimental_set_query_params",
+ "signature": "st.experimental_set_query_params(**query_params)",
+ "example": "\nTo 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\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.experimental_show": {
+ "name": "experimental_show",
+ "signature": "st.experimental_show(*args)",
+ "notes": "\nThis 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- When passing multiple arguments the inclusion of , or ) in a string
\n
\n \nargument may cause an error.
\n
\n",
+ "example": "\n\n>>> dataframe = pd.DataFrame({\n... 'first column': [1, 2, 3, 4],\n... 'second column': [10, 20, 30, 40],\n... }))\n>>> st.experimental_show(dataframe)\n
\n
\n",
+ "description": "Write arguments and *argument names* to your app for debugging purposes.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to debug in the App.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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)",
+ "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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",
+ "description": "Display a file uploader widget.",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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
+ }
+ ]
+ },
+ "streamlit.form": {
+ "name": "form",
+ "signature": "st.form(key, clear_on_submit=False)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n",
+ "description": "Create a form that batches elements together with a \"Submit\" button.",
+ "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"
+ }
+ ]
+ },
+ "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.",
+ "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
+ }
+ ]
+ },
+ "streamlit.get_option": {
+ "name": "get_option",
+ "signature": "st.get_option(key)",
+ "description": "Return the current value of a given Streamlit config option.",
+ "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
+ }
+ ]
+ },
+ "streamlit.graphviz_chart": {
+ "name": "graphviz_chart",
+ "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.header": {
+ "name": "header",
+ "signature": "st.header(body, anchor=None)",
+ "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "streamlit.help": {
+ "name": "help",
+ "signature": "st.help(obj)",
+ "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n",
+ "description": "Display object's doc string, nicely formatted.",
+ "args": [
+ {
+ "name": "obj",
+ "type_name": "Object",
+ "is_optional": false,
+ "description": "The object whose docstring should be displayed.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"
+ }
+ ]
+ },
+ "streamlit.info": {
+ "name": "info",
+ "signature": "st.info(body)",
+ "example": "\n\n>>> st.info('This is a purely informational message')\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
+ }
+ ]
+ },
+ "streamlit.json": {
+ "name": "json",
+ "signature": "st.json(body)",
+ "example": "\n\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.latex": {
+ "name": "latex",
+ "signature": "st.latex(body)",
+ "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display mathematical expressions formatted as LaTeX.",
+ "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
+ }
+ ]
+ },
+ "streamlit.line_chart": {
+ "name": "line_chart",
+ "signature": "st.line_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st._arrow_line_chart(chart_data)\n
\n
\n",
+ "description": "Display a line chart.",
+ "args": [
+ {
+ "name": "data",
+ "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",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.map": {
+ "name": "map",
+ "signature": "st.map(data=None, zoom=None, use_container_width=True)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a map with points on it.",
+ "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
+ }
+ ]
+ },
+ "streamlit.markdown": {
+ "name": "markdown",
+ "signature": "st.markdown(body, unsafe_allow_html=False)",
+ "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n",
+ "description": "Display a multiselect widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this select widget 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 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": "[str] or None",
+ "is_optional": false,
+ "description": "List of default values.
\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 selectbox.
\n",
+ "default": null
+ },
+ {
+ "name": "key",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "streamlit.object_beta_warning": {
+ "name": "object_beta_warning",
+ "signature": "st.object_beta_warning(obj, obj_name, date)",
+ "description": "Wrapper for objects that are no longer in beta.",
+ "args": [
+ {
+ "name": "obj",
+ "type_name": "Any",
+ "is_optional": false,
+ "description": "The st. object that used to be in beta.
\n",
+ "default": null
+ },
+ {
+ "name": "obj_name",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "The name of the object within __init__.py
\n",
+ "default": null
+ },
+ {
+ "name": "date",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A date like "2020-01-01", indicating the last day we'll guarantee\nsupport for the beta_ prefix.
\n \n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.plotly_chart": {
+ "name": "plotly_chart",
+ "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)",
+ "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.",
+ "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
\nSee 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://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
+ },
+ {
+ "name": "To show Plotly charts in Streamlit, call `st.plotly_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Plotly's `py.plot` or `py.iplot`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.progress": {
+ "name": "progress",
+ "signature": "st.progress(value)",
+ "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.pydeck_chart": {
+ "name": "pydeck_chart",
+ "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)",
+ "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.",
+ "args": [
+ {
+ "name": "spec",
+ "type_name": "pydeck.Deck or None",
+ "is_optional": false,
+ "description": "Object specifying the PyDeck chart to draw.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.pyplot": {
+ "name": "pyplot",
+ "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)",
+ "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n",
+ "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n",
+ "description": "Display a slider widget to select items from a list.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "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": "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "streamlit.set_option": {
+ "name": "set_option",
+ "signature": "st.set_option(key, value)",
+ "description": "Set config option.",
+ "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
+ }
+ ]
+ },
+ "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\")",
+ "example": "\n>>> st.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... )\n
\n",
+ "description": "Configures the default settings of the page.",
+ "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"
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n",
+ "description": "Display a slider widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this slider is for.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "streamlit.spinner": {
+ "name": "spinner",
+ "signature": "st.spinner(text=\"In progress...\")",
+ "example": "\n\n>>> with st.spinner('Wait for it...'):\n>>> time.sleep(5)\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.stop": {
+ "name": "stop",
+ "signature": "st.stop()",
+ "example": "\n\n>>> name = st.text_input('Name')\n>>> if not name:\n>>> st.warning('Please input a name.')\n>>> st.stop()\n>>> st.success('Thank you for inputting a name.')\n
\n
\n",
+ "description": "Stops execution immediately.",
+ "args": []
+ },
+ "streamlit.subheader": {
+ "name": "subheader",
+ "signature": "st.subheader(body, anchor=None)",
+ "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "streamlit.success": {
+ "name": "success",
+ "signature": "st.success(body)",
+ "example": "\n\n>>> st.success('This is a success message!')\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
+ }
+ ]
+ },
+ "streamlit.table": {
+ "name": "table",
+ "signature": "st.table(data=None)",
+ "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a static table.",
+ "args": [
+ {
+ "name": "data",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.text": {
+ "name": "text",
+ "signature": "st.text(body)",
+ "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be 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
+ }
+ ]
+ },
+ "streamlit.time_input": {
+ "name": "time_input",
+ "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "streamlit.title": {
+ "name": "title",
+ "signature": "st.title(body, anchor=None)",
+ "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in title 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
+ }
+ ]
+ },
+ "streamlit.vega_lite_chart": {
+ "name": "vega_lite_chart",
+ "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, **kwargs)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.video": {
+ "name": "video",
+ "signature": "st.video(data, format=\"video/mp4\", start_time=0)",
+ "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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
+ }
+ ]
+ },
+ "streamlit.warning": {
+ "name": "warning",
+ "signature": "st.warning(body)",
+ "example": "\n\n>>> st.warning('This is a warning')\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
+ }
+ ]
+ },
+ "streamlit.write": {
+ "name": "write",
+ "signature": "st.write(*args, **kwargs)",
+ "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Write arguments to the app.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n",
+ "default": "False."
+ }
+ ]
+ },
+ "DeltaGenerator.add_rows": {
+ "name": "add_rows",
+ "signature": "element.add_rows(self, data=None, **kwargs)",
+ "example": "\n\n>>> df1 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_table = st.table(df1)\n>>>\n>>> df2 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_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
\nYou 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...\n>>> my_chart = st.line_chart(df1)\n>>> my_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
\nAnd for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:
\n\n>>> my_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... }),\n>>> my_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": "**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
+ }
+ ]
+ },
+ "DeltaGenerator.altair_chart": {
+ "name": "altair_chart",
+ "signature": "element.altair_chart(self, altair_chart, use_container_width=False)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\nExamples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.
\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
+ }
+ ]
+ },
+ "DeltaGenerator.area_chart": {
+ "name": "area_chart",
+ "signature": "element.area_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n
\n",
+ "description": "Display an area chart.",
+ "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": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.audio": {
+ "name": "audio",
+ "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0)",
+ "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n",
+ "default": "s"
+ }
+ ]
+ },
+ "DeltaGenerator.balloons": {
+ "name": "balloons",
+ "signature": "element.balloons(self)",
+ "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n",
+ "description": "Draw celebratory balloons.",
+ "args": []
+ },
+ "DeltaGenerator.bar_chart": {
+ "name": "bar_chart",
+ "signature": "element.bar_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n
\n",
+ "description": "Display a bar chart.",
+ "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": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.beta_columns": {
+ "name": "beta_columns",
+ "signature": "element.beta_columns(self, spec)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.beta_columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.beta_columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor example, st.beta_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
+ }
+ ]
+ },
+ "DeltaGenerator.beta_container": {
+ "name": "beta_container",
+ "signature": "element.beta_container(self)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with st.beta_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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.beta_container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "DeltaGenerator.beta_expander": {
+ "name": "beta_expander",
+ "signature": "element.beta_expander(self, label, expanded=False)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with st.beta_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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "DeltaGenerator.bokeh_chart": {
+ "name": "bokeh_chart",
+ "signature": "element.bokeh_chart(self, figure, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.",
+ "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
+ },
+ {
+ "name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Bokeh's `show`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.button": {
+ "name": "button",
+ "signature": "element.button(self, label, key=None, help=None, on_click=None, args=None, kwargs=None)",
+ "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type 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
+ }
+ ]
+ },
+ "DeltaGenerator.caption": {
+ "name": "caption",
+ "signature": "element.caption(self, body)",
+ "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in small font.",
+ "args": [
+ {
+ "name": "body",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "The text to display.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.checkbox": {
+ "name": "checkbox",
+ "signature": "element.checkbox(self, label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "DeltaGenerator.code": {
+ "name": "code",
+ "signature": "element.code(self, body, language=\"python\")",
+ "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a code block with optional syntax highlighting.",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "DeltaGenerator.dataframe": {
+ "name": "dataframe",
+ "signature": "element.dataframe(self, data=None, width=None, height=None)",
+ "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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.
\nIf '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 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 UI element expressed in pixels. If None, a\ndefault height is used.
\n",
+ "default": "height"
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "DeltaGenerator.empty": {
+ "name": "empty",
+ "signature": "element.empty(self)",
+ "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.beta_container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n",
+ "description": "Insert a single-element container.",
+ "args": []
+ },
+ "DeltaGenerator.error": {
+ "name": "error",
+ "signature": "element.error(self, body)",
+ "example": "\n\n>>> st.error('This is an error')\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
+ }
+ ]
+ },
+ "DeltaGenerator.exception": {
+ "name": "exception",
+ "signature": "element.exception(self, exception)",
+ "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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",
+ "description": "Display a file uploader widget.",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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
+ }
+ ]
+ },
+ "DeltaGenerator.form": {
+ "name": "form",
+ "signature": "element.form(self, key, clear_on_submit=False)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n",
+ "description": "Create a form that batches elements together with a \"Submit\" button.",
+ "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"
+ }
+ ]
+ },
+ "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.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.graphviz_chart": {
+ "name": "graphviz_chart",
+ "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.header": {
+ "name": "header",
+ "signature": "element.header(self, body, anchor=None)",
+ "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "DeltaGenerator.help": {
+ "name": "help",
+ "signature": "element.help(self, obj)",
+ "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n",
+ "description": "Display object's doc string, nicely formatted.",
+ "args": [
+ {
+ "name": "obj",
+ "type_name": "Object",
+ "is_optional": false,
+ "description": "The object whose docstring should be displayed.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"
+ }
+ ]
+ },
+ "DeltaGenerator.info": {
+ "name": "info",
+ "signature": "element.info(self, body)",
+ "example": "\n\n>>> st.info('This is a purely informational message')\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
+ }
+ ]
+ },
+ "DeltaGenerator.json": {
+ "name": "json",
+ "signature": "element.json(self, body)",
+ "example": "\n\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.latex": {
+ "name": "latex",
+ "signature": "element.latex(self, body)",
+ "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display mathematical expressions formatted as LaTeX.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.line_chart": {
+ "name": "line_chart",
+ "signature": "element.line_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st._arrow_line_chart(chart_data)\n
\n
\n",
+ "description": "Display a line chart.",
+ "args": [
+ {
+ "name": "data",
+ "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",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.map": {
+ "name": "map",
+ "signature": "element.map(self, data=None, zoom=None, use_container_width=True)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a map with points on it.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.markdown": {
+ "name": "markdown",
+ "signature": "element.markdown(self, body, unsafe_allow_html=False)",
+ "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n",
+ "description": "Display a multiselect widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this select widget 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 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": "[str] or None",
+ "is_optional": false,
+ "description": "List of default values.
\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 selectbox.
\n",
+ "default": null
+ },
+ {
+ "name": "key",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "DeltaGenerator.plotly_chart": {
+ "name": "plotly_chart",
+ "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)",
+ "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.",
+ "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
\nSee 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://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
+ },
+ {
+ "name": "To show Plotly charts in Streamlit, call `st.plotly_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Plotly's `py.plot` or `py.iplot`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.progress": {
+ "name": "progress",
+ "signature": "element.progress(self, value)",
+ "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.pydeck_chart": {
+ "name": "pydeck_chart",
+ "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)",
+ "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.",
+ "args": [
+ {
+ "name": "spec",
+ "type_name": "pydeck.Deck or None",
+ "is_optional": false,
+ "description": "Object specifying the PyDeck chart to draw.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.pyplot": {
+ "name": "pyplot",
+ "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)",
+ "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n",
+ "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n",
+ "description": "Display a slider widget to select items from a list.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "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": "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n",
+ "description": "Display a slider widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this slider is for.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "DeltaGenerator.subheader": {
+ "name": "subheader",
+ "signature": "element.subheader(self, body, anchor=None)",
+ "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "DeltaGenerator.success": {
+ "name": "success",
+ "signature": "element.success(self, body)",
+ "example": "\n\n>>> st.success('This is a success message!')\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
+ }
+ ]
+ },
+ "DeltaGenerator.table": {
+ "name": "table",
+ "signature": "element.table(self, data=None)",
+ "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a static table.",
+ "args": [
+ {
+ "name": "data",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.text": {
+ "name": "text",
+ "signature": "element.text(self, body)",
+ "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "DeltaGenerator.title": {
+ "name": "title",
+ "signature": "element.title(self, body, anchor=None)",
+ "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in title 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
+ }
+ ]
+ },
+ "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\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.video": {
+ "name": "video",
+ "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)",
+ "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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
+ }
+ ]
+ },
+ "DeltaGenerator.warning": {
+ "name": "warning",
+ "signature": "element.warning(self, body)",
+ "example": "\n\n>>> st.warning('This is a warning')\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
+ }
+ ]
+ },
+ "DeltaGenerator.write": {
+ "name": "write",
+ "signature": "element.write(self, *args, **kwargs)",
+ "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Write arguments to the app.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n",
+ "default": "False."
+ }
+ ]
+ }
+ },
+ "0.86.0": {
+ "streamlit.altair_chart": {
+ "name": "altair_chart",
+ "signature": "st.altair_chart(altair_chart, use_container_width=False)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\nExamples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.
\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
+ }
+ ]
+ },
+ "streamlit.area_chart": {
+ "name": "area_chart",
+ "signature": "st.area_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n
\n",
+ "description": "Display an area chart.",
+ "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": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.audio": {
+ "name": "audio",
+ "signature": "st.audio(data, format=\"audio/wav\", start_time=0)",
+ "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n",
+ "default": "s"
+ }
+ ]
+ },
+ "streamlit.balloons": {
+ "name": "balloons",
+ "signature": "st.balloons()",
+ "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n",
+ "description": "Draw celebratory balloons.",
+ "args": []
+ },
+ "streamlit.bar_chart": {
+ "name": "bar_chart",
+ "signature": "st.bar_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n
\n",
+ "description": "Display a bar chart.",
+ "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": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.beta_columns": {
+ "name": "beta_columns",
+ "signature": "st.beta_columns(*args, **kwargs)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor 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
+ }
+ ]
+ },
+ "streamlit.beta_container": {
+ "name": "beta_container",
+ "signature": "st.beta_container(*args, **kwargs)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "streamlit.beta_expander": {
+ "name": "beta_expander",
+ "signature": "st.beta_expander(*args, **kwargs)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "streamlit.bokeh_chart": {
+ "name": "bokeh_chart",
+ "signature": "st.bokeh_chart(figure, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.",
+ "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
+ },
+ {
+ "name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Bokeh's `show`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.button": {
+ "name": "button",
+ "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None)",
+ "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type 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
+ }
+ ]
+ },
+ "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\n... def fetch_and_clean_data(url):\n... # Fetch data from URL here, and then clean it up.\n... return data\n...\n>>> d1 = fetch_and_clean_data(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> d2 = 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>>>\n>>> d3 = fetch_and_clean_data(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nTo 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
\nTo 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
\nTo 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
\nAlternatively, 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",
+ "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 normally shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.
\nIf 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 functions 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."
+ }
+ ]
+ },
+ "streamlit.caption": {
+ "name": "caption",
+ "signature": "st.caption(body)",
+ "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in small font.",
+ "args": [
+ {
+ "name": "body",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "The text to display.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.checkbox": {
+ "name": "checkbox",
+ "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "streamlit.code": {
+ "name": "code",
+ "signature": "st.code(body, language=\"python\")",
+ "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a code block with optional syntax highlighting.",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.color_picker": {
+ "name": "color_picker",
+ "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "streamlit.columns": {
+ "name": "columns",
+ "signature": "st.columns(spec)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor 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
+ }
+ ]
+ },
+ "streamlit.container": {
+ "name": "container",
+ "signature": "st.container()",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "streamlit.dataframe": {
+ "name": "dataframe",
+ "signature": "st.dataframe(data=None, width=None, height=None)",
+ "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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.
\nIf '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 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 UI element expressed in pixels. If None, a\ndefault height is used.
\n",
+ "default": "height"
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "streamlit.echo": {
+ "name": "echo",
+ "signature": "st.echo(code_location=\"above\")",
+ "example": "\n\n>>> with 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
+ }
+ ]
+ },
+ "streamlit.empty": {
+ "name": "empty",
+ "signature": "st.empty()",
+ "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n",
+ "description": "Insert a single-element container.",
+ "args": []
+ },
+ "streamlit.error": {
+ "name": "error",
+ "signature": "st.error(body)",
+ "example": "\n\n>>> st.error('This is an error')\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
+ }
+ ]
+ },
+ "streamlit.exception": {
+ "name": "exception",
+ "signature": "st.exception(exception)",
+ "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.expander": {
+ "name": "expander",
+ "signature": "st.expander(label, expanded=False)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "streamlit.experimental_get_query_params": {
+ "name": "experimental_get_query_params",
+ "signature": "st.experimental_get_query_params()",
+ "example": "\nLet'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\n>>> st.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\nNote 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": []
+ },
+ "streamlit.experimental_rerun": {
+ "name": "experimental_rerun",
+ "signature": "st.experimental_rerun()",
+ "description": "Rerun the script immediately.",
+ "args": []
+ },
+ "streamlit.experimental_set_query_params": {
+ "name": "experimental_set_query_params",
+ "signature": "st.experimental_set_query_params(**query_params)",
+ "example": "\nTo 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\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.experimental_show": {
+ "name": "experimental_show",
+ "signature": "st.experimental_show(*args)",
+ "notes": "\nThis 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- When passing multiple arguments the inclusion of , or ) in a string
\n
\n \nargument may cause an error.
\n
\n",
+ "example": "\n\n>>> dataframe = pd.DataFrame({\n... 'first column': [1, 2, 3, 4],\n... 'second column': [10, 20, 30, 40],\n... }))\n>>> st.experimental_show(dataframe)\n
\n
\n",
+ "description": "Write arguments and *argument names* to your app for debugging purposes.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to debug in the App.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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)",
+ "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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",
+ "description": "Display a file uploader widget.",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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
+ }
+ ]
+ },
+ "streamlit.form": {
+ "name": "form",
+ "signature": "st.form(key, clear_on_submit=False)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n",
+ "description": "Create a form that batches elements together with a \"Submit\" button.",
+ "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"
+ }
+ ]
+ },
+ "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.",
+ "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
+ }
+ ]
+ },
+ "streamlit.get_option": {
+ "name": "get_option",
+ "signature": "st.get_option(key)",
+ "description": "Return the current value of a given Streamlit config option.",
+ "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
+ }
+ ]
+ },
+ "streamlit.graphviz_chart": {
+ "name": "graphviz_chart",
+ "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.header": {
+ "name": "header",
+ "signature": "st.header(body, anchor=None)",
+ "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "streamlit.help": {
+ "name": "help",
+ "signature": "st.help(obj)",
+ "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n",
+ "description": "Display object's doc string, nicely formatted.",
+ "args": [
+ {
+ "name": "obj",
+ "type_name": "Object",
+ "is_optional": false,
+ "description": "The object whose docstring should be displayed.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"
+ }
+ ]
+ },
+ "streamlit.info": {
+ "name": "info",
+ "signature": "st.info(body)",
+ "example": "\n\n>>> st.info('This is a purely informational message')\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
+ }
+ ]
+ },
+ "streamlit.json": {
+ "name": "json",
+ "signature": "st.json(body)",
+ "example": "\n\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.latex": {
+ "name": "latex",
+ "signature": "st.latex(body)",
+ "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display mathematical expressions formatted as LaTeX.",
+ "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
+ }
+ ]
+ },
+ "streamlit.line_chart": {
+ "name": "line_chart",
+ "signature": "st.line_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st._arrow_line_chart(chart_data)\n
\n
\n",
+ "description": "Display a line chart.",
+ "args": [
+ {
+ "name": "data",
+ "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",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.map": {
+ "name": "map",
+ "signature": "st.map(data=None, zoom=None, use_container_width=True)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a map with points on it.",
+ "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
+ }
+ ]
+ },
+ "streamlit.markdown": {
+ "name": "markdown",
+ "signature": "st.markdown(body, unsafe_allow_html=False)",
+ "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n",
+ "description": "Display a multiselect widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this select widget 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 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": "[str] or None",
+ "is_optional": false,
+ "description": "List of default values.
\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 selectbox.
\n",
+ "default": null
+ },
+ {
+ "name": "key",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "streamlit.plotly_chart": {
+ "name": "plotly_chart",
+ "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)",
+ "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.",
+ "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
\nSee 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://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
+ },
+ {
+ "name": "To show Plotly charts in Streamlit, call `st.plotly_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Plotly's `py.plot` or `py.iplot`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.progress": {
+ "name": "progress",
+ "signature": "st.progress(value)",
+ "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.pydeck_chart": {
+ "name": "pydeck_chart",
+ "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)",
+ "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.",
+ "args": [
+ {
+ "name": "spec",
+ "type_name": "pydeck.Deck or None",
+ "is_optional": false,
+ "description": "Object specifying the PyDeck chart to draw.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.pyplot": {
+ "name": "pyplot",
+ "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)",
+ "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n",
+ "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n",
+ "description": "Display a slider widget to select items from a list.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "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": "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "streamlit.set_option": {
+ "name": "set_option",
+ "signature": "st.set_option(key, value)",
+ "description": "Set config option.",
+ "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
+ }
+ ]
+ },
+ "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\")",
+ "example": "\n>>> st.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... )\n
\n",
+ "description": "Configures the default settings of the page.",
+ "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"
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n",
+ "description": "Display a slider widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this slider is for.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "streamlit.spinner": {
+ "name": "spinner",
+ "signature": "st.spinner(text=\"In progress...\")",
+ "example": "\n\n>>> with st.spinner('Wait for it...'):\n>>> time.sleep(5)\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.stop": {
+ "name": "stop",
+ "signature": "st.stop()",
+ "example": "\n\n>>> name = st.text_input('Name')\n>>> if not name:\n>>> st.warning('Please input a name.')\n>>> st.stop()\n>>> st.success('Thank you for inputting a name.')\n
\n
\n",
+ "description": "Stops execution immediately.",
+ "args": []
+ },
+ "streamlit.subheader": {
+ "name": "subheader",
+ "signature": "st.subheader(body, anchor=None)",
+ "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "streamlit.success": {
+ "name": "success",
+ "signature": "st.success(body)",
+ "example": "\n\n>>> st.success('This is a success message!')\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
+ }
+ ]
+ },
+ "streamlit.table": {
+ "name": "table",
+ "signature": "st.table(data=None)",
+ "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a static table.",
+ "args": [
+ {
+ "name": "data",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.text": {
+ "name": "text",
+ "signature": "st.text(body)",
+ "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be 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
+ }
+ ]
+ },
+ "streamlit.time_input": {
+ "name": "time_input",
+ "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "streamlit.title": {
+ "name": "title",
+ "signature": "st.title(body, anchor=None)",
+ "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in title 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
+ }
+ ]
+ },
+ "streamlit.vega_lite_chart": {
+ "name": "vega_lite_chart",
+ "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, **kwargs)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.video": {
+ "name": "video",
+ "signature": "st.video(data, format=\"video/mp4\", start_time=0)",
+ "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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
+ }
+ ]
+ },
+ "streamlit.warning": {
+ "name": "warning",
+ "signature": "st.warning(body)",
+ "example": "\n\n>>> st.warning('This is a warning')\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
+ }
+ ]
+ },
+ "streamlit.write": {
+ "name": "write",
+ "signature": "st.write(*args, **kwargs)",
+ "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Write arguments to the app.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n",
+ "default": "False."
+ }
+ ]
+ },
+ "DeltaGenerator.add_rows": {
+ "name": "add_rows",
+ "signature": "element.add_rows(self, data=None, **kwargs)",
+ "example": "\n\n>>> df1 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_table = st.table(df1)\n>>>\n>>> df2 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_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
\nYou 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...\n>>> my_chart = st.line_chart(df1)\n>>> my_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
\nAnd for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:
\n\n>>> my_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... }),\n>>> my_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": "**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
+ }
+ ]
+ },
+ "DeltaGenerator.altair_chart": {
+ "name": "altair_chart",
+ "signature": "element.altair_chart(self, altair_chart, use_container_width=False)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\nExamples of Altair charts can be found at\nhttps://altair-viz.github.io/gallery/.
\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
+ }
+ ]
+ },
+ "DeltaGenerator.area_chart": {
+ "name": "area_chart",
+ "signature": "element.area_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n
\n",
+ "description": "Display an area chart.",
+ "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": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.audio": {
+ "name": "audio",
+ "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0)",
+ "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n",
+ "default": "s"
+ }
+ ]
+ },
+ "DeltaGenerator.balloons": {
+ "name": "balloons",
+ "signature": "element.balloons(self)",
+ "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n",
+ "description": "Draw celebratory balloons.",
+ "args": []
+ },
+ "DeltaGenerator.bar_chart": {
+ "name": "bar_chart",
+ "signature": "element.bar_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n
\n",
+ "description": "Display a bar chart.",
+ "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": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.beta_columns": {
+ "name": "beta_columns",
+ "signature": "element.beta_columns(*args, **kwargs)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor 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
+ }
+ ]
+ },
+ "DeltaGenerator.beta_container": {
+ "name": "beta_container",
+ "signature": "element.beta_container(*args, **kwargs)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "DeltaGenerator.beta_expander": {
+ "name": "beta_expander",
+ "signature": "element.beta_expander(*args, **kwargs)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "DeltaGenerator.bokeh_chart": {
+ "name": "bokeh_chart",
+ "signature": "element.bokeh_chart(self, figure, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.",
+ "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
+ },
+ {
+ "name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Bokeh's `show`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.button": {
+ "name": "button",
+ "signature": "element.button(self, label, key=None, help=None, on_click=None, args=None, kwargs=None)",
+ "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type 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
+ }
+ ]
+ },
+ "DeltaGenerator.caption": {
+ "name": "caption",
+ "signature": "element.caption(self, body)",
+ "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in small font.",
+ "args": [
+ {
+ "name": "body",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "The text to display.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.checkbox": {
+ "name": "checkbox",
+ "signature": "element.checkbox(self, label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "DeltaGenerator.code": {
+ "name": "code",
+ "signature": "element.code(self, body, language=\"python\")",
+ "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a code block with optional syntax highlighting.",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "DeltaGenerator.columns": {
+ "name": "columns",
+ "signature": "element.columns(self, spec)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor 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
+ }
+ ]
+ },
+ "DeltaGenerator.container": {
+ "name": "container",
+ "signature": "element.container(self)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "DeltaGenerator.dataframe": {
+ "name": "dataframe",
+ "signature": "element.dataframe(self, data=None, width=None, height=None)",
+ "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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.
\nIf '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 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 UI element expressed in pixels. If None, a\ndefault height is used.
\n",
+ "default": "height"
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "DeltaGenerator.empty": {
+ "name": "empty",
+ "signature": "element.empty(self)",
+ "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n",
+ "description": "Insert a single-element container.",
+ "args": []
+ },
+ "DeltaGenerator.error": {
+ "name": "error",
+ "signature": "element.error(self, body)",
+ "example": "\n\n>>> st.error('This is an error')\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
+ }
+ ]
+ },
+ "DeltaGenerator.exception": {
+ "name": "exception",
+ "signature": "element.exception(self, exception)",
+ "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.expander": {
+ "name": "expander",
+ "signature": "element.expander(self, label, expanded=False)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "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)",
+ "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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",
+ "description": "Display a file uploader widget.",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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
+ }
+ ]
+ },
+ "DeltaGenerator.form": {
+ "name": "form",
+ "signature": "element.form(self, key, clear_on_submit=False)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n",
+ "description": "Create a form that batches elements together with a \"Submit\" button.",
+ "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"
+ }
+ ]
+ },
+ "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.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.graphviz_chart": {
+ "name": "graphviz_chart",
+ "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.header": {
+ "name": "header",
+ "signature": "element.header(self, body, anchor=None)",
+ "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "DeltaGenerator.help": {
+ "name": "help",
+ "signature": "element.help(self, obj)",
+ "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n",
+ "description": "Display object's doc string, nicely formatted.",
+ "args": [
+ {
+ "name": "obj",
+ "type_name": "Object",
+ "is_optional": false,
+ "description": "The object whose docstring should be displayed.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"
+ }
+ ]
+ },
+ "DeltaGenerator.info": {
+ "name": "info",
+ "signature": "element.info(self, body)",
+ "example": "\n\n>>> st.info('This is a purely informational message')\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
+ }
+ ]
+ },
+ "DeltaGenerator.json": {
+ "name": "json",
+ "signature": "element.json(self, body)",
+ "example": "\n\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.latex": {
+ "name": "latex",
+ "signature": "element.latex(self, body)",
+ "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display mathematical expressions formatted as LaTeX.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.line_chart": {
+ "name": "line_chart",
+ "signature": "element.line_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st._arrow_line_chart(chart_data)\n
\n
\n",
+ "description": "Display a line chart.",
+ "args": [
+ {
+ "name": "data",
+ "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",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.map": {
+ "name": "map",
+ "signature": "element.map(self, data=None, zoom=None, use_container_width=True)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a map with points on it.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.markdown": {
+ "name": "markdown",
+ "signature": "element.markdown(self, body, unsafe_allow_html=False)",
+ "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n",
+ "description": "Display a multiselect widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this select widget 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 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": "[str] or None",
+ "is_optional": false,
+ "description": "List of default values.
\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 selectbox.
\n",
+ "default": null
+ },
+ {
+ "name": "key",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "DeltaGenerator.plotly_chart": {
+ "name": "plotly_chart",
+ "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)",
+ "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.",
+ "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
\nSee 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://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
+ },
+ {
+ "name": "To show Plotly charts in Streamlit, call `st.plotly_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Plotly's `py.plot` or `py.iplot`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.progress": {
+ "name": "progress",
+ "signature": "element.progress(self, value)",
+ "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.pydeck_chart": {
+ "name": "pydeck_chart",
+ "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)",
+ "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.",
+ "args": [
+ {
+ "name": "spec",
+ "type_name": "pydeck.Deck or None",
+ "is_optional": false,
+ "description": "Object specifying the PyDeck chart to draw.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.pyplot": {
+ "name": "pyplot",
+ "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)",
+ "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n",
+ "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n",
+ "description": "Display a slider widget to select items from a list.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "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": "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n",
+ "description": "Display a slider widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this slider is for.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "DeltaGenerator.subheader": {
+ "name": "subheader",
+ "signature": "element.subheader(self, body, anchor=None)",
+ "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "DeltaGenerator.success": {
+ "name": "success",
+ "signature": "element.success(self, body)",
+ "example": "\n\n>>> st.success('This is a success message!')\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
+ }
+ ]
+ },
+ "DeltaGenerator.table": {
+ "name": "table",
+ "signature": "element.table(self, data=None)",
+ "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a static table.",
+ "args": [
+ {
+ "name": "data",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.text": {
+ "name": "text",
+ "signature": "element.text(self, body)",
+ "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "DeltaGenerator.title": {
+ "name": "title",
+ "signature": "element.title(self, body, anchor=None)",
+ "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in title 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
+ }
+ ]
+ },
+ "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\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.video": {
+ "name": "video",
+ "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)",
+ "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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
+ }
+ ]
+ },
+ "DeltaGenerator.warning": {
+ "name": "warning",
+ "signature": "element.warning(self, body)",
+ "example": "\n\n>>> st.warning('This is a warning')\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
+ }
+ ]
+ },
+ "DeltaGenerator.write": {
+ "name": "write",
+ "signature": "element.write(self, *args, **kwargs)",
+ "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Write arguments to the app.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n",
+ "default": "False."
+ }
+ ]
+ }
+ },
+ "0.87.0": {
+ "streamlit.altair_chart": {
+ "name": "altair_chart",
+ "signature": "st.altair_chart(altair_chart, use_container_width=False)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\nExamples 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
+ }
+ ]
+ },
+ "streamlit.area_chart": {
+ "name": "area_chart",
+ "signature": "st.area_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display an area chart.",
+ "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": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.audio": {
+ "name": "audio",
+ "signature": "st.audio(data, format=\"audio/wav\", start_time=0)",
+ "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n",
+ "default": "s"
+ }
+ ]
+ },
+ "streamlit.balloons": {
+ "name": "balloons",
+ "signature": "st.balloons()",
+ "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n",
+ "description": "Draw celebratory balloons.",
+ "args": []
+ },
+ "streamlit.bar_chart": {
+ "name": "bar_chart",
+ "signature": "st.bar_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a bar chart.",
+ "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": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.beta_columns": {
+ "name": "beta_columns",
+ "signature": "st.beta_columns(*args, **kwargs)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor 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
+ }
+ ]
+ },
+ "streamlit.beta_container": {
+ "name": "beta_container",
+ "signature": "st.beta_container(*args, **kwargs)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "streamlit.beta_expander": {
+ "name": "beta_expander",
+ "signature": "st.beta_expander(*args, **kwargs)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "streamlit.bokeh_chart": {
+ "name": "bokeh_chart",
+ "signature": "st.bokeh_chart(figure, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.",
+ "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
+ },
+ {
+ "name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Bokeh's `show`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.button": {
+ "name": "button",
+ "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None)",
+ "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type 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
+ }
+ ]
+ },
+ "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\n... def fetch_and_clean_data(url):\n... # Fetch data from URL here, and then clean it up.\n... return data\n...\n>>> d1 = fetch_and_clean_data(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> d2 = 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>>>\n>>> d3 = fetch_and_clean_data(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nTo 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
\nTo 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
\nTo 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
\nAlternatively, 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",
+ "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 normally shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.
\nIf 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 functions 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."
+ }
+ ]
+ },
+ "streamlit.caption": {
+ "name": "caption",
+ "signature": "st.caption(body)",
+ "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in small font.",
+ "args": [
+ {
+ "name": "body",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "The text to display.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.checkbox": {
+ "name": "checkbox",
+ "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "streamlit.code": {
+ "name": "code",
+ "signature": "st.code(body, language=\"python\")",
+ "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a code block with optional syntax highlighting.",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.color_picker": {
+ "name": "color_picker",
+ "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "streamlit.columns": {
+ "name": "columns",
+ "signature": "st.columns(spec)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor 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
+ }
+ ]
+ },
+ "streamlit.container": {
+ "name": "container",
+ "signature": "st.container()",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "streamlit.dataframe": {
+ "name": "dataframe",
+ "signature": "st.dataframe(data=None, width=None, height=None)",
+ "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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.
\nIf '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 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 UI element expressed in pixels. If None, a\ndefault height is used.
\n",
+ "default": "height"
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "streamlit.echo": {
+ "name": "echo",
+ "signature": "st.echo(code_location=\"above\")",
+ "example": "\n\n>>> with 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
+ }
+ ]
+ },
+ "streamlit.empty": {
+ "name": "empty",
+ "signature": "st.empty()",
+ "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n",
+ "description": "Insert a single-element container.",
+ "args": []
+ },
+ "streamlit.error": {
+ "name": "error",
+ "signature": "st.error(body)",
+ "example": "\n\n>>> st.error('This is an error')\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
+ }
+ ]
+ },
+ "streamlit.exception": {
+ "name": "exception",
+ "signature": "st.exception(exception)",
+ "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.expander": {
+ "name": "expander",
+ "signature": "st.expander(label, expanded=False)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "streamlit.experimental_get_query_params": {
+ "name": "experimental_get_query_params",
+ "signature": "st.experimental_get_query_params()",
+ "example": "\nLet'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\n>>> st.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\nNote 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": []
+ },
+ "streamlit.experimental_rerun": {
+ "name": "experimental_rerun",
+ "signature": "st.experimental_rerun()",
+ "description": "Rerun the script immediately.",
+ "args": []
+ },
+ "streamlit.experimental_set_query_params": {
+ "name": "experimental_set_query_params",
+ "signature": "st.experimental_set_query_params(**query_params)",
+ "example": "\nTo 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\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.experimental_show": {
+ "name": "experimental_show",
+ "signature": "st.experimental_show(*args)",
+ "notes": "\nThis 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- When passing multiple arguments the inclusion of , or ) in a string
\n
\n \nargument may cause an error.
\n
\n",
+ "example": "\n\n>>> dataframe = pd.DataFrame({\n... 'first column': [1, 2, 3, 4],\n... 'second column': [10, 20, 30, 40],\n... }))\n>>> st.experimental_show(dataframe)\n
\n
\n",
+ "description": "Write arguments and *argument names* to your app for debugging purposes.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to debug in the App.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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)",
+ "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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",
+ "description": "Display a file uploader widget.",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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
+ }
+ ]
+ },
+ "streamlit.form": {
+ "name": "form",
+ "signature": "st.form(key, clear_on_submit=False)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n",
+ "description": "Create a form that batches elements together with a \"Submit\" button.",
+ "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"
+ }
+ ]
+ },
+ "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.",
+ "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
+ }
+ ]
+ },
+ "streamlit.get_option": {
+ "name": "get_option",
+ "signature": "st.get_option(key)",
+ "description": "Return the current value of a given Streamlit config option.",
+ "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
+ }
+ ]
+ },
+ "streamlit.graphviz_chart": {
+ "name": "graphviz_chart",
+ "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.header": {
+ "name": "header",
+ "signature": "st.header(body, anchor=None)",
+ "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "streamlit.help": {
+ "name": "help",
+ "signature": "st.help(obj)",
+ "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n",
+ "description": "Display object's doc string, nicely formatted.",
+ "args": [
+ {
+ "name": "obj",
+ "type_name": "Object",
+ "is_optional": false,
+ "description": "The object whose docstring should be displayed.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"
+ }
+ ]
+ },
+ "streamlit.info": {
+ "name": "info",
+ "signature": "st.info(body)",
+ "example": "\n\n>>> st.info('This is a purely informational message')\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
+ }
+ ]
+ },
+ "streamlit.json": {
+ "name": "json",
+ "signature": "st.json(body)",
+ "example": "\n\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.latex": {
+ "name": "latex",
+ "signature": "st.latex(body)",
+ "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display mathematical expressions formatted as LaTeX.",
+ "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
+ }
+ ]
+ },
+ "streamlit.line_chart": {
+ "name": "line_chart",
+ "signature": "st.line_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a line chart.",
+ "args": [
+ {
+ "name": "data",
+ "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",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.map": {
+ "name": "map",
+ "signature": "st.map(data=None, zoom=None, use_container_width=True)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a map with points on it.",
+ "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
+ }
+ ]
+ },
+ "streamlit.markdown": {
+ "name": "markdown",
+ "signature": "st.markdown(body, unsafe_allow_html=False)",
+ "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.metric": {
+ "name": "metric",
+ "signature": "st.metric(label, value, delta=None, delta_color=\"normal\")",
+ "example": "\n\n>>> st.metric(label="Active developers", value=123, delta=123,\n... delta_color="off") # arrow up, gray\n
\n
\n",
+ "description": "Display a metric in big bold font, with an optional indicator of how the metric changed.",
+ "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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n",
+ "description": "Display a multiselect widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this select widget 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 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": "[str] or None",
+ "is_optional": false,
+ "description": "List of default values.
\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 selectbox.
\n",
+ "default": null
+ },
+ {
+ "name": "key",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "streamlit.plotly_chart": {
+ "name": "plotly_chart",
+ "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)",
+ "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.",
+ "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
\nSee 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://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
+ },
+ {
+ "name": "To show Plotly charts in Streamlit, call `st.plotly_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Plotly's `py.plot` or `py.iplot`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.progress": {
+ "name": "progress",
+ "signature": "st.progress(value)",
+ "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.pydeck_chart": {
+ "name": "pydeck_chart",
+ "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)",
+ "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.",
+ "args": [
+ {
+ "name": "spec",
+ "type_name": "pydeck.Deck or None",
+ "is_optional": false,
+ "description": "Object specifying the PyDeck chart to draw.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.pyplot": {
+ "name": "pyplot",
+ "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)",
+ "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n",
+ "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n",
+ "description": "Display a slider widget to select items from a list.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "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": "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "streamlit.set_option": {
+ "name": "set_option",
+ "signature": "st.set_option(key, value)",
+ "description": "Set config option.",
+ "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
+ }
+ ]
+ },
+ "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\")",
+ "example": "\n>>> st.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... )\n
\n",
+ "description": "Configures the default settings of the page.",
+ "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"
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n",
+ "description": "Display a slider widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this slider is for.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "streamlit.spinner": {
+ "name": "spinner",
+ "signature": "st.spinner(text=\"In progress...\")",
+ "example": "\n\n>>> with st.spinner('Wait for it...'):\n>>> time.sleep(5)\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.stop": {
+ "name": "stop",
+ "signature": "st.stop()",
+ "example": "\n\n>>> name = st.text_input('Name')\n>>> if not name:\n>>> st.warning('Please input a name.')\n>>> st.stop()\n>>> st.success('Thank you for inputting a name.')\n
\n
\n",
+ "description": "Stops execution immediately.",
+ "args": []
+ },
+ "streamlit.subheader": {
+ "name": "subheader",
+ "signature": "st.subheader(body, anchor=None)",
+ "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "streamlit.success": {
+ "name": "success",
+ "signature": "st.success(body)",
+ "example": "\n\n>>> st.success('This is a success message!')\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
+ }
+ ]
+ },
+ "streamlit.table": {
+ "name": "table",
+ "signature": "st.table(data=None)",
+ "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a static table.",
+ "args": [
+ {
+ "name": "data",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.text": {
+ "name": "text",
+ "signature": "st.text(body)",
+ "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be 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
+ }
+ ]
+ },
+ "streamlit.time_input": {
+ "name": "time_input",
+ "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "streamlit.title": {
+ "name": "title",
+ "signature": "st.title(body, anchor=None)",
+ "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in title 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
+ }
+ ]
+ },
+ "streamlit.vega_lite_chart": {
+ "name": "vega_lite_chart",
+ "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, **kwargs)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.video": {
+ "name": "video",
+ "signature": "st.video(data, format=\"video/mp4\", start_time=0)",
+ "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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
+ }
+ ]
+ },
+ "streamlit.warning": {
+ "name": "warning",
+ "signature": "st.warning(body)",
+ "example": "\n\n>>> st.warning('This is a warning')\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
+ }
+ ]
+ },
+ "streamlit.write": {
+ "name": "write",
+ "signature": "st.write(*args, **kwargs)",
+ "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Write arguments to the app.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n",
+ "default": "False."
+ }
+ ]
+ },
+ "DeltaGenerator.add_rows": {
+ "name": "add_rows",
+ "signature": "element.add_rows(self, data=None, **kwargs)",
+ "example": "\n\n>>> df1 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_table = st.table(df1)\n>>>\n>>> df2 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_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
\nYou 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...\n>>> my_chart = st.line_chart(df1)\n>>> my_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
\nAnd for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:
\n\n>>> my_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... }),\n>>> my_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": "**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
+ }
+ ]
+ },
+ "DeltaGenerator.altair_chart": {
+ "name": "altair_chart",
+ "signature": "element.altair_chart(self, altair_chart, use_container_width=False)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\nExamples 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
+ }
+ ]
+ },
+ "DeltaGenerator.area_chart": {
+ "name": "area_chart",
+ "signature": "element.area_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display an area chart.",
+ "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": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.audio": {
+ "name": "audio",
+ "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0)",
+ "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n",
+ "default": "s"
+ }
+ ]
+ },
+ "DeltaGenerator.balloons": {
+ "name": "balloons",
+ "signature": "element.balloons(self)",
+ "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n",
+ "description": "Draw celebratory balloons.",
+ "args": []
+ },
+ "DeltaGenerator.bar_chart": {
+ "name": "bar_chart",
+ "signature": "element.bar_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a bar chart.",
+ "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": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.beta_columns": {
+ "name": "beta_columns",
+ "signature": "element.beta_columns(*args, **kwargs)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor 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
+ }
+ ]
+ },
+ "DeltaGenerator.beta_container": {
+ "name": "beta_container",
+ "signature": "element.beta_container(*args, **kwargs)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "DeltaGenerator.beta_expander": {
+ "name": "beta_expander",
+ "signature": "element.beta_expander(*args, **kwargs)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "DeltaGenerator.bokeh_chart": {
+ "name": "bokeh_chart",
+ "signature": "element.bokeh_chart(self, figure, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.",
+ "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
+ },
+ {
+ "name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Bokeh's `show`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.button": {
+ "name": "button",
+ "signature": "element.button(self, label, key=None, help=None, on_click=None, args=None, kwargs=None)",
+ "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type 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
+ }
+ ]
+ },
+ "DeltaGenerator.caption": {
+ "name": "caption",
+ "signature": "element.caption(self, body)",
+ "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in small font.",
+ "args": [
+ {
+ "name": "body",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "The text to display.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.checkbox": {
+ "name": "checkbox",
+ "signature": "element.checkbox(self, label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "DeltaGenerator.code": {
+ "name": "code",
+ "signature": "element.code(self, body, language=\"python\")",
+ "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a code block with optional syntax highlighting.",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "DeltaGenerator.columns": {
+ "name": "columns",
+ "signature": "element.columns(self, spec)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor 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
+ }
+ ]
+ },
+ "DeltaGenerator.container": {
+ "name": "container",
+ "signature": "element.container(self)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "DeltaGenerator.dataframe": {
+ "name": "dataframe",
+ "signature": "element.dataframe(self, data=None, width=None, height=None)",
+ "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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.
\nIf '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 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 UI element expressed in pixels. If None, a\ndefault height is used.
\n",
+ "default": "height"
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "DeltaGenerator.determine_delta_color_and_direction": {
+ "name": "determine_delta_color_and_direction",
+ "signature": "element.determine_delta_color_and_direction(self, delta_color, delta)"
+ },
+ "DeltaGenerator.empty": {
+ "name": "empty",
+ "signature": "element.empty(self)",
+ "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n",
+ "description": "Insert a single-element container.",
+ "args": []
+ },
+ "DeltaGenerator.error": {
+ "name": "error",
+ "signature": "element.error(self, body)",
+ "example": "\n\n>>> st.error('This is an error')\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
+ }
+ ]
+ },
+ "DeltaGenerator.exception": {
+ "name": "exception",
+ "signature": "element.exception(self, exception)",
+ "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.expander": {
+ "name": "expander",
+ "signature": "element.expander(self, label, expanded=False)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "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)",
+ "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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",
+ "description": "Display a file uploader widget.",
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. 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
+ }
+ ]
+ },
+ "DeltaGenerator.form": {
+ "name": "form",
+ "signature": "element.form(self, key, clear_on_submit=False)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n",
+ "description": "Create a form that batches elements together with a \"Submit\" button.",
+ "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"
+ }
+ ]
+ },
+ "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.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.graphviz_chart": {
+ "name": "graphviz_chart",
+ "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.header": {
+ "name": "header",
+ "signature": "element.header(self, body, anchor=None)",
+ "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "DeltaGenerator.help": {
+ "name": "help",
+ "signature": "element.help(self, obj)",
+ "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n",
+ "description": "Display object's doc string, nicely formatted.",
+ "args": [
+ {
+ "name": "obj",
+ "type_name": "Object",
+ "is_optional": false,
+ "description": "The object whose docstring should be displayed.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"
+ }
+ ]
+ },
+ "DeltaGenerator.info": {
+ "name": "info",
+ "signature": "element.info(self, body)",
+ "example": "\n\n>>> st.info('This is a purely informational message')\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
+ }
+ ]
+ },
+ "DeltaGenerator.is_negative": {
+ "name": "is_negative",
+ "signature": "element.is_negative(self, delta)"
+ },
+ "DeltaGenerator.json": {
+ "name": "json",
+ "signature": "element.json(self, body)",
+ "example": "\n\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.latex": {
+ "name": "latex",
+ "signature": "element.latex(self, body)",
+ "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display mathematical expressions formatted as LaTeX.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.line_chart": {
+ "name": "line_chart",
+ "signature": "element.line_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a line chart.",
+ "args": [
+ {
+ "name": "data",
+ "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",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.map": {
+ "name": "map",
+ "signature": "element.map(self, data=None, zoom=None, use_container_width=True)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a map with points on it.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.markdown": {
+ "name": "markdown",
+ "signature": "element.markdown(self, body, unsafe_allow_html=False)",
+ "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.metric": {
+ "name": "metric",
+ "signature": "element.metric(self, label, value, delta=None, delta_color=\"normal\")",
+ "example": "\n\n>>> st.metric(label="Active developers", value=123, delta=123,\n... delta_color="off") # arrow up, gray\n
\n
\n",
+ "description": "Display a metric in big bold font, with an optional indicator of how the metric changed.",
+ "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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n",
+ "description": "Display a multiselect widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this select widget 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 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": "[str] or None",
+ "is_optional": false,
+ "description": "List of default values.
\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 selectbox.
\n",
+ "default": null
+ },
+ {
+ "name": "key",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "DeltaGenerator.parse_delta": {
+ "name": "parse_delta",
+ "signature": "element.parse_delta(self, delta)"
+ },
+ "DeltaGenerator.parse_label": {
+ "name": "parse_label",
+ "signature": "element.parse_label(self, label)"
+ },
+ "DeltaGenerator.parse_value": {
+ "name": "parse_value",
+ "signature": "element.parse_value(self, value)"
+ },
+ "DeltaGenerator.plotly_chart": {
+ "name": "plotly_chart",
+ "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)",
+ "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.",
+ "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
\nSee 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://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
+ },
+ {
+ "name": "To show Plotly charts in Streamlit, call `st.plotly_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Plotly's `py.plot` or `py.iplot`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.progress": {
+ "name": "progress",
+ "signature": "element.progress(self, value)",
+ "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.pydeck_chart": {
+ "name": "pydeck_chart",
+ "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)",
+ "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.",
+ "args": [
+ {
+ "name": "spec",
+ "type_name": "pydeck.Deck or None",
+ "is_optional": false,
+ "description": "Object specifying the PyDeck chart to draw.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.pyplot": {
+ "name": "pyplot",
+ "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)",
+ "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n",
+ "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n",
+ "description": "Display a slider widget to select items from a list.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "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": "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n",
+ "description": "Display a slider widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this slider is for.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "DeltaGenerator.subheader": {
+ "name": "subheader",
+ "signature": "element.subheader(self, body, anchor=None)",
+ "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "DeltaGenerator.success": {
+ "name": "success",
+ "signature": "element.success(self, body)",
+ "example": "\n\n>>> st.success('This is a success message!')\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
+ }
+ ]
+ },
+ "DeltaGenerator.table": {
+ "name": "table",
+ "signature": "element.table(self, data=None)",
+ "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a static table.",
+ "args": [
+ {
+ "name": "data",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.text": {
+ "name": "text",
+ "signature": "element.text(self, body)",
+ "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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",
+ "is_optional": false,
+ "description": "An optional string to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "DeltaGenerator.title": {
+ "name": "title",
+ "signature": "element.title(self, body, anchor=None)",
+ "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in title 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
+ }
+ ]
+ },
+ "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\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.video": {
+ "name": "video",
+ "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)",
+ "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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
+ }
+ ]
+ },
+ "DeltaGenerator.warning": {
+ "name": "warning",
+ "signature": "element.warning(self, body)",
+ "example": "\n\n>>> st.warning('This is a warning')\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
+ }
+ ]
+ },
+ "DeltaGenerator.write": {
+ "name": "write",
+ "signature": "element.write(self, *args, **kwargs)",
+ "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Write arguments to the app.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n",
+ "default": "False."
+ }
+ ]
+ }
+ },
+ "0.88.0": {
+ "streamlit.altair_chart": {
+ "name": "altair_chart",
+ "signature": "st.altair_chart(altair_chart, use_container_width=False)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\nExamples 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
+ }
+ ]
+ },
+ "streamlit.area_chart": {
+ "name": "area_chart",
+ "signature": "st.area_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display an area chart.",
+ "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": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.audio": {
+ "name": "audio",
+ "signature": "st.audio(data, format=\"audio/wav\", start_time=0)",
+ "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n",
+ "default": "s"
+ }
+ ]
+ },
+ "streamlit.balloons": {
+ "name": "balloons",
+ "signature": "st.balloons()",
+ "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n",
+ "description": "Draw celebratory balloons.",
+ "args": []
+ },
+ "streamlit.bar_chart": {
+ "name": "bar_chart",
+ "signature": "st.bar_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a bar chart.",
+ "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": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.beta_columns": {
+ "name": "beta_columns",
+ "signature": "st.beta_columns(*args, **kwargs)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor 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
+ }
+ ]
+ },
+ "streamlit.beta_container": {
+ "name": "beta_container",
+ "signature": "st.beta_container(*args, **kwargs)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "streamlit.beta_expander": {
+ "name": "beta_expander",
+ "signature": "st.beta_expander(*args, **kwargs)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "streamlit.bokeh_chart": {
+ "name": "bokeh_chart",
+ "signature": "st.bokeh_chart(figure, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.",
+ "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
+ },
+ {
+ "name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Bokeh's `show`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.button": {
+ "name": "button",
+ "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None)",
+ "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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
+ }
+ ]
+ },
+ "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\n... def fetch_and_clean_data(url):\n... # Fetch data from URL here, and then clean it up.\n... return data\n...\n>>> d1 = fetch_and_clean_data(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> d2 = 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>>>\n>>> d3 = fetch_and_clean_data(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nTo 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
\nTo 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
\nTo 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
\nAlternatively, 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",
+ "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 normally shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.
\nIf 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 functions 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."
+ }
+ ]
+ },
+ "streamlit.caption": {
+ "name": "caption",
+ "signature": "st.caption(body)",
+ "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in small font.",
+ "args": [
+ {
+ "name": "body",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "The text to display.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.checkbox": {
+ "name": "checkbox",
+ "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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
+ }
+ ]
+ },
+ "streamlit.code": {
+ "name": "code",
+ "signature": "st.code(body, language=\"python\")",
+ "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a code block with optional syntax highlighting.",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.color_picker": {
+ "name": "color_picker",
+ "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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
+ }
+ ]
+ },
+ "streamlit.columns": {
+ "name": "columns",
+ "signature": "st.columns(spec)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor 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
+ }
+ ]
+ },
+ "streamlit.container": {
+ "name": "container",
+ "signature": "st.container()",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "streamlit.dataframe": {
+ "name": "dataframe",
+ "signature": "st.dataframe(data=None, width=None, height=None)",
+ "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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.
\nIf '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 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 UI element expressed in pixels. If None, a\ndefault height is used.
\n",
+ "default": "height"
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\nWhile download button can be used to download arbitrary files, here are\nsome common use-cases to get you started.
\nDownload a large DataFrame:
\n\n>>> @st.cache\n... def convert_df(df):\n... # Cache the conversion to prevent computation on every rerun\n... return df.to_csv().encode('utf-8')\n>>> csv = convert_df(my_large_df)\n>>> st.download_button(\n... label="Press to Download",\n... data=csv,\n... file_name='large_df.csv',\n... mime='text/csv',\n... )\n
\nDownload a CSV file:
\n\n>>> text_contents = '''\n... Col1, Col2\n... 123, 456\n... 789, 000\n... '''\n>>> st.download_button(\n... label='Download CSV', data=text_contents,\n... file_name='file.csv', mime='text/csv'\n... )\n
\nDownload a binary file:
\n\n>>> binary_contents = b'example content'\n... # Defaults to 'application/octet-stream'\n>>> st.download_button('Download binary file', binary_contents)\n
\nDownload an image:
\n\n>>> with 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",
+ "description": "Display a download button widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to 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.
\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,\neg. 'my_file.csv'. If file name is not specified, then we provide\na generic name for the download.
\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" or\n"application/octet-stream" depending on the data type.
\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
+ }
+ ]
+ },
+ "streamlit.echo": {
+ "name": "echo",
+ "signature": "st.echo(code_location=\"above\")",
+ "example": "\n\n>>> with 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
+ }
+ ]
+ },
+ "streamlit.empty": {
+ "name": "empty",
+ "signature": "st.empty()",
+ "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n",
+ "description": "Insert a single-element container.",
+ "args": []
+ },
+ "streamlit.error": {
+ "name": "error",
+ "signature": "st.error(body)",
+ "example": "\n\n>>> st.error('This is an error')\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
+ }
+ ]
+ },
+ "streamlit.exception": {
+ "name": "exception",
+ "signature": "st.exception(exception)",
+ "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.expander": {
+ "name": "expander",
+ "signature": "st.expander(label, expanded=False)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "streamlit.experimental_get_query_params": {
+ "name": "experimental_get_query_params",
+ "signature": "st.experimental_get_query_params()",
+ "example": "\nLet'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\n>>> st.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\nNote 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": []
+ },
+ "streamlit.experimental_rerun": {
+ "name": "experimental_rerun",
+ "signature": "st.experimental_rerun()",
+ "description": "Rerun the script immediately.",
+ "args": []
+ },
+ "streamlit.experimental_set_query_params": {
+ "name": "experimental_set_query_params",
+ "signature": "st.experimental_set_query_params(**query_params)",
+ "example": "\nTo 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\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.experimental_show": {
+ "name": "experimental_show",
+ "signature": "st.experimental_show(*args)",
+ "notes": "\nThis 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- When passing multiple arguments the inclusion of , or ) in a string
\n
\n \nargument may cause an error.
\n
\n",
+ "example": "\n\n>>> dataframe = pd.DataFrame({\n... 'first column': [1, 2, 3, 4],\n... 'second column': [10, 20, 30, 40],\n... }))\n>>> st.experimental_show(dataframe)\n
\n
\n",
+ "description": "Write arguments and *argument names* to your app for debugging purposes.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to debug in the App.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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)",
+ "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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",
+ "description": "Display a file uploader widget.",
+ "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",
+ "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
+ }
+ ]
+ },
+ "streamlit.form": {
+ "name": "form",
+ "signature": "st.form(key, clear_on_submit=False)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n",
+ "description": "Create a form that batches elements together with a \"Submit\" button.",
+ "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"
+ }
+ ]
+ },
+ "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.",
+ "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
+ }
+ ]
+ },
+ "streamlit.get_option": {
+ "name": "get_option",
+ "signature": "st.get_option(key)",
+ "description": "Return the current value of a given Streamlit config option.",
+ "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
+ }
+ ]
+ },
+ "streamlit.graphviz_chart": {
+ "name": "graphviz_chart",
+ "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.header": {
+ "name": "header",
+ "signature": "st.header(body, anchor=None)",
+ "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "streamlit.help": {
+ "name": "help",
+ "signature": "st.help(obj)",
+ "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n",
+ "description": "Display object's doc string, nicely formatted.",
+ "args": [
+ {
+ "name": "obj",
+ "type_name": "Object",
+ "is_optional": false,
+ "description": "The object whose docstring should be displayed.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"
+ }
+ ]
+ },
+ "streamlit.info": {
+ "name": "info",
+ "signature": "st.info(body)",
+ "example": "\n\n>>> st.info('This is a purely informational message')\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
+ }
+ ]
+ },
+ "streamlit.json": {
+ "name": "json",
+ "signature": "st.json(body)",
+ "example": "\n\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.latex": {
+ "name": "latex",
+ "signature": "st.latex(body)",
+ "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display mathematical expressions formatted as LaTeX.",
+ "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
+ }
+ ]
+ },
+ "streamlit.line_chart": {
+ "name": "line_chart",
+ "signature": "st.line_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a line chart.",
+ "args": [
+ {
+ "name": "data",
+ "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",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.map": {
+ "name": "map",
+ "signature": "st.map(data=None, zoom=None, use_container_width=True)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a map with points on it.",
+ "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
+ }
+ ]
+ },
+ "streamlit.markdown": {
+ "name": "markdown",
+ "signature": "st.markdown(body, unsafe_allow_html=False)",
+ "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.metric": {
+ "name": "metric",
+ "signature": "st.metric(label, value, delta=None, delta_color=\"normal\")",
+ "example": "\n\n>>> st.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\n>>> col1, col2, col3 = st.columns(3)\n>>> col1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\n>>> col2.metric("Wind", "9 mph", "-8%")\n>>> col3.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\n>>> st.metric(label="Gas price", value=4, delta=-0.5,\n... delta_color="inverse")\n>>>\n>>> st.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.",
+ "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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n",
+ "description": "Display a multiselect widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this select widget 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 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": "[str] or None",
+ "is_optional": false,
+ "description": "List of default values.
\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 selectbox.
\n",
+ "default": null
+ },
+ {
+ "name": "key",
+ "type_name": "str or int",
+ "is_optional": false,
+ "description": "An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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
+ }
+ ]
+ },
+ "streamlit.plotly_chart": {
+ "name": "plotly_chart",
+ "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)",
+ "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.",
+ "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
\nSee 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://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
+ },
+ {
+ "name": "To show Plotly charts in Streamlit, call `st.plotly_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Plotly's `py.plot` or `py.iplot`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.progress": {
+ "name": "progress",
+ "signature": "st.progress(value)",
+ "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.pydeck_chart": {
+ "name": "pydeck_chart",
+ "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)",
+ "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.",
+ "args": [
+ {
+ "name": "spec",
+ "type_name": "pydeck.Deck or None",
+ "is_optional": false,
+ "description": "Object specifying the PyDeck chart to draw.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.pyplot": {
+ "name": "pyplot",
+ "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)",
+ "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n",
+ "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n",
+ "description": "Display a slider widget to select items from a list.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "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": "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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\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
+ }
+ ]
+ },
+ "streamlit.set_option": {
+ "name": "set_option",
+ "signature": "st.set_option(key, value)",
+ "description": "Set config option.",
+ "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
+ }
+ ]
+ },
+ "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\")",
+ "example": "\n>>> st.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... )\n
\n",
+ "description": "Configures the default settings of the page.",
+ "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"
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n",
+ "description": "Display a slider widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this slider is for.
\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
+ }
+ ]
+ },
+ "streamlit.spinner": {
+ "name": "spinner",
+ "signature": "st.spinner(text=\"In progress...\")",
+ "example": "\n\n>>> with st.spinner('Wait for it...'):\n>>> time.sleep(5)\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.stop": {
+ "name": "stop",
+ "signature": "st.stop()",
+ "example": "\n\n>>> name = st.text_input('Name')\n>>> if not name:\n>>> st.warning('Please input a name.')\n>>> st.stop()\n>>> st.success('Thank you for inputting a name.')\n
\n
\n",
+ "description": "Stops execution immediately.",
+ "args": []
+ },
+ "streamlit.subheader": {
+ "name": "subheader",
+ "signature": "st.subheader(body, anchor=None)",
+ "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "streamlit.success": {
+ "name": "success",
+ "signature": "st.success(body)",
+ "example": "\n\n>>> st.success('This is a success message!')\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
+ }
+ ]
+ },
+ "streamlit.table": {
+ "name": "table",
+ "signature": "st.table(data=None)",
+ "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a static table.",
+ "args": [
+ {
+ "name": "data",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.text": {
+ "name": "text",
+ "signature": "st.text(body)",
+ "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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
+ }
+ ]
+ },
+ "streamlit.time_input": {
+ "name": "time_input",
+ "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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
+ }
+ ]
+ },
+ "streamlit.title": {
+ "name": "title",
+ "signature": "st.title(body, anchor=None)",
+ "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in title 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
+ }
+ ]
+ },
+ "streamlit.vega_lite_chart": {
+ "name": "vega_lite_chart",
+ "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, **kwargs)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.video": {
+ "name": "video",
+ "signature": "st.video(data, format=\"video/mp4\", start_time=0)",
+ "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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
+ }
+ ]
+ },
+ "streamlit.warning": {
+ "name": "warning",
+ "signature": "st.warning(body)",
+ "example": "\n\n>>> st.warning('This is a warning')\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
+ }
+ ]
+ },
+ "streamlit.write": {
+ "name": "write",
+ "signature": "st.write(*args, **kwargs)",
+ "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Write arguments to the app.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n",
+ "default": "False."
+ }
+ ]
+ },
+ "DeltaGenerator.add_rows": {
+ "name": "add_rows",
+ "signature": "element.add_rows(self, data=None, **kwargs)",
+ "example": "\n\n>>> df1 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_table = st.table(df1)\n>>>\n>>> df2 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_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
\nYou 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...\n>>> my_chart = st.line_chart(df1)\n>>> my_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
\nAnd for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:
\n\n>>> my_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... }),\n>>> my_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": "**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
+ }
+ ]
+ },
+ "DeltaGenerator.altair_chart": {
+ "name": "altair_chart",
+ "signature": "element.altair_chart(self, altair_chart, use_container_width=False)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\nExamples 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
+ }
+ ]
+ },
+ "DeltaGenerator.area_chart": {
+ "name": "area_chart",
+ "signature": "element.area_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display an area chart.",
+ "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": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.audio": {
+ "name": "audio",
+ "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0)",
+ "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n",
+ "default": "s"
+ }
+ ]
+ },
+ "DeltaGenerator.balloons": {
+ "name": "balloons",
+ "signature": "element.balloons(self)",
+ "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n",
+ "description": "Draw celebratory balloons.",
+ "args": []
+ },
+ "DeltaGenerator.bar_chart": {
+ "name": "bar_chart",
+ "signature": "element.bar_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a bar chart.",
+ "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": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.beta_columns": {
+ "name": "beta_columns",
+ "signature": "element.beta_columns(*args, **kwargs)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor 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
+ }
+ ]
+ },
+ "DeltaGenerator.beta_container": {
+ "name": "beta_container",
+ "signature": "element.beta_container(*args, **kwargs)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "DeltaGenerator.beta_expander": {
+ "name": "beta_expander",
+ "signature": "element.beta_expander(*args, **kwargs)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "DeltaGenerator.bokeh_chart": {
+ "name": "bokeh_chart",
+ "signature": "element.bokeh_chart(self, figure, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.",
+ "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
+ },
+ {
+ "name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Bokeh's `show`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.button": {
+ "name": "button",
+ "signature": "element.button(self, label, key=None, help=None, on_click=None, args=None, kwargs=None)",
+ "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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
+ }
+ ]
+ },
+ "DeltaGenerator.caption": {
+ "name": "caption",
+ "signature": "element.caption(self, body)",
+ "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in small font.",
+ "args": [
+ {
+ "name": "body",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "The text to display.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.checkbox": {
+ "name": "checkbox",
+ "signature": "element.checkbox(self, label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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
+ }
+ ]
+ },
+ "DeltaGenerator.code": {
+ "name": "code",
+ "signature": "element.code(self, body, language=\"python\")",
+ "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a code block with optional syntax highlighting.",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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
+ }
+ ]
+ },
+ "DeltaGenerator.columns": {
+ "name": "columns",
+ "signature": "element.columns(self, spec)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor 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
+ }
+ ]
+ },
+ "DeltaGenerator.container": {
+ "name": "container",
+ "signature": "element.container(self)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "DeltaGenerator.dataframe": {
+ "name": "dataframe",
+ "signature": "element.dataframe(self, data=None, width=None, height=None)",
+ "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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.
\nIf '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 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 UI element expressed in pixels. If None, a\ndefault height is used.
\n",
+ "default": "height"
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\nWhile download button can be used to download arbitrary files, here are\nsome common use-cases to get you started.
\nDownload a large DataFrame:
\n\n>>> @st.cache\n... def convert_df(df):\n... # Cache the conversion to prevent computation on every rerun\n... return df.to_csv().encode('utf-8')\n>>> csv = convert_df(my_large_df)\n>>> st.download_button(\n... label="Press to Download",\n... data=csv,\n... file_name='large_df.csv',\n... mime='text/csv',\n... )\n
\nDownload a CSV file:
\n\n>>> text_contents = '''\n... Col1, Col2\n... 123, 456\n... 789, 000\n... '''\n>>> st.download_button(\n... label='Download CSV', data=text_contents,\n... file_name='file.csv', mime='text/csv'\n... )\n
\nDownload a binary file:
\n\n>>> binary_contents = b'example content'\n... # Defaults to 'application/octet-stream'\n>>> st.download_button('Download binary file', binary_contents)\n
\nDownload an image:
\n\n>>> with 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",
+ "description": "Display a download button widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to 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.
\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,\neg. 'my_file.csv'. If file name is not specified, then we provide\na generic name for the download.
\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" or\n"application/octet-stream" depending on the data type.
\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
+ }
+ ]
+ },
+ "DeltaGenerator.empty": {
+ "name": "empty",
+ "signature": "element.empty(self)",
+ "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n",
+ "description": "Insert a single-element container.",
+ "args": []
+ },
+ "DeltaGenerator.error": {
+ "name": "error",
+ "signature": "element.error(self, body)",
+ "example": "\n\n>>> st.error('This is an error')\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
+ }
+ ]
+ },
+ "DeltaGenerator.exception": {
+ "name": "exception",
+ "signature": "element.exception(self, exception)",
+ "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.expander": {
+ "name": "expander",
+ "signature": "element.expander(self, label, expanded=False)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "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)",
+ "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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",
+ "description": "Display a file uploader widget.",
+ "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",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.form": {
+ "name": "form",
+ "signature": "element.form(self, key, clear_on_submit=False)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n",
+ "description": "Create a form that batches elements together with a \"Submit\" button.",
+ "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"
+ }
+ ]
+ },
+ "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.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.graphviz_chart": {
+ "name": "graphviz_chart",
+ "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.header": {
+ "name": "header",
+ "signature": "element.header(self, body, anchor=None)",
+ "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "DeltaGenerator.help": {
+ "name": "help",
+ "signature": "element.help(self, obj)",
+ "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n",
+ "description": "Display object's doc string, nicely formatted.",
+ "args": [
+ {
+ "name": "obj",
+ "type_name": "Object",
+ "is_optional": false,
+ "description": "The object whose docstring should be displayed.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"
+ }
+ ]
+ },
+ "DeltaGenerator.info": {
+ "name": "info",
+ "signature": "element.info(self, body)",
+ "example": "\n\n>>> st.info('This is a purely informational message')\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
+ }
+ ]
+ },
+ "DeltaGenerator.is_negative": {
+ "name": "is_negative",
+ "signature": "element.is_negative(self, delta)"
+ },
+ "DeltaGenerator.json": {
+ "name": "json",
+ "signature": "element.json(self, body)",
+ "example": "\n\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.latex": {
+ "name": "latex",
+ "signature": "element.latex(self, body)",
+ "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display mathematical expressions formatted as LaTeX.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.line_chart": {
+ "name": "line_chart",
+ "signature": "element.line_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a line chart.",
+ "args": [
+ {
+ "name": "data",
+ "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",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.map": {
+ "name": "map",
+ "signature": "element.map(self, data=None, zoom=None, use_container_width=True)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a map with points on it.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.markdown": {
+ "name": "markdown",
+ "signature": "element.markdown(self, body, unsafe_allow_html=False)",
+ "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.metric": {
+ "name": "metric",
+ "signature": "element.metric(self, label, value, delta=None, delta_color=\"normal\")",
+ "example": "\n\n>>> st.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\n>>> col1, col2, col3 = st.columns(3)\n>>> col1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\n>>> col2.metric("Wind", "9 mph", "-8%")\n>>> col3.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\n>>> st.metric(label="Gas price", value=4, delta=-0.5,\n... delta_color="inverse")\n>>>\n>>> st.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.",
+ "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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n",
+ "description": "Display a multiselect widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this select widget 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 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": "[str] or None",
+ "is_optional": false,
+ "description": "List of default values.
\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 selectbox.
\n",
+ "default": null
+ },
+ {
+ "name": "key",
+ "type_name": "str or int",
+ "is_optional": false,
+ "description": "An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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
+ }
+ ]
+ },
+ "DeltaGenerator.parse_delta": {
+ "name": "parse_delta",
+ "signature": "element.parse_delta(self, delta)"
+ },
+ "DeltaGenerator.parse_label": {
+ "name": "parse_label",
+ "signature": "element.parse_label(self, label)"
+ },
+ "DeltaGenerator.parse_value": {
+ "name": "parse_value",
+ "signature": "element.parse_value(self, value)"
+ },
+ "DeltaGenerator.plotly_chart": {
+ "name": "plotly_chart",
+ "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)",
+ "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.",
+ "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
\nSee 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://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
+ },
+ {
+ "name": "To show Plotly charts in Streamlit, call `st.plotly_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Plotly's `py.plot` or `py.iplot`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.progress": {
+ "name": "progress",
+ "signature": "element.progress(self, value)",
+ "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.pydeck_chart": {
+ "name": "pydeck_chart",
+ "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)",
+ "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.",
+ "args": [
+ {
+ "name": "spec",
+ "type_name": "pydeck.Deck or None",
+ "is_optional": false,
+ "description": "Object specifying the PyDeck chart to draw.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.pyplot": {
+ "name": "pyplot",
+ "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)",
+ "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n",
+ "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n",
+ "description": "Display a slider widget to select items from a list.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "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": "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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n",
+ "description": "Display a slider widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this slider is for.
\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
+ }
+ ]
+ },
+ "DeltaGenerator.subheader": {
+ "name": "subheader",
+ "signature": "element.subheader(self, body, anchor=None)",
+ "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "DeltaGenerator.success": {
+ "name": "success",
+ "signature": "element.success(self, body)",
+ "example": "\n\n>>> st.success('This is a success message!')\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
+ }
+ ]
+ },
+ "DeltaGenerator.table": {
+ "name": "table",
+ "signature": "element.table(self, data=None)",
+ "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a static table.",
+ "args": [
+ {
+ "name": "data",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.text": {
+ "name": "text",
+ "signature": "element.text(self, body)",
+ "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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
+ }
+ ]
+ },
+ "DeltaGenerator.title": {
+ "name": "title",
+ "signature": "element.title(self, body, anchor=None)",
+ "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in title 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
+ }
+ ]
+ },
+ "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\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.video": {
+ "name": "video",
+ "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)",
+ "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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
+ }
+ ]
+ },
+ "DeltaGenerator.warning": {
+ "name": "warning",
+ "signature": "element.warning(self, body)",
+ "example": "\n\n>>> st.warning('This is a warning')\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
+ }
+ ]
+ },
+ "DeltaGenerator.write": {
+ "name": "write",
+ "signature": "element.write(self, *args, **kwargs)",
+ "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Write arguments to the app.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n",
+ "default": "False."
+ }
+ ]
+ }
+ },
+ "0.89.0": {
+ "streamlit.altair_chart": {
+ "name": "altair_chart",
+ "signature": "st.altair_chart(altair_chart, use_container_width=False)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\nExamples 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
+ }
+ ]
+ },
+ "streamlit.area_chart": {
+ "name": "area_chart",
+ "signature": "st.area_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display an area chart.",
+ "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": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.audio": {
+ "name": "audio",
+ "signature": "st.audio(data, format=\"audio/wav\", start_time=0)",
+ "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n",
+ "default": "s"
+ }
+ ]
+ },
+ "streamlit.balloons": {
+ "name": "balloons",
+ "signature": "st.balloons()",
+ "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n",
+ "description": "Draw celebratory balloons.",
+ "args": []
+ },
+ "streamlit.bar_chart": {
+ "name": "bar_chart",
+ "signature": "st.bar_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a bar chart.",
+ "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": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.beta_columns": {
+ "name": "beta_columns",
+ "signature": "st.beta_columns(*args, **kwargs)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor 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
+ }
+ ]
+ },
+ "streamlit.beta_container": {
+ "name": "beta_container",
+ "signature": "st.beta_container(*args, **kwargs)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "streamlit.beta_expander": {
+ "name": "beta_expander",
+ "signature": "st.beta_expander(*args, **kwargs)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "streamlit.bokeh_chart": {
+ "name": "bokeh_chart",
+ "signature": "st.bokeh_chart(figure, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.",
+ "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
+ },
+ {
+ "name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Bokeh's `show`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.button": {
+ "name": "button",
+ "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None)",
+ "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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
+ }
+ ]
+ },
+ "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\n... def fetch_and_clean_data(url):\n... # Fetch data from URL here, and then clean it up.\n... return data\n...\n>>> d1 = fetch_and_clean_data(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> d2 = 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>>>\n>>> d3 = fetch_and_clean_data(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nTo 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
\nTo 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
\nTo 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
\nAlternatively, 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",
+ "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 normally shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.
\nIf 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 functions 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."
+ }
+ ]
+ },
+ "streamlit.caption": {
+ "name": "caption",
+ "signature": "st.caption(body)",
+ "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in small font.",
+ "args": [
+ {
+ "name": "body",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "The text to display.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.checkbox": {
+ "name": "checkbox",
+ "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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
+ }
+ ]
+ },
+ "streamlit.code": {
+ "name": "code",
+ "signature": "st.code(body, language=\"python\")",
+ "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a code block with optional syntax highlighting.",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.color_picker": {
+ "name": "color_picker",
+ "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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
+ }
+ ]
+ },
+ "streamlit.columns": {
+ "name": "columns",
+ "signature": "st.columns(spec)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor 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
+ }
+ ]
+ },
+ "streamlit.container": {
+ "name": "container",
+ "signature": "st.container()",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "streamlit.dataframe": {
+ "name": "dataframe",
+ "signature": "st.dataframe(data=None, width=None, height=None)",
+ "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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.
\nIf '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 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 UI element expressed in pixels. If None, a\ndefault height is used.
\n",
+ "default": "height"
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\nDownload 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>>>\n>>> csv = convert_df(my_large_df)\n>>>\n>>> st.download_button(\n... label="Download data as CSV",\n... data=csv,\n... file_name='large_df.csv',\n... mime='text/csv',\n... )\n
\nDownload a string as a file:
\n\n>>> text_contents = '''This is some text'''\n>>> st.download_button('Download some text', text_contents)\n
\nDownload a binary file:
\n\n>>> binary_contents = b'example content'\n>>> # Defaults to 'application/octet-stream'\n>>> st.download_button('Download binary file', binary_contents)\n
\nDownload an image:
\n\n>>> with 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",
+ "description": "Display a download 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": "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
+ }
+ ]
+ },
+ "streamlit.echo": {
+ "name": "echo",
+ "signature": "st.echo(code_location=\"above\")",
+ "example": "\n\n>>> with 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
+ }
+ ]
+ },
+ "streamlit.empty": {
+ "name": "empty",
+ "signature": "st.empty()",
+ "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n",
+ "description": "Insert a single-element container.",
+ "args": []
+ },
+ "streamlit.error": {
+ "name": "error",
+ "signature": "st.error(body)",
+ "example": "\n\n>>> st.error('This is an error')\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
+ }
+ ]
+ },
+ "streamlit.exception": {
+ "name": "exception",
+ "signature": "st.exception(exception)",
+ "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.expander": {
+ "name": "expander",
+ "signature": "st.expander(label, expanded=False)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "streamlit.experimental_get_query_params": {
+ "name": "experimental_get_query_params",
+ "signature": "st.experimental_get_query_params()",
+ "example": "\nLet'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\n>>> st.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\nNote 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": []
+ },
+ "streamlit.experimental_memo": {
+ "name": "memo",
+ "signature": "st.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...\n>>> d1 = fetch_and_clean_data(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> d2 = 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>>>\n>>> d3 = fetch_and_clean_data(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nTo 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
\nBy 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...\n>>> connection = make_database_connection()\n>>> d1 = fetch_and_clean_data(connection, num_rows=10)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> another_connection = make_database_connection()\n>>> d2 = 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
\n",
+ "description": "Function decorator to memoize function executions.",
+ "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 functions 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 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."
+ }
+ ]
+ },
+ "streamlit.experimental_rerun": {
+ "name": "experimental_rerun",
+ "signature": "st.experimental_rerun()",
+ "description": "Rerun the script immediately.",
+ "args": []
+ },
+ "streamlit.experimental_set_query_params": {
+ "name": "experimental_set_query_params",
+ "signature": "st.experimental_set_query_params(**query_params)",
+ "example": "\nTo 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\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.experimental_show": {
+ "name": "experimental_show",
+ "signature": "st.experimental_show(*args)",
+ "notes": "\nThis 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- When passing multiple arguments the inclusion of , or ) in a string
\n
\n \nargument may cause an error.
\n
\n",
+ "example": "\n\n>>> dataframe = pd.DataFrame({\n... 'first column': [1, 2, 3, 4],\n... 'second column': [10, 20, 30, 40],\n... }))\n>>> st.experimental_show(dataframe)\n
\n
\n",
+ "description": "Write arguments and *argument names* to your app for debugging purposes.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to debug in the App.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.experimental_singleton": {
+ "name": "singleton",
+ "signature": "st.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...\n>>> s1 = get_database_session(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> s2 = get_database_session(DATA_URL_1)\n>>> # Does not execute the function. Instead, returns its previously computed\n>>> # value. This means that now the connection object in d1 is the same as in d2.\n>>>\n>>> s3 = get_database_session(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nBy 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...\n>>> s1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> s2 = 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
\n",
+ "description": "Function decorator to store singleton objects.",
+ "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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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",
+ "description": "Display a file uploader widget.",
+ "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",
+ "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
+ }
+ ]
+ },
+ "streamlit.form": {
+ "name": "form",
+ "signature": "st.form(key, clear_on_submit=False)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n",
+ "description": "Create a form that batches elements together with a \"Submit\" button.",
+ "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"
+ }
+ ]
+ },
+ "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.",
+ "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
+ }
+ ]
+ },
+ "streamlit.get_option": {
+ "name": "get_option",
+ "signature": "st.get_option(key)",
+ "description": "Return the current value of a given Streamlit config option.",
+ "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
+ }
+ ]
+ },
+ "streamlit.graphviz_chart": {
+ "name": "graphviz_chart",
+ "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.header": {
+ "name": "header",
+ "signature": "st.header(body, anchor=None)",
+ "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "streamlit.help": {
+ "name": "help",
+ "signature": "st.help(obj)",
+ "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n",
+ "description": "Display object's doc string, nicely formatted.",
+ "args": [
+ {
+ "name": "obj",
+ "type_name": "Object",
+ "is_optional": false,
+ "description": "The object whose docstring should be displayed.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"
+ }
+ ]
+ },
+ "streamlit.info": {
+ "name": "info",
+ "signature": "st.info(body)",
+ "example": "\n\n>>> st.info('This is a purely informational message')\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
+ }
+ ]
+ },
+ "streamlit.json": {
+ "name": "json",
+ "signature": "st.json(body)",
+ "example": "\n\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.latex": {
+ "name": "latex",
+ "signature": "st.latex(body)",
+ "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display mathematical expressions formatted as LaTeX.",
+ "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
+ }
+ ]
+ },
+ "streamlit.line_chart": {
+ "name": "line_chart",
+ "signature": "st.line_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a line chart.",
+ "args": [
+ {
+ "name": "data",
+ "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",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.map": {
+ "name": "map",
+ "signature": "st.map(data=None, zoom=None, use_container_width=True)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a map with points on it.",
+ "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
+ }
+ ]
+ },
+ "streamlit.markdown": {
+ "name": "markdown",
+ "signature": "st.markdown(body, unsafe_allow_html=False)",
+ "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.metric": {
+ "name": "metric",
+ "signature": "st.metric(label, value, delta=None, delta_color=\"normal\")",
+ "example": "\n\n>>> st.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\n>>> col1, col2, col3 = st.columns(3)\n>>> col1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\n>>> col2.metric("Wind", "9 mph", "-8%")\n>>> col3.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\n>>> st.metric(label="Gas price", value=4, delta=-0.5,\n... delta_color="inverse")\n>>>\n>>> st.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.",
+ "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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n",
+ "description": "Display a multiselect widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this select widget 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 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": "[str] or None",
+ "is_optional": false,
+ "description": "List of default values.
\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 selectbox.
\n",
+ "default": null
+ },
+ {
+ "name": "key",
+ "type_name": "str or int",
+ "is_optional": false,
+ "description": "An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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
+ }
+ ]
+ },
+ "streamlit.plotly_chart": {
+ "name": "plotly_chart",
+ "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)",
+ "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.",
+ "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
\nSee 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://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
+ },
+ {
+ "name": "To show Plotly charts in Streamlit, call `st.plotly_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Plotly's `py.plot` or `py.iplot`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.progress": {
+ "name": "progress",
+ "signature": "st.progress(value)",
+ "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.pydeck_chart": {
+ "name": "pydeck_chart",
+ "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)",
+ "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.",
+ "args": [
+ {
+ "name": "spec",
+ "type_name": "pydeck.Deck or None",
+ "is_optional": false,
+ "description": "Object specifying the PyDeck chart to draw.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.pyplot": {
+ "name": "pyplot",
+ "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)",
+ "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n",
+ "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n",
+ "description": "Display a slider widget to select items from a list.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "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": "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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\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
+ }
+ ]
+ },
+ "streamlit.set_option": {
+ "name": "set_option",
+ "signature": "st.set_option(key, value)",
+ "description": "Set config option.",
+ "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
+ }
+ ]
+ },
+ "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": "\n>>> st.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.",
+ "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\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
\n",
+ "default": "About"
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n",
+ "description": "Display a slider widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this slider is for.
\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
+ }
+ ]
+ },
+ "streamlit.spinner": {
+ "name": "spinner",
+ "signature": "st.spinner(text=\"In progress...\")",
+ "example": "\n\n>>> with st.spinner('Wait for it...'):\n>>> time.sleep(5)\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.stop": {
+ "name": "stop",
+ "signature": "st.stop()",
+ "example": "\n\n>>> name = st.text_input('Name')\n>>> if not name:\n>>> st.warning('Please input a name.')\n>>> st.stop()\n>>> st.success('Thank you for inputting a name.')\n
\n
\n",
+ "description": "Stops execution immediately.",
+ "args": []
+ },
+ "streamlit.subheader": {
+ "name": "subheader",
+ "signature": "st.subheader(body, anchor=None)",
+ "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "streamlit.success": {
+ "name": "success",
+ "signature": "st.success(body)",
+ "example": "\n\n>>> st.success('This is a success message!')\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
+ }
+ ]
+ },
+ "streamlit.table": {
+ "name": "table",
+ "signature": "st.table(data=None)",
+ "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a static table.",
+ "args": [
+ {
+ "name": "data",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.text": {
+ "name": "text",
+ "signature": "st.text(body)",
+ "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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
+ }
+ ]
+ },
+ "streamlit.time_input": {
+ "name": "time_input",
+ "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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
+ }
+ ]
+ },
+ "streamlit.title": {
+ "name": "title",
+ "signature": "st.title(body, anchor=None)",
+ "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in title 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
+ }
+ ]
+ },
+ "streamlit.vega_lite_chart": {
+ "name": "vega_lite_chart",
+ "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, **kwargs)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.video": {
+ "name": "video",
+ "signature": "st.video(data, format=\"video/mp4\", start_time=0)",
+ "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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
+ }
+ ]
+ },
+ "streamlit.warning": {
+ "name": "warning",
+ "signature": "st.warning(body)",
+ "example": "\n\n>>> st.warning('This is a warning')\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
+ }
+ ]
+ },
+ "streamlit.write": {
+ "name": "write",
+ "signature": "st.write(*args, **kwargs)",
+ "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Write arguments to the app.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n",
+ "default": "False."
+ }
+ ]
+ },
+ "DeltaGenerator.add_rows": {
+ "name": "add_rows",
+ "signature": "element.add_rows(self, data=None, **kwargs)",
+ "example": "\n\n>>> df1 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_table = st.table(df1)\n>>>\n>>> df2 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_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
\nYou 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...\n>>> my_chart = st.line_chart(df1)\n>>> my_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
\nAnd for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:
\n\n>>> my_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... }),\n>>> my_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": "**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
+ }
+ ]
+ },
+ "DeltaGenerator.altair_chart": {
+ "name": "altair_chart",
+ "signature": "element.altair_chart(self, altair_chart, use_container_width=False)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\nExamples 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
+ }
+ ]
+ },
+ "DeltaGenerator.area_chart": {
+ "name": "area_chart",
+ "signature": "element.area_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display an area chart.",
+ "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": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.audio": {
+ "name": "audio",
+ "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0)",
+ "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n",
+ "default": "s"
+ }
+ ]
+ },
+ "DeltaGenerator.balloons": {
+ "name": "balloons",
+ "signature": "element.balloons(self)",
+ "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n",
+ "description": "Draw celebratory balloons.",
+ "args": []
+ },
+ "DeltaGenerator.bar_chart": {
+ "name": "bar_chart",
+ "signature": "element.bar_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a bar chart.",
+ "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": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.beta_columns": {
+ "name": "beta_columns",
+ "signature": "element.beta_columns(*args, **kwargs)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor 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
+ }
+ ]
+ },
+ "DeltaGenerator.beta_container": {
+ "name": "beta_container",
+ "signature": "element.beta_container(*args, **kwargs)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "DeltaGenerator.beta_expander": {
+ "name": "beta_expander",
+ "signature": "element.beta_expander(*args, **kwargs)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "DeltaGenerator.bokeh_chart": {
+ "name": "bokeh_chart",
+ "signature": "element.bokeh_chart(self, figure, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.",
+ "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
+ },
+ {
+ "name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Bokeh's `show`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.button": {
+ "name": "button",
+ "signature": "element.button(self, label, key=None, help=None, on_click=None, args=None, kwargs=None)",
+ "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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
+ }
+ ]
+ },
+ "DeltaGenerator.caption": {
+ "name": "caption",
+ "signature": "element.caption(self, body)",
+ "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in small font.",
+ "args": [
+ {
+ "name": "body",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "The text to display.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.checkbox": {
+ "name": "checkbox",
+ "signature": "element.checkbox(self, label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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
+ }
+ ]
+ },
+ "DeltaGenerator.code": {
+ "name": "code",
+ "signature": "element.code(self, body, language=\"python\")",
+ "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a code block with optional syntax highlighting.",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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
+ }
+ ]
+ },
+ "DeltaGenerator.columns": {
+ "name": "columns",
+ "signature": "element.columns(self, spec)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor 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
+ }
+ ]
+ },
+ "DeltaGenerator.container": {
+ "name": "container",
+ "signature": "element.container(self)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "DeltaGenerator.dataframe": {
+ "name": "dataframe",
+ "signature": "element.dataframe(self, data=None, width=None, height=None)",
+ "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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.
\nIf '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 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 UI element expressed in pixels. If None, a\ndefault height is used.
\n",
+ "default": "height"
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\nDownload 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>>>\n>>> csv = convert_df(my_large_df)\n>>>\n>>> st.download_button(\n... label="Download data as CSV",\n... data=csv,\n... file_name='large_df.csv',\n... mime='text/csv',\n... )\n
\nDownload a string as a file:
\n\n>>> text_contents = '''This is some text'''\n>>> st.download_button('Download some text', text_contents)\n
\nDownload a binary file:
\n\n>>> binary_contents = b'example content'\n>>> # Defaults to 'application/octet-stream'\n>>> st.download_button('Download binary file', binary_contents)\n
\nDownload an image:
\n\n>>> with 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",
+ "description": "Display a download 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": "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
+ }
+ ]
+ },
+ "DeltaGenerator.empty": {
+ "name": "empty",
+ "signature": "element.empty(self)",
+ "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n",
+ "description": "Insert a single-element container.",
+ "args": []
+ },
+ "DeltaGenerator.error": {
+ "name": "error",
+ "signature": "element.error(self, body)",
+ "example": "\n\n>>> st.error('This is an error')\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
+ }
+ ]
+ },
+ "DeltaGenerator.exception": {
+ "name": "exception",
+ "signature": "element.exception(self, exception)",
+ "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.expander": {
+ "name": "expander",
+ "signature": "element.expander(self, label, expanded=False)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "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)",
+ "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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",
+ "description": "Display a file uploader widget.",
+ "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",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.form": {
+ "name": "form",
+ "signature": "element.form(self, key, clear_on_submit=False)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n",
+ "description": "Create a form that batches elements together with a \"Submit\" button.",
+ "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"
+ }
+ ]
+ },
+ "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.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.graphviz_chart": {
+ "name": "graphviz_chart",
+ "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.header": {
+ "name": "header",
+ "signature": "element.header(self, body, anchor=None)",
+ "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "DeltaGenerator.help": {
+ "name": "help",
+ "signature": "element.help(self, obj)",
+ "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n",
+ "description": "Display object's doc string, nicely formatted.",
+ "args": [
+ {
+ "name": "obj",
+ "type_name": "Object",
+ "is_optional": false,
+ "description": "The object whose docstring should be displayed.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"
+ }
+ ]
+ },
+ "DeltaGenerator.info": {
+ "name": "info",
+ "signature": "element.info(self, body)",
+ "example": "\n\n>>> st.info('This is a purely informational message')\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
+ }
+ ]
+ },
+ "DeltaGenerator.is_negative": {
+ "name": "is_negative",
+ "signature": "element.is_negative(self, delta)"
+ },
+ "DeltaGenerator.json": {
+ "name": "json",
+ "signature": "element.json(self, body)",
+ "example": "\n\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.latex": {
+ "name": "latex",
+ "signature": "element.latex(self, body)",
+ "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display mathematical expressions formatted as LaTeX.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.line_chart": {
+ "name": "line_chart",
+ "signature": "element.line_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a line chart.",
+ "args": [
+ {
+ "name": "data",
+ "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",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.map": {
+ "name": "map",
+ "signature": "element.map(self, data=None, zoom=None, use_container_width=True)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a map with points on it.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.markdown": {
+ "name": "markdown",
+ "signature": "element.markdown(self, body, unsafe_allow_html=False)",
+ "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.metric": {
+ "name": "metric",
+ "signature": "element.metric(self, label, value, delta=None, delta_color=\"normal\")",
+ "example": "\n\n>>> st.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\n>>> col1, col2, col3 = st.columns(3)\n>>> col1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\n>>> col2.metric("Wind", "9 mph", "-8%")\n>>> col3.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\n>>> st.metric(label="Gas price", value=4, delta=-0.5,\n... delta_color="inverse")\n>>>\n>>> st.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.",
+ "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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n",
+ "description": "Display a multiselect widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this select widget 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 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": "[str] or None",
+ "is_optional": false,
+ "description": "List of default values.
\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 selectbox.
\n",
+ "default": null
+ },
+ {
+ "name": "key",
+ "type_name": "str or int",
+ "is_optional": false,
+ "description": "An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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
+ }
+ ]
+ },
+ "DeltaGenerator.parse_delta": {
+ "name": "parse_delta",
+ "signature": "element.parse_delta(self, delta)"
+ },
+ "DeltaGenerator.parse_label": {
+ "name": "parse_label",
+ "signature": "element.parse_label(self, label)"
+ },
+ "DeltaGenerator.parse_value": {
+ "name": "parse_value",
+ "signature": "element.parse_value(self, value)"
+ },
+ "DeltaGenerator.plotly_chart": {
+ "name": "plotly_chart",
+ "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)",
+ "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.",
+ "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
\nSee 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://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
+ },
+ {
+ "name": "To show Plotly charts in Streamlit, call `st.plotly_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Plotly's `py.plot` or `py.iplot`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.progress": {
+ "name": "progress",
+ "signature": "element.progress(self, value)",
+ "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.pydeck_chart": {
+ "name": "pydeck_chart",
+ "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)",
+ "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.",
+ "args": [
+ {
+ "name": "spec",
+ "type_name": "pydeck.Deck or None",
+ "is_optional": false,
+ "description": "Object specifying the PyDeck chart to draw.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.pyplot": {
+ "name": "pyplot",
+ "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)",
+ "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n",
+ "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n",
+ "description": "Display a slider widget to select items from a list.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "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": "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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n",
+ "description": "Display a slider widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this slider is for.
\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
+ }
+ ]
+ },
+ "DeltaGenerator.subheader": {
+ "name": "subheader",
+ "signature": "element.subheader(self, body, anchor=None)",
+ "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "DeltaGenerator.success": {
+ "name": "success",
+ "signature": "element.success(self, body)",
+ "example": "\n\n>>> st.success('This is a success message!')\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
+ }
+ ]
+ },
+ "DeltaGenerator.table": {
+ "name": "table",
+ "signature": "element.table(self, data=None)",
+ "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a static table.",
+ "args": [
+ {
+ "name": "data",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.text": {
+ "name": "text",
+ "signature": "element.text(self, body)",
+ "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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
+ }
+ ]
+ },
+ "DeltaGenerator.title": {
+ "name": "title",
+ "signature": "element.title(self, body, anchor=None)",
+ "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in title 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
+ }
+ ]
+ },
+ "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\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.video": {
+ "name": "video",
+ "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)",
+ "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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
+ }
+ ]
+ },
+ "DeltaGenerator.warning": {
+ "name": "warning",
+ "signature": "element.warning(self, body)",
+ "example": "\n\n>>> st.warning('This is a warning')\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
+ }
+ ]
+ },
+ "DeltaGenerator.write": {
+ "name": "write",
+ "signature": "element.write(self, *args, **kwargs)",
+ "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Write arguments to the app.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n",
+ "default": "False."
+ }
+ ]
+ }
+ },
+ "1.0.0": {
+ "streamlit.altair_chart": {
+ "name": "altair_chart",
+ "signature": "st.altair_chart(altair_chart, use_container_width=False)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\nExamples 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
+ }
+ ]
+ },
+ "streamlit.area_chart": {
+ "name": "area_chart",
+ "signature": "st.area_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display an area chart.",
+ "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": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.audio": {
+ "name": "audio",
+ "signature": "st.audio(data, format=\"audio/wav\", start_time=0)",
+ "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n",
+ "default": "s"
+ }
+ ]
+ },
+ "streamlit.balloons": {
+ "name": "balloons",
+ "signature": "st.balloons()",
+ "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n",
+ "description": "Draw celebratory balloons.",
+ "args": []
+ },
+ "streamlit.bar_chart": {
+ "name": "bar_chart",
+ "signature": "st.bar_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a bar chart.",
+ "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": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.beta_columns": {
+ "name": "beta_columns",
+ "signature": "st.beta_columns(*args, **kwargs)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor 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
+ }
+ ]
+ },
+ "streamlit.beta_container": {
+ "name": "beta_container",
+ "signature": "st.beta_container(*args, **kwargs)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "streamlit.beta_expander": {
+ "name": "beta_expander",
+ "signature": "st.beta_expander(*args, **kwargs)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "streamlit.bokeh_chart": {
+ "name": "bokeh_chart",
+ "signature": "st.bokeh_chart(figure, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.",
+ "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
+ },
+ {
+ "name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Bokeh's `show`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.button": {
+ "name": "button",
+ "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None)",
+ "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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
+ }
+ ]
+ },
+ "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\n... def fetch_and_clean_data(url):\n... # Fetch data from URL here, and then clean it up.\n... return data\n...\n>>> d1 = fetch_and_clean_data(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> d2 = 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>>>\n>>> d3 = fetch_and_clean_data(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nTo 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
\nTo 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
\nTo 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
\nAlternatively, 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",
+ "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 normally shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.
\nIf 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 functions 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."
+ }
+ ]
+ },
+ "streamlit.caption": {
+ "name": "caption",
+ "signature": "st.caption(body)",
+ "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in small font.",
+ "args": [
+ {
+ "name": "body",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "The text to display.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.checkbox": {
+ "name": "checkbox",
+ "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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
+ }
+ ]
+ },
+ "streamlit.code": {
+ "name": "code",
+ "signature": "st.code(body, language=\"python\")",
+ "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a code block with optional syntax highlighting.",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.color_picker": {
+ "name": "color_picker",
+ "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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
+ }
+ ]
+ },
+ "streamlit.columns": {
+ "name": "columns",
+ "signature": "st.columns(spec)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor 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
+ }
+ ]
+ },
+ "streamlit.container": {
+ "name": "container",
+ "signature": "st.container()",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "streamlit.dataframe": {
+ "name": "dataframe",
+ "signature": "st.dataframe(data=None, width=None, height=None)",
+ "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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.
\nIf '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 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 UI element expressed in pixels. If None, a\ndefault height is used.
\n",
+ "default": "height"
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\nDownload 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>>>\n>>> csv = convert_df(my_large_df)\n>>>\n>>> st.download_button(\n... label="Download data as CSV",\n... data=csv,\n... file_name='large_df.csv',\n... mime='text/csv',\n... )\n
\nDownload a string as a file:
\n\n>>> text_contents = '''This is some text'''\n>>> st.download_button('Download some text', text_contents)\n
\nDownload a binary file:
\n\n>>> binary_contents = b'example content'\n>>> # Defaults to 'application/octet-stream'\n>>> st.download_button('Download binary file', binary_contents)\n
\nDownload an image:
\n\n>>> with 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",
+ "description": "Display a download 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": "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
+ }
+ ]
+ },
+ "streamlit.echo": {
+ "name": "echo",
+ "signature": "st.echo(code_location=\"above\")",
+ "example": "\n\n>>> with 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
+ }
+ ]
+ },
+ "streamlit.empty": {
+ "name": "empty",
+ "signature": "st.empty()",
+ "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n",
+ "description": "Insert a single-element container.",
+ "args": []
+ },
+ "streamlit.error": {
+ "name": "error",
+ "signature": "st.error(body)",
+ "example": "\n\n>>> st.error('This is an error')\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
+ }
+ ]
+ },
+ "streamlit.exception": {
+ "name": "exception",
+ "signature": "st.exception(exception)",
+ "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.expander": {
+ "name": "expander",
+ "signature": "st.expander(label, expanded=False)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "streamlit.experimental_get_query_params": {
+ "name": "experimental_get_query_params",
+ "signature": "st.experimental_get_query_params()",
+ "example": "\nLet'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\n>>> st.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\nNote 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": []
+ },
+ "streamlit.experimental_memo": {
+ "name": "memo",
+ "signature": "st.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...\n>>> d1 = fetch_and_clean_data(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> d2 = 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>>>\n>>> d3 = fetch_and_clean_data(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nTo 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
\nBy 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...\n>>> connection = make_database_connection()\n>>> d1 = fetch_and_clean_data(connection, num_rows=10)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> another_connection = make_database_connection()\n>>> d2 = 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
\n",
+ "description": "Function decorator to memoize function executions.",
+ "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 functions 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 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."
+ }
+ ]
+ },
+ "streamlit.experimental_rerun": {
+ "name": "experimental_rerun",
+ "signature": "st.experimental_rerun()",
+ "description": "Rerun the script immediately.",
+ "args": []
+ },
+ "streamlit.experimental_set_query_params": {
+ "name": "experimental_set_query_params",
+ "signature": "st.experimental_set_query_params(**query_params)",
+ "example": "\nTo 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\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.experimental_show": {
+ "name": "experimental_show",
+ "signature": "st.experimental_show(*args)",
+ "notes": "\nThis 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- When passing multiple arguments the inclusion of , or ) in a string
\n
\n \nargument may cause an error.
\n
\n",
+ "example": "\n\n>>> dataframe = pd.DataFrame({\n... 'first column': [1, 2, 3, 4],\n... 'second column': [10, 20, 30, 40],\n... }))\n>>> st.experimental_show(dataframe)\n
\n
\n",
+ "description": "Write arguments and *argument names* to your app for debugging purposes.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to debug in the App.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.experimental_singleton": {
+ "name": "singleton",
+ "signature": "st.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...\n>>> s1 = get_database_session(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> s2 = get_database_session(DATA_URL_1)\n>>> # Does not execute the function. Instead, returns its previously computed\n>>> # value. This means that now the connection object in d1 is the same as in d2.\n>>>\n>>> s3 = get_database_session(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nBy 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...\n>>> s1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> s2 = 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
\n",
+ "description": "Function decorator to store singleton objects.",
+ "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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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",
+ "description": "Display a file uploader widget.",
+ "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",
+ "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
+ }
+ ]
+ },
+ "streamlit.form": {
+ "name": "form",
+ "signature": "st.form(key, clear_on_submit=False)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n",
+ "description": "Create a form that batches elements together with a \"Submit\" button.",
+ "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"
+ }
+ ]
+ },
+ "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.",
+ "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
+ }
+ ]
+ },
+ "streamlit.get_option": {
+ "name": "get_option",
+ "signature": "st.get_option(key)",
+ "description": "Return the current value of a given Streamlit config option.",
+ "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
+ }
+ ]
+ },
+ "streamlit.graphviz_chart": {
+ "name": "graphviz_chart",
+ "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.header": {
+ "name": "header",
+ "signature": "st.header(body, anchor=None)",
+ "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "streamlit.help": {
+ "name": "help",
+ "signature": "st.help(obj)",
+ "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n",
+ "description": "Display object's doc string, nicely formatted.",
+ "args": [
+ {
+ "name": "obj",
+ "type_name": "Object",
+ "is_optional": false,
+ "description": "The object whose docstring should be displayed.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"
+ }
+ ]
+ },
+ "streamlit.info": {
+ "name": "info",
+ "signature": "st.info(body)",
+ "example": "\n\n>>> st.info('This is a purely informational message')\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
+ }
+ ]
+ },
+ "streamlit.json": {
+ "name": "json",
+ "signature": "st.json(body)",
+ "example": "\n\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.latex": {
+ "name": "latex",
+ "signature": "st.latex(body)",
+ "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display mathematical expressions formatted as LaTeX.",
+ "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
+ }
+ ]
+ },
+ "streamlit.line_chart": {
+ "name": "line_chart",
+ "signature": "st.line_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a line chart.",
+ "args": [
+ {
+ "name": "data",
+ "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",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.map": {
+ "name": "map",
+ "signature": "st.map(data=None, zoom=None, use_container_width=True)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a map with points on it.",
+ "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
+ }
+ ]
+ },
+ "streamlit.markdown": {
+ "name": "markdown",
+ "signature": "st.markdown(body, unsafe_allow_html=False)",
+ "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.metric": {
+ "name": "metric",
+ "signature": "st.metric(label, value, delta=None, delta_color=\"normal\")",
+ "example": "\n\n>>> st.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\n>>> col1, col2, col3 = st.columns(3)\n>>> col1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\n>>> col2.metric("Wind", "9 mph", "-8%")\n>>> col3.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\n>>> st.metric(label="Gas price", value=4, delta=-0.5,\n... delta_color="inverse")\n>>>\n>>> st.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.",
+ "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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n",
+ "description": "Display a multiselect widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this select widget 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 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": "[str] or None",
+ "is_optional": false,
+ "description": "List of default values.
\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 selectbox.
\n",
+ "default": null
+ },
+ {
+ "name": "key",
+ "type_name": "str or int",
+ "is_optional": false,
+ "description": "An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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
+ }
+ ]
+ },
+ "streamlit.plotly_chart": {
+ "name": "plotly_chart",
+ "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)",
+ "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.",
+ "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
\nSee 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://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
+ },
+ {
+ "name": "To show Plotly charts in Streamlit, call `st.plotly_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Plotly's `py.plot` or `py.iplot`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.progress": {
+ "name": "progress",
+ "signature": "st.progress(value)",
+ "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.pydeck_chart": {
+ "name": "pydeck_chart",
+ "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)",
+ "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.",
+ "args": [
+ {
+ "name": "spec",
+ "type_name": "pydeck.Deck or None",
+ "is_optional": false,
+ "description": "Object specifying the PyDeck chart to draw.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.pyplot": {
+ "name": "pyplot",
+ "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)",
+ "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n",
+ "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n",
+ "description": "Display a slider widget to select items from a list.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "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": "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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\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
+ }
+ ]
+ },
+ "streamlit.set_option": {
+ "name": "set_option",
+ "signature": "st.set_option(key, value)",
+ "description": "Set config option.",
+ "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
+ }
+ ]
+ },
+ "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": "\n>>> st.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.",
+ "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\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
\n",
+ "default": "About"
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n",
+ "description": "Display a slider widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this slider is for.
\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
+ }
+ ]
+ },
+ "streamlit.spinner": {
+ "name": "spinner",
+ "signature": "st.spinner(text=\"In progress...\")",
+ "example": "\n\n>>> with st.spinner('Wait for it...'):\n>>> time.sleep(5)\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.stop": {
+ "name": "stop",
+ "signature": "st.stop()",
+ "example": "\n\n>>> name = st.text_input('Name')\n>>> if not name:\n>>> st.warning('Please input a name.')\n>>> st.stop()\n>>> st.success('Thank you for inputting a name.')\n
\n
\n",
+ "description": "Stops execution immediately.",
+ "args": []
+ },
+ "streamlit.subheader": {
+ "name": "subheader",
+ "signature": "st.subheader(body, anchor=None)",
+ "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "streamlit.success": {
+ "name": "success",
+ "signature": "st.success(body)",
+ "example": "\n\n>>> st.success('This is a success message!')\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
+ }
+ ]
+ },
+ "streamlit.table": {
+ "name": "table",
+ "signature": "st.table(data=None)",
+ "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a static table.",
+ "args": [
+ {
+ "name": "data",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.text": {
+ "name": "text",
+ "signature": "st.text(body)",
+ "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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
+ }
+ ]
+ },
+ "streamlit.time_input": {
+ "name": "time_input",
+ "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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
+ }
+ ]
+ },
+ "streamlit.title": {
+ "name": "title",
+ "signature": "st.title(body, anchor=None)",
+ "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in title 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
+ }
+ ]
+ },
+ "streamlit.vega_lite_chart": {
+ "name": "vega_lite_chart",
+ "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, **kwargs)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.video": {
+ "name": "video",
+ "signature": "st.video(data, format=\"video/mp4\", start_time=0)",
+ "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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
+ }
+ ]
+ },
+ "streamlit.warning": {
+ "name": "warning",
+ "signature": "st.warning(body)",
+ "example": "\n\n>>> st.warning('This is a warning')\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
+ }
+ ]
+ },
+ "streamlit.write": {
+ "name": "write",
+ "signature": "st.write(*args, **kwargs)",
+ "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Write arguments to the app.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n",
+ "default": "False."
+ }
+ ]
+ },
+ "DeltaGenerator.add_rows": {
+ "name": "add_rows",
+ "signature": "element.add_rows(self, data=None, **kwargs)",
+ "example": "\n\n>>> df1 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_table = st.table(df1)\n>>>\n>>> df2 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_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
\nYou 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...\n>>> my_chart = st.line_chart(df1)\n>>> my_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
\nAnd for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:
\n\n>>> my_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... }),\n>>> my_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": "**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
+ }
+ ]
+ },
+ "DeltaGenerator.altair_chart": {
+ "name": "altair_chart",
+ "signature": "element.altair_chart(self, altair_chart, use_container_width=False)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\nExamples 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
+ }
+ ]
+ },
+ "DeltaGenerator.area_chart": {
+ "name": "area_chart",
+ "signature": "element.area_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display an area chart.",
+ "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": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.audio": {
+ "name": "audio",
+ "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0)",
+ "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n",
+ "default": "s"
+ }
+ ]
+ },
+ "DeltaGenerator.balloons": {
+ "name": "balloons",
+ "signature": "element.balloons(self)",
+ "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n",
+ "description": "Draw celebratory balloons.",
+ "args": []
+ },
+ "DeltaGenerator.bar_chart": {
+ "name": "bar_chart",
+ "signature": "element.bar_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a bar chart.",
+ "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": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.beta_columns": {
+ "name": "beta_columns",
+ "signature": "element.beta_columns(*args, **kwargs)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor 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
+ }
+ ]
+ },
+ "DeltaGenerator.beta_container": {
+ "name": "beta_container",
+ "signature": "element.beta_container(*args, **kwargs)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "DeltaGenerator.beta_expander": {
+ "name": "beta_expander",
+ "signature": "element.beta_expander(*args, **kwargs)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "DeltaGenerator.bokeh_chart": {
+ "name": "bokeh_chart",
+ "signature": "element.bokeh_chart(self, figure, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.",
+ "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
+ },
+ {
+ "name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Bokeh's `show`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.button": {
+ "name": "button",
+ "signature": "element.button(self, label, key=None, help=None, on_click=None, args=None, kwargs=None)",
+ "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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
+ }
+ ]
+ },
+ "DeltaGenerator.caption": {
+ "name": "caption",
+ "signature": "element.caption(self, body)",
+ "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in small font.",
+ "args": [
+ {
+ "name": "body",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "The text to display.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.checkbox": {
+ "name": "checkbox",
+ "signature": "element.checkbox(self, label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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
+ }
+ ]
+ },
+ "DeltaGenerator.code": {
+ "name": "code",
+ "signature": "element.code(self, body, language=\"python\")",
+ "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a code block with optional syntax highlighting.",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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
+ }
+ ]
+ },
+ "DeltaGenerator.columns": {
+ "name": "columns",
+ "signature": "element.columns(self, spec)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor 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
+ }
+ ]
+ },
+ "DeltaGenerator.container": {
+ "name": "container",
+ "signature": "element.container(self)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "DeltaGenerator.dataframe": {
+ "name": "dataframe",
+ "signature": "element.dataframe(self, data=None, width=None, height=None)",
+ "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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.
\nIf '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 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 UI element expressed in pixels. If None, a\ndefault height is used.
\n",
+ "default": "height"
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\nDownload 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>>>\n>>> csv = convert_df(my_large_df)\n>>>\n>>> st.download_button(\n... label="Download data as CSV",\n... data=csv,\n... file_name='large_df.csv',\n... mime='text/csv',\n... )\n
\nDownload a string as a file:
\n\n>>> text_contents = '''This is some text'''\n>>> st.download_button('Download some text', text_contents)\n
\nDownload a binary file:
\n\n>>> binary_contents = b'example content'\n>>> # Defaults to 'application/octet-stream'\n>>> st.download_button('Download binary file', binary_contents)\n
\nDownload an image:
\n\n>>> with 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",
+ "description": "Display a download 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": "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
+ }
+ ]
+ },
+ "DeltaGenerator.empty": {
+ "name": "empty",
+ "signature": "element.empty(self)",
+ "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n",
+ "description": "Insert a single-element container.",
+ "args": []
+ },
+ "DeltaGenerator.error": {
+ "name": "error",
+ "signature": "element.error(self, body)",
+ "example": "\n\n>>> st.error('This is an error')\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
+ }
+ ]
+ },
+ "DeltaGenerator.exception": {
+ "name": "exception",
+ "signature": "element.exception(self, exception)",
+ "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.expander": {
+ "name": "expander",
+ "signature": "element.expander(self, label, expanded=False)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "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)",
+ "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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",
+ "description": "Display a file uploader widget.",
+ "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",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.form": {
+ "name": "form",
+ "signature": "element.form(self, key, clear_on_submit=False)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n",
+ "description": "Create a form that batches elements together with a \"Submit\" button.",
+ "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"
+ }
+ ]
+ },
+ "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.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.graphviz_chart": {
+ "name": "graphviz_chart",
+ "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.header": {
+ "name": "header",
+ "signature": "element.header(self, body, anchor=None)",
+ "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "DeltaGenerator.help": {
+ "name": "help",
+ "signature": "element.help(self, obj)",
+ "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n",
+ "description": "Display object's doc string, nicely formatted.",
+ "args": [
+ {
+ "name": "obj",
+ "type_name": "Object",
+ "is_optional": false,
+ "description": "The object whose docstring should be displayed.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"
+ }
+ ]
+ },
+ "DeltaGenerator.info": {
+ "name": "info",
+ "signature": "element.info(self, body)",
+ "example": "\n\n>>> st.info('This is a purely informational message')\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
+ }
+ ]
+ },
+ "DeltaGenerator.is_negative": {
+ "name": "is_negative",
+ "signature": "element.is_negative(self, delta)"
+ },
+ "DeltaGenerator.json": {
+ "name": "json",
+ "signature": "element.json(self, body)",
+ "example": "\n\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.latex": {
+ "name": "latex",
+ "signature": "element.latex(self, body)",
+ "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display mathematical expressions formatted as LaTeX.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.line_chart": {
+ "name": "line_chart",
+ "signature": "element.line_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a line chart.",
+ "args": [
+ {
+ "name": "data",
+ "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",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.map": {
+ "name": "map",
+ "signature": "element.map(self, data=None, zoom=None, use_container_width=True)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a map with points on it.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.markdown": {
+ "name": "markdown",
+ "signature": "element.markdown(self, body, unsafe_allow_html=False)",
+ "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.metric": {
+ "name": "metric",
+ "signature": "element.metric(self, label, value, delta=None, delta_color=\"normal\")",
+ "example": "\n\n>>> st.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\n>>> col1, col2, col3 = st.columns(3)\n>>> col1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\n>>> col2.metric("Wind", "9 mph", "-8%")\n>>> col3.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\n>>> st.metric(label="Gas price", value=4, delta=-0.5,\n... delta_color="inverse")\n>>>\n>>> st.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.",
+ "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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n",
+ "description": "Display a multiselect widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this select widget 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 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": "[str] or None",
+ "is_optional": false,
+ "description": "List of default values.
\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 selectbox.
\n",
+ "default": null
+ },
+ {
+ "name": "key",
+ "type_name": "str or int",
+ "is_optional": false,
+ "description": "An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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
+ }
+ ]
+ },
+ "DeltaGenerator.parse_delta": {
+ "name": "parse_delta",
+ "signature": "element.parse_delta(self, delta)"
+ },
+ "DeltaGenerator.parse_label": {
+ "name": "parse_label",
+ "signature": "element.parse_label(self, label)"
+ },
+ "DeltaGenerator.parse_value": {
+ "name": "parse_value",
+ "signature": "element.parse_value(self, value)"
+ },
+ "DeltaGenerator.plotly_chart": {
+ "name": "plotly_chart",
+ "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)",
+ "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.",
+ "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
\nSee 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://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
+ },
+ {
+ "name": "To show Plotly charts in Streamlit, call `st.plotly_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Plotly's `py.plot` or `py.iplot`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.progress": {
+ "name": "progress",
+ "signature": "element.progress(self, value)",
+ "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.pydeck_chart": {
+ "name": "pydeck_chart",
+ "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)",
+ "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.",
+ "args": [
+ {
+ "name": "spec",
+ "type_name": "pydeck.Deck or None",
+ "is_optional": false,
+ "description": "Object specifying the PyDeck chart to draw.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.pyplot": {
+ "name": "pyplot",
+ "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)",
+ "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n",
+ "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n",
+ "description": "Display a slider widget to select items from a list.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "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": "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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n",
+ "description": "Display a slider widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this slider is for.
\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
+ }
+ ]
+ },
+ "DeltaGenerator.subheader": {
+ "name": "subheader",
+ "signature": "element.subheader(self, body, anchor=None)",
+ "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "DeltaGenerator.success": {
+ "name": "success",
+ "signature": "element.success(self, body)",
+ "example": "\n\n>>> st.success('This is a success message!')\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
+ }
+ ]
+ },
+ "DeltaGenerator.table": {
+ "name": "table",
+ "signature": "element.table(self, data=None)",
+ "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a static table.",
+ "args": [
+ {
+ "name": "data",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.text": {
+ "name": "text",
+ "signature": "element.text(self, body)",
+ "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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
+ }
+ ]
+ },
+ "DeltaGenerator.title": {
+ "name": "title",
+ "signature": "element.title(self, body, anchor=None)",
+ "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in title 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
+ }
+ ]
+ },
+ "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\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.video": {
+ "name": "video",
+ "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)",
+ "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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
+ }
+ ]
+ },
+ "DeltaGenerator.warning": {
+ "name": "warning",
+ "signature": "element.warning(self, body)",
+ "example": "\n\n>>> st.warning('This is a warning')\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
+ }
+ ]
+ },
+ "DeltaGenerator.write": {
+ "name": "write",
+ "signature": "element.write(self, *args, **kwargs)",
+ "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Write arguments to the app.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n",
+ "default": "False."
+ }
+ ]
+ }
+ },
+ "1.1.0": {
+ "streamlit.altair_chart": {
+ "name": "altair_chart",
+ "signature": "st.altair_chart(altair_chart, use_container_width=False)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\nExamples 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
+ }
+ ]
+ },
+ "streamlit.area_chart": {
+ "name": "area_chart",
+ "signature": "st.area_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display an area chart.",
+ "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": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.audio": {
+ "name": "audio",
+ "signature": "st.audio(data, format=\"audio/wav\", start_time=0)",
+ "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n",
+ "default": "s"
+ }
+ ]
+ },
+ "streamlit.balloons": {
+ "name": "balloons",
+ "signature": "st.balloons()",
+ "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n",
+ "description": "Draw celebratory balloons.",
+ "args": []
+ },
+ "streamlit.bar_chart": {
+ "name": "bar_chart",
+ "signature": "st.bar_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a bar chart.",
+ "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": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.beta_columns": {
+ "name": "beta_columns",
+ "signature": "st.beta_columns(*args, **kwargs)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor 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
+ }
+ ]
+ },
+ "streamlit.beta_container": {
+ "name": "beta_container",
+ "signature": "st.beta_container(*args, **kwargs)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "streamlit.beta_expander": {
+ "name": "beta_expander",
+ "signature": "st.beta_expander(*args, **kwargs)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "streamlit.bokeh_chart": {
+ "name": "bokeh_chart",
+ "signature": "st.bokeh_chart(figure, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.",
+ "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
+ },
+ {
+ "name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Bokeh's `show`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.button": {
+ "name": "button",
+ "signature": "st.button(label, key=None, help=None, on_click=None, args=None, kwargs=None)",
+ "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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
+ }
+ ]
+ },
+ "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\n... def fetch_and_clean_data(url):\n... # Fetch data from URL here, and then clean it up.\n... return data\n...\n>>> d1 = fetch_and_clean_data(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> d2 = 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>>>\n>>> d3 = fetch_and_clean_data(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nTo 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
\nTo 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
\nTo 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
\nAlternatively, 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",
+ "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 normally shows a warning when return values are mutated, as that\ncan have unintended consequences. This is done by hashing the return value internally.
\nIf 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 functions 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."
+ }
+ ]
+ },
+ "streamlit.caption": {
+ "name": "caption",
+ "signature": "st.caption(body)",
+ "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in small font.",
+ "args": [
+ {
+ "name": "body",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "The text to display.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.checkbox": {
+ "name": "checkbox",
+ "signature": "st.checkbox(label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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
+ }
+ ]
+ },
+ "streamlit.code": {
+ "name": "code",
+ "signature": "st.code(body, language=\"python\")",
+ "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a code block with optional syntax highlighting.",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.color_picker": {
+ "name": "color_picker",
+ "signature": "st.color_picker(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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
+ }
+ ]
+ },
+ "streamlit.columns": {
+ "name": "columns",
+ "signature": "st.columns(spec)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor 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
+ }
+ ]
+ },
+ "streamlit.container": {
+ "name": "container",
+ "signature": "st.container()",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "streamlit.dataframe": {
+ "name": "dataframe",
+ "signature": "st.dataframe(data=None, width=None, height=None)",
+ "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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.
\nIf '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 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 UI element expressed in pixels. If None, a\ndefault height is used.
\n",
+ "default": "height"
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\nDownload 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>>>\n>>> csv = convert_df(my_large_df)\n>>>\n>>> st.download_button(\n... label="Download data as CSV",\n... data=csv,\n... file_name='large_df.csv',\n... mime='text/csv',\n... )\n
\nDownload a string as a file:
\n\n>>> text_contents = '''This is some text'''\n>>> st.download_button('Download some text', text_contents)\n
\nDownload a binary file:
\n\n>>> binary_contents = b'example content'\n>>> # Defaults to 'application/octet-stream'\n>>> st.download_button('Download binary file', binary_contents)\n
\nDownload an image:
\n\n>>> with 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",
+ "description": "Display a download 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": "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
+ }
+ ]
+ },
+ "streamlit.echo": {
+ "name": "echo",
+ "signature": "st.echo(code_location=\"above\")",
+ "example": "\n\n>>> with 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
+ }
+ ]
+ },
+ "streamlit.empty": {
+ "name": "empty",
+ "signature": "st.empty()",
+ "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n",
+ "description": "Insert a single-element container.",
+ "args": []
+ },
+ "streamlit.error": {
+ "name": "error",
+ "signature": "st.error(body)",
+ "example": "\n\n>>> st.error('This is an error')\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
+ }
+ ]
+ },
+ "streamlit.exception": {
+ "name": "exception",
+ "signature": "st.exception(exception)",
+ "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.expander": {
+ "name": "expander",
+ "signature": "st.expander(label, expanded=False)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "streamlit.experimental_get_query_params": {
+ "name": "experimental_get_query_params",
+ "signature": "st.experimental_get_query_params()",
+ "example": "\nLet'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\n>>> st.experimental_get_query_params()\n{"show_map": ["True"], "selected": ["asia", "america"]}\n
\nNote 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": []
+ },
+ "streamlit.experimental_memo": {
+ "name": "memo",
+ "signature": "st.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...\n>>> d1 = fetch_and_clean_data(DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> d2 = 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>>>\n>>> d3 = fetch_and_clean_data(DATA_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nTo 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
\nBy 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...\n>>> connection = make_database_connection()\n>>> d1 = fetch_and_clean_data(connection, num_rows=10)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> another_connection = make_database_connection()\n>>> d2 = 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
\n",
+ "description": "Function decorator to memoize function executions.",
+ "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 functions 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 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."
+ }
+ ]
+ },
+ "streamlit.experimental_rerun": {
+ "name": "experimental_rerun",
+ "signature": "st.experimental_rerun()",
+ "description": "Rerun the script immediately.",
+ "args": []
+ },
+ "streamlit.experimental_set_query_params": {
+ "name": "experimental_set_query_params",
+ "signature": "st.experimental_set_query_params(**query_params)",
+ "example": "\nTo 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\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.experimental_show": {
+ "name": "experimental_show",
+ "signature": "st.experimental_show(*args)",
+ "notes": "\nThis 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- When passing multiple arguments the inclusion of , or ) in a string
\n
\n \nargument may cause an error.
\n
\n",
+ "example": "\n\n>>> dataframe = pd.DataFrame({\n... 'first column': [1, 2, 3, 4],\n... 'second column': [10, 20, 30, 40],\n... }))\n>>> st.experimental_show(dataframe)\n
\n
\n",
+ "description": "Write arguments and *argument names* to your app for debugging purposes.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to debug in the App.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.experimental_singleton": {
+ "name": "singleton",
+ "signature": "st.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...\n>>> s1 = get_database_session(SESSION_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> s2 = 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>>>\n>>> s3 = get_database_session(SESSION_URL_2)\n>>> # This is a different URL, so the function executes.\n
\nBy 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...\n>>> s1 = get_database_session(create_sessionmaker(), DATA_URL_1)\n>>> # Actually executes the function, since this is the first time it was\n>>> # encountered.\n>>>\n>>> s2 = 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
\n",
+ "description": "Function decorator to store singleton objects.",
+ "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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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",
+ "description": "Display a file uploader widget.",
+ "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",
+ "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
+ }
+ ]
+ },
+ "streamlit.form": {
+ "name": "form",
+ "signature": "st.form(key, clear_on_submit=False)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n",
+ "description": "Create a form that batches elements together with a \"Submit\" button.",
+ "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"
+ }
+ ]
+ },
+ "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.",
+ "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
+ }
+ ]
+ },
+ "streamlit.get_option": {
+ "name": "get_option",
+ "signature": "st.get_option(key)",
+ "description": "Return the current value of a given Streamlit config option.",
+ "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
+ }
+ ]
+ },
+ "streamlit.graphviz_chart": {
+ "name": "graphviz_chart",
+ "signature": "st.graphviz_chart(figure_or_dot, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.header": {
+ "name": "header",
+ "signature": "st.header(body, anchor=None)",
+ "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "streamlit.help": {
+ "name": "help",
+ "signature": "st.help(obj)",
+ "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n",
+ "description": "Display object's doc string, nicely formatted.",
+ "args": [
+ {
+ "name": "obj",
+ "type_name": "Object",
+ "is_optional": false,
+ "description": "The object whose docstring should be displayed.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"
+ }
+ ]
+ },
+ "streamlit.info": {
+ "name": "info",
+ "signature": "st.info(body)",
+ "example": "\n\n>>> st.info('This is a purely informational message')\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
+ }
+ ]
+ },
+ "streamlit.json": {
+ "name": "json",
+ "signature": "st.json(body)",
+ "example": "\n\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.latex": {
+ "name": "latex",
+ "signature": "st.latex(body)",
+ "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display mathematical expressions formatted as LaTeX.",
+ "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
+ }
+ ]
+ },
+ "streamlit.line_chart": {
+ "name": "line_chart",
+ "signature": "st.line_chart(data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a line chart.",
+ "args": [
+ {
+ "name": "data",
+ "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",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.map": {
+ "name": "map",
+ "signature": "st.map(data=None, zoom=None, use_container_width=True)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a map with points on it.",
+ "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
+ }
+ ]
+ },
+ "streamlit.markdown": {
+ "name": "markdown",
+ "signature": "st.markdown(body, unsafe_allow_html=False)",
+ "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.metric": {
+ "name": "metric",
+ "signature": "st.metric(label, value, delta=None, delta_color=\"normal\")",
+ "example": "\n\n>>> st.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\n>>> col1, col2, col3 = st.columns(3)\n>>> col1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\n>>> col2.metric("Wind", "9 mph", "-8%")\n>>> col3.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\n>>> st.metric(label="Gas price", value=4, delta=-0.5,\n... delta_color="inverse")\n>>>\n>>> st.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.",
+ "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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n",
+ "description": "Display a multiselect widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this select widget 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 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": "[str] or None",
+ "is_optional": false,
+ "description": "List of default values.
\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 selectbox.
\n",
+ "default": null
+ },
+ {
+ "name": "key",
+ "type_name": "str or int",
+ "is_optional": false,
+ "description": "An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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
+ }
+ ]
+ },
+ "streamlit.plotly_chart": {
+ "name": "plotly_chart",
+ "signature": "st.plotly_chart(figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)",
+ "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.",
+ "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
\nSee 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://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
+ },
+ {
+ "name": "To show Plotly charts in Streamlit, call `st.plotly_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Plotly's `py.plot` or `py.iplot`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.progress": {
+ "name": "progress",
+ "signature": "st.progress(value)",
+ "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.pydeck_chart": {
+ "name": "pydeck_chart",
+ "signature": "st.pydeck_chart(pydeck_obj=None, use_container_width=False)",
+ "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.",
+ "args": [
+ {
+ "name": "spec",
+ "type_name": "pydeck.Deck or None",
+ "is_optional": false,
+ "description": "Object specifying the PyDeck chart to draw.
\n",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.pyplot": {
+ "name": "pyplot",
+ "signature": "st.pyplot(fig=None, clear_figure=None, **kwargs)",
+ "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n",
+ "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n",
+ "description": "Display a slider widget to select items from a list.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "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": "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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\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
+ }
+ ]
+ },
+ "streamlit.set_option": {
+ "name": "set_option",
+ "signature": "st.set_option(key, value)",
+ "description": "Set config option.",
+ "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
+ }
+ ]
+ },
+ "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": "\n>>> st.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.",
+ "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",
+ "default": "About"
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n",
+ "description": "Display a slider widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this slider is for.
\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
+ }
+ ]
+ },
+ "streamlit.spinner": {
+ "name": "spinner",
+ "signature": "st.spinner(text=\"In progress...\")",
+ "example": "\n\n>>> with st.spinner('Wait for it...'):\n>>> time.sleep(5)\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.stop": {
+ "name": "stop",
+ "signature": "st.stop()",
+ "example": "\n\n>>> name = st.text_input('Name')\n>>> if not name:\n>>> st.warning('Please input a name.')\n>>> st.stop()\n>>> st.success('Thank you for inputting a name.')\n
\n
\n",
+ "description": "Stops execution immediately.",
+ "args": []
+ },
+ "streamlit.subheader": {
+ "name": "subheader",
+ "signature": "st.subheader(body, anchor=None)",
+ "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "streamlit.success": {
+ "name": "success",
+ "signature": "st.success(body)",
+ "example": "\n\n>>> st.success('This is a success message!')\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
+ }
+ ]
+ },
+ "streamlit.table": {
+ "name": "table",
+ "signature": "st.table(data=None)",
+ "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a static table.",
+ "args": [
+ {
+ "name": "data",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "streamlit.text": {
+ "name": "text",
+ "signature": "st.text(body)",
+ "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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
+ }
+ ]
+ },
+ "streamlit.time_input": {
+ "name": "time_input",
+ "signature": "st.time_input(label, value=None, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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
+ }
+ ]
+ },
+ "streamlit.title": {
+ "name": "title",
+ "signature": "st.title(body, anchor=None)",
+ "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in title 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
+ }
+ ]
+ },
+ "streamlit.vega_lite_chart": {
+ "name": "vega_lite_chart",
+ "signature": "st.vega_lite_chart(data=None, spec=None, use_container_width=False, **kwargs)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "streamlit.video": {
+ "name": "video",
+ "signature": "st.video(data, format=\"video/mp4\", start_time=0)",
+ "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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
+ }
+ ]
+ },
+ "streamlit.warning": {
+ "name": "warning",
+ "signature": "st.warning(body)",
+ "example": "\n\n>>> st.warning('This is a warning')\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
+ }
+ ]
+ },
+ "streamlit.write": {
+ "name": "write",
+ "signature": "st.write(*args, **kwargs)",
+ "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Write arguments to the app.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n",
+ "default": "False."
+ }
+ ]
+ },
+ "DeltaGenerator.add_rows": {
+ "name": "add_rows",
+ "signature": "element.add_rows(self, data=None, **kwargs)",
+ "example": "\n\n>>> df1 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_table = st.table(df1)\n>>>\n>>> df2 = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> my_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
\nYou 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...\n>>> my_chart = st.line_chart(df1)\n>>> my_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
\nAnd for plots whose datasets are named, you can pass the data with a\nkeyword argument where the key is the name:
\n\n>>> my_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... }),\n>>> my_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": "**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
+ }
+ ]
+ },
+ "DeltaGenerator.altair_chart": {
+ "name": "altair_chart",
+ "signature": "element.altair_chart(self, altair_chart, use_container_width=False)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.altair_chart(c, use_container_width=True)\n
\nExamples 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
+ }
+ ]
+ },
+ "DeltaGenerator.area_chart": {
+ "name": "area_chart",
+ "signature": "element.area_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.area_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display an area chart.",
+ "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": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.audio": {
+ "name": "audio",
+ "signature": "element.audio(self, data, format=\"audio/wav\", start_time=0)",
+ "example": "\n\n>>> audio_file = open('myaudio.ogg', 'rb')\n>>> audio_bytes = audio_file.read()\n>>>\n>>> st.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": "The mime type for the audio file. Defaults to 'audio/wav'.\nSee https://tools.ietf.org/html/rfc4281 for more info.
\n",
+ "default": "s"
+ }
+ ]
+ },
+ "DeltaGenerator.balloons": {
+ "name": "balloons",
+ "signature": "element.balloons(self)",
+ "example": "\n\n>>> st.balloons()\n
\n...then watch your app and get ready for a celebration!
\n
\n",
+ "description": "Draw celebratory balloons.",
+ "args": []
+ },
+ "DeltaGenerator.bar_chart": {
+ "name": "bar_chart",
+ "signature": "element.bar_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(50, 3),\n... columns=["a", "b", "c"])\n...\n>>> st.bar_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a bar chart.",
+ "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": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.beta_columns": {
+ "name": "beta_columns",
+ "signature": "element.beta_columns(*args, **kwargs)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor 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
+ }
+ ]
+ },
+ "DeltaGenerator.beta_container": {
+ "name": "beta_container",
+ "signature": "element.beta_container(*args, **kwargs)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "DeltaGenerator.beta_expander": {
+ "name": "beta_expander",
+ "signature": "element.beta_expander(*args, **kwargs)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "DeltaGenerator.bokeh_chart": {
+ "name": "bokeh_chart",
+ "signature": "element.bokeh_chart(self, figure, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> from bokeh.plotting import figure\n>>>\n>>> x = [1, 2, 3, 4, 5]\n>>> y = [6, 7, 2, 4, 5]\n>>>\n>>> p = figure(\n... title='simple line example',\n... x_axis_label='x',\n... y_axis_label='y')\n...\n>>> p.line(x, y, legend_label='Trend', line_width=2)\n>>>\n>>> st.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.",
+ "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
+ },
+ {
+ "name": "To show Bokeh charts in Streamlit, call `st.bokeh_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Bokeh's `show`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.button": {
+ "name": "button",
+ "signature": "element.button(self, label, key=None, help=None, on_click=None, args=None, kwargs=None)",
+ "example": "\n\n>>> if st.button('Say hello'):\n... st.write('Why hello there')\n... else:\n... st.write('Goodbye')\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
+ }
+ ]
+ },
+ "DeltaGenerator.caption": {
+ "name": "caption",
+ "signature": "element.caption(self, body)",
+ "example": "\n\n>>> st.caption('This is a string that explains something above.')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in small font.",
+ "args": [
+ {
+ "name": "body",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "The text to display.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.checkbox": {
+ "name": "checkbox",
+ "signature": "element.checkbox(self, label, value=False, key=None, help=None, on_change=None, args=None, kwargs=None)",
+ "example": "\n\n>>> agree = st.checkbox('I agree')\n>>>\n>>> if agree:\n... st.write('Great!')\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
+ }
+ ]
+ },
+ "DeltaGenerator.code": {
+ "name": "code",
+ "signature": "element.code(self, body, language=\"python\")",
+ "example": "\n\n>>> code = '''def hello():\n... print("Hello, Streamlit!")'''\n>>> st.code(code, language='python')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a code block with optional syntax highlighting.",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> color = st.color_picker('Pick A Color', '#00f900')\n>>> st.write('The current color is', color)\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.
\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
+ }
+ ]
+ },
+ "DeltaGenerator.columns": {
+ "name": "columns",
+ "signature": "element.columns(self, spec)",
+ "examples": "\nYou can use with notation to insert any element into a column:
\n\n>>> col1, col2, col3 = st.columns(3)\n>>>\n>>> with col1:\n... st.header("A cat")\n... st.image("https://static.streamlit.io/examples/cat.jpg")\n...\n>>> with col2:\n... st.header("A dog")\n... st.image("https://static.streamlit.io/examples/dog.jpg")\n...\n>>> with 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\n>>> col1, col2 = st.columns([3, 1])\n>>> data = np.random.randn(10, 1)\n>>>\n>>> col1.subheader("A wide column with a chart")\n>>> col1.line_chart(data)\n>>>\n>>> col2.subheader("A narrow column with the data")\n>>> col2.write(data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert containers laid out as side-by-side columns.",
+ "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
\nCreates 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.
\nFor 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
+ }
+ ]
+ },
+ "DeltaGenerator.container": {
+ "name": "container",
+ "signature": "element.container(self)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("This is outside the container")\n
\n\n \n \n (view standalone Streamlit app)\n \n Inserting elements out of order:
\n\n>>> container = st.container()\n>>> container.write("This is inside the container")\n>>> st.write("This is outside the container")\n>>>\n>>> # Now insert some more in the container\n>>> container.write("This is inside too")\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Insert a multi-element container.",
+ "args": []
+ },
+ "DeltaGenerator.dataframe": {
+ "name": "dataframe",
+ "signature": "element.dataframe(self, data=None, width=None, height=None)",
+ "examples": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(50, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.dataframe(df) # Same as st.write(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n \n>>> st.dataframe(df, 200, 100)\n
\nYou can also pass a Pandas Styler object to change the style of\nthe rendered DataFrame:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 20),\n... columns=('col %d' % i for i in range(20)))\n...\n>>> st.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.
\nIf '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 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 UI element expressed in pixels. If None, a\ndefault height is used.
\n",
+ "default": "height"
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> d = st.date_input(\n... "When's your birthday",\n... datetime.date(2019, 7, 6))\n>>> st.write('Your birthday is:', d)\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": "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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\nDownload 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>>>\n>>> csv = convert_df(my_large_df)\n>>>\n>>> st.download_button(\n... label="Download data as CSV",\n... data=csv,\n... file_name='large_df.csv',\n... mime='text/csv',\n... )\n
\nDownload a string as a file:
\n\n>>> text_contents = '''This is some text'''\n>>> st.download_button('Download some text', text_contents)\n
\nDownload a binary file:
\n\n>>> binary_contents = b'example content'\n>>> # Defaults to 'application/octet-stream'\n>>> st.download_button('Download binary file', binary_contents)\n
\nDownload an image:
\n\n>>> with 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",
+ "description": "Display a download 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": "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
+ }
+ ]
+ },
+ "DeltaGenerator.empty": {
+ "name": "empty",
+ "signature": "element.empty(self)",
+ "examples": "\nOverwriting elements in-place using "with" notation:
\n\n>>> import time\n>>>\n>>> with 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
\nReplacing several elements, then clearing them:
\n\n>>> placeholder = st.empty()\n>>>\n>>> # Replace the placeholder with some text:\n>>> placeholder.text("Hello")\n>>>\n>>> # Replace the text with a chart:\n>>> placeholder.line_chart({"data": [1, 5, 2, 6]})\n>>>\n>>> # Replace the chart with several elements:\n>>> with placeholder.container():\n... st.write("This is one element")\n... st.write("This is another")\n...\n>>> # Clear all those elements:\n>>> placeholder.empty()\n
\n
\n",
+ "description": "Insert a single-element container.",
+ "args": []
+ },
+ "DeltaGenerator.error": {
+ "name": "error",
+ "signature": "element.error(self, body)",
+ "example": "\n\n>>> st.error('This is an error')\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
+ }
+ ]
+ },
+ "DeltaGenerator.exception": {
+ "name": "exception",
+ "signature": "element.exception(self, exception)",
+ "example": "\n\n>>> e = RuntimeError('This is an exception of type RuntimeError')\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.expander": {
+ "name": "expander",
+ "signature": "element.expander(self, label, expanded=False)",
+ "examples": "\n\n>>> st.line_chart({"data": [1, 5, 2, 6, 2, 1]})\n>>>\n>>> with 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
\n",
+ "description": "Insert a multi-element container that can be expanded/collapsed.",
+ "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"
+ }
+ ]
+ },
+ "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)",
+ "examples": "\nInsert a file uploader that accepts a single file at a time:
\n\n>>> uploaded_file = st.file_uploader("Choose a file")\n>>> if 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
\nInsert a file uploader that accepts multiple files at a time:
\n\n>>> uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)\n>>> for 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",
+ "description": "Display a file uploader widget.",
+ "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",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.form": {
+ "name": "form",
+ "signature": "element.form(self, key, clear_on_submit=False)",
+ "examples": "\nInserting elements using "with" notation:
\n\n>>> with 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...\n>>> st.write("Outside the form")\n
\nInserting elements out of order:
\n\n>>> form = st.form("my_form")\n>>> form.slider("Inside the form")\n>>> st.slider("Outside the form")\n>>>\n>>> # Now add a submit button to the form:\n>>> form.form_submit_button("Submit")\n
\n
\n",
+ "description": "Create a form that batches elements together with a \"Submit\" button.",
+ "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"
+ }
+ ]
+ },
+ "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.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.graphviz_chart": {
+ "name": "graphviz_chart",
+ "signature": "element.graphviz_chart(self, figure_or_dot, use_container_width=False)",
+ "example": "\n\n>>> import streamlit as st\n>>> import graphviz as graphviz\n>>>\n>>> # Create a graphlib graph object\n>>> graph = graphviz.Digraph()\n>>> graph.edge('run', 'intr')\n>>> graph.edge('intr', 'runbl')\n>>> graph.edge('runbl', 'run')\n>>> graph.edge('run', 'kernel')\n>>> graph.edge('kernel', 'zombie')\n>>> graph.edge('kernel', 'sleep')\n>>> graph.edge('kernel', 'runmem')\n>>> graph.edge('sleep', 'swap')\n>>> graph.edge('swap', 'runswap')\n>>> graph.edge('runswap', 'new')\n>>> graph.edge('runswap', 'runmem')\n>>> graph.edge('new', 'runmem')\n>>> graph.edge('sleep', 'runmem')\n>>>\n>>> st.graphviz_chart(graph)\n
\nOr you can render the chart from the graph using GraphViz's Dot\nlanguage:
\n\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.header": {
+ "name": "header",
+ "signature": "element.header(self, body, anchor=None)",
+ "example": "\n\n>>> st.header('This is a header')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "DeltaGenerator.help": {
+ "name": "help",
+ "signature": "element.help(self, obj)",
+ "example": "\nDon't remember how to initialize a dataframe? Try this:
\n\n>>> st.help(pandas.DataFrame)\n
\nWant to quickly check what datatype is output by a certain function?\nTry:
\n\n>>> x = my_poorly_documented_function()\n>>> st.help(x)\n
\n
\n",
+ "description": "Display object's doc string, nicely formatted.",
+ "args": [
+ {
+ "name": "obj",
+ "type_name": "Object",
+ "is_optional": false,
+ "description": "The object whose docstring should be displayed.
\n",
+ "default": null
+ }
+ ]
+ },
+ "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\n>>> from PIL import Image\n>>> image = Image.open('sunrise.jpg')\n>>>\n>>> st.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"
+ }
+ ]
+ },
+ "DeltaGenerator.info": {
+ "name": "info",
+ "signature": "element.info(self, body)",
+ "example": "\n\n>>> st.info('This is a purely informational message')\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
+ }
+ ]
+ },
+ "DeltaGenerator.is_negative": {
+ "name": "is_negative",
+ "signature": "element.is_negative(self, delta)"
+ },
+ "DeltaGenerator.json": {
+ "name": "json",
+ "signature": "element.json(self, body)",
+ "example": "\n\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.latex": {
+ "name": "latex",
+ "signature": "element.latex(self, body)",
+ "example": "\n\n>>> st.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 \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display mathematical expressions formatted as LaTeX.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.line_chart": {
+ "name": "line_chart",
+ "signature": "element.line_chart(self, data=None, width=0, height=0, use_container_width=True)",
+ "example": "\n\n>>> chart_data = pd.DataFrame(\n... np.random.randn(20, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> st.line_chart(chart_data)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a line chart.",
+ "args": [
+ {
+ "name": "data",
+ "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",
+ "default": null
+ },
+ {
+ "name": "width",
+ "type_name": "int",
+ "is_optional": false,
+ "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.
\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.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.map": {
+ "name": "map",
+ "signature": "element.map(self, data=None, zoom=None, use_container_width=True)",
+ "example": "\n\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.map(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a map with points on it.",
+ "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
+ }
+ ]
+ },
+ "DeltaGenerator.markdown": {
+ "name": "markdown",
+ "signature": "element.markdown(self, body, unsafe_allow_html=False)",
+ "example": "\n\n>>> st.markdown('Streamlit is **_really_ cool**.')\n
\n\n \n \n (view standalone Streamlit app)\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.
\nThis also supports:
\n\n- Emoji shortcodes, such as :+1: and :sunglasses:.\nFor a list of all supported codes,\nsee https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
\n- LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.
\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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may\nbe removed from Streamlit at any time.
\nIf you decide to turn on HTML anyway, we ask you to please tell us\nyour exact use case here:
\nhttps://discuss.streamlit.io/t/96
\nThis will help us come up with safe APIs that allow you to do what\nyou want.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.metric": {
+ "name": "metric",
+ "signature": "element.metric(self, label, value, delta=None, delta_color=\"normal\")",
+ "example": "\n\n>>> st.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\n>>> col1, col2, col3 = st.columns(3)\n>>> col1.metric("Temperature", "70 \u00b0F", "1.2 \u00b0F")\n>>> col2.metric("Wind", "9 mph", "-8%")\n>>> col3.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\n>>> st.metric(label="Gas price", value=4, delta=-0.5,\n... delta_color="inverse")\n>>>\n>>> st.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.",
+ "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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> options = st.multiselect(\n... 'What are your favorite colors',\n... ['Green', 'Yellow', 'Red', 'Blue'],\n... ['Yellow', 'Red'])\n>>>\n>>> st.write('You selected:', options)\n
\n\nNote
\nUser experience can be degraded for large lists of options (100+), as this widget\nis not designed to handle arbitrary text search efficiently. See this\nthread\non the Streamlit community forum for more information and\nGitHub issue #1059 for updates on the issue.
\n\n
\n",
+ "description": "Display a multiselect widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this select widget 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 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": "[str] or None",
+ "is_optional": false,
+ "description": "List of default values.
\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 selectbox.
\n",
+ "default": null
+ },
+ {
+ "name": "key",
+ "type_name": "str or int",
+ "is_optional": false,
+ "description": "An optional string or integer to use as the unique key for the widget.\nIf this is omitted, a key will be generated for the widget\nbased on its content. Multiple widgets of the same type may\nnot share 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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> number = st.number_input('Insert a number')\n>>> st.write('The current number is ', number)\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.
\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
+ }
+ ]
+ },
+ "DeltaGenerator.parse_delta": {
+ "name": "parse_delta",
+ "signature": "element.parse_delta(self, delta)"
+ },
+ "DeltaGenerator.parse_label": {
+ "name": "parse_label",
+ "signature": "element.parse_label(self, label)"
+ },
+ "DeltaGenerator.parse_value": {
+ "name": "parse_value",
+ "signature": "element.parse_value(self, value)"
+ },
+ "DeltaGenerator.plotly_chart": {
+ "name": "plotly_chart",
+ "signature": "element.plotly_chart(self, figure_or_data, use_container_width=False, sharing=\"streamlit\", **kwargs)",
+ "example": "\nThe example below comes straight from the examples at\nhttps://plot.ly/python:
\n\n>>> import streamlit as st\n>>> import plotly.figure_factory as ff\n>>> import numpy as np\n>>>\n>>> # Add histogram data\n>>> x1 = np.random.randn(200) - 2\n>>> x2 = np.random.randn(200)\n>>> x3 = np.random.randn(200) + 2\n>>>\n>>> # Group data together\n>>> hist_data = [x1, x2, x3]\n>>>\n>>> group_labels = ['Group 1', 'Group 2', 'Group 3']\n>>>\n>>> # Create distplot with custom bin_size\n>>> fig = ff.create_distplot(\n... hist_data, group_labels, bin_size=[.1, .25, .5])\n>>>\n>>> # Plot!\n>>> st.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.",
+ "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
\nSee 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://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
+ },
+ {
+ "name": "To show Plotly charts in Streamlit, call `st.plotly_chart`",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ },
+ {
+ "name": "wherever you would call Plotly's `py.plot` or `py.iplot`.",
+ "type_name": null,
+ "is_optional": null,
+ "description": "",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.progress": {
+ "name": "progress",
+ "signature": "element.progress(self, value)",
+ "example": "\nHere is an example of a progress bar increasing over time:
\n\n>>> import time\n>>>\n>>> my_bar = st.progress(0)\n>>>\n>>> for 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
\n0.0 <= value <= 1.0 for float
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.pydeck_chart": {
+ "name": "pydeck_chart",
+ "signature": "element.pydeck_chart(self, pydeck_obj=None, use_container_width=False)",
+ "example": "\nHere's a chart using a HexagonLayer and a ScatterplotLayer on top of\nthe light map style:
\n\n>>> df = pd.DataFrame(\n... np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n... columns=['lat', 'lon'])\n>>>\n>>> st.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.",
+ "args": [
+ {
+ "name": "spec",
+ "type_name": "pydeck.Deck or None",
+ "is_optional": false,
+ "description": "Object specifying the PyDeck chart to draw.
\n",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.pyplot": {
+ "name": "pyplot",
+ "signature": "element.pyplot(self, fig=None, clear_figure=None, **kwargs)",
+ "notes": "\n\nNote
\nDeprecation 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\nMatplotlib 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
\nFor more information, see https://matplotlib.org/faq/usage_faq.html.
\n
\n",
+ "example": "\n\n>>> import matplotlib.pyplot as plt\n>>> import numpy as np\n>>>\n>>> arr = np.random.normal(1, 1, size=100)\n>>> fig, ax = plt.subplots()\n>>> ax.hist(arr, bins=20)\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> genre = st.radio(\n... "What's your favorite movie genre",\n... ('Comedy', 'Drama', 'Documentary'))\n>>>\n>>> if genre == 'Comedy':\n... st.write('You selected comedy.')\n... else:\n... st.write("You didn't select comedy.")\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.
\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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n>>> color = st.select_slider(\n... 'Select a color of the rainbow',\n... options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])\n>>> st.write('My favorite color is', color)\n
\nAnd here's an example of a range select slider:
\n\n>>> start_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'))\n>>> st.write('You selected wavelengths between', start_color, 'and', end_color)\n
\n",
+ "description": "Display a slider widget to select items from a list.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "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": "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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> option = st.selectbox(\n... 'How would you like to be contacted?',\n... ('Email', 'Home phone', 'Mobile phone'))\n>>>\n>>> st.write('You selected:', option)\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.
\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
+ }
+ ]
+ },
+ "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)",
+ "examples": "\n\n>>> age = st.slider('How old are you?', 0, 130, 25)\n>>> st.write("I'm ", age, 'years old')\n
\nAnd here's an example of a range slider:
\n\n>>> values = st.slider(\n... 'Select a range of values',\n... 0.0, 100.0, (25.0, 75.0))\n>>> st.write('Values:', values)\n
\nThis is a range time slider:
\n\n>>> from datetime import time\n>>> appointment = st.slider(\n... "Schedule your appointment:",\n... value=(time(11, 30), time(12, 45)))\n>>> st.write("You're scheduled for:", appointment)\n
\nFinally, a datetime slider:
\n\n>>> from datetime import datetime\n>>> start_time = st.slider(\n... "When do you start?",\n... value=datetime(2020, 1, 1, 9, 30),\n... format="MM/DD/YY - hh:mm")\n>>> st.write("Start time:", start_time)\n
\n
\n",
+ "description": "Display a slider widget.",
+ "args": [
+ {
+ "name": "label",
+ "type_name": "str",
+ "is_optional": false,
+ "description": "A short label explaining to the user what this slider is for.
\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
+ }
+ ]
+ },
+ "DeltaGenerator.subheader": {
+ "name": "subheader",
+ "signature": "element.subheader(self, body, anchor=None)",
+ "example": "\n\n>>> st.subheader('This is a subheader')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "DeltaGenerator.success": {
+ "name": "success",
+ "signature": "element.success(self, body)",
+ "example": "\n\n>>> st.success('This is a success message!')\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
+ }
+ ]
+ },
+ "DeltaGenerator.table": {
+ "name": "table",
+ "signature": "element.table(self, data=None)",
+ "example": "\n\n>>> df = pd.DataFrame(\n... np.random.randn(10, 5),\n... columns=('col %d' % i for i in range(5)))\n...\n>>> st.table(df)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display a static table.",
+ "args": [
+ {
+ "name": "data",
+ "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",
+ "default": null
+ }
+ ]
+ },
+ "DeltaGenerator.text": {
+ "name": "text",
+ "signature": "element.text(self, body)",
+ "example": "\n\n>>> st.text('This is some text.')\n
\n\n \n \n (view standalone Streamlit app)\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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> txt = 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... ''')\n>>> st.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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> title = st.text_input('Movie title', 'Life of Brian')\n>>> st.write('The current movie title is', title)\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.
\n",
+ "default": null
+ },
+ {
+ "name": "value",
+ "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
+ },
+ {
+ "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
+ }
+ ]
+ },
+ "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)",
+ "example": "\n\n>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n>>> st.write('Alarm is set for', t)\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.
\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
+ }
+ ]
+ },
+ "DeltaGenerator.title": {
+ "name": "title",
+ "signature": "element.title(self, body, anchor=None)",
+ "example": "\n\n>>> st.title('This is a title')\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Display text in title 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
+ }
+ ]
+ },
+ "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\n>>> import pandas as pd\n>>> import numpy as np\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n>>>\n>>> st.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
+ }
+ ]
+ },
+ "DeltaGenerator.video": {
+ "name": "video",
+ "signature": "element.video(self, data, format=\"video/mp4\", start_time=0)",
+ "example": "\n\n>>> video_file = open('myvideo.mp4', 'rb')\n>>> video_bytes = video_file.read()\n>>>\n>>> st.video(video_bytes)\n
\n\n \n \n (view standalone Streamlit app)\n \n \nNote
\nSome 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
+ }
+ ]
+ },
+ "DeltaGenerator.warning": {
+ "name": "warning",
+ "signature": "element.warning(self, body)",
+ "example": "\n\n>>> st.warning('This is a warning')\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
+ }
+ ]
+ },
+ "DeltaGenerator.write": {
+ "name": "write",
+ "signature": "element.write(self, *args, **kwargs)",
+ "example": "\nIts basic use case is to draw Markdown-formatted text, whenever the\ninput is a string:
\n\n>>> 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\n>>> st.write(1234)\n>>> st.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\n>>> st.write('1 + 1 = ', 2)\n>>> st.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\n>>> import pandas as pd\n>>> import numpy as np\n>>> import altair as alt\n>>>\n>>> df = pd.DataFrame(\n... np.random.randn(200, 3),\n... columns=['a', 'b', 'c'])\n...\n>>> c = alt.Chart(df).mark_circle().encode(\n... x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])\n>>>\n>>> st.write(c)\n
\n\n \n \n (view standalone Streamlit app)\n \n
\n",
+ "description": "Write arguments to the app.",
+ "args": [
+ {
+ "name": "*args",
+ "type_name": "any",
+ "is_optional": false,
+ "description": "One or many objects to print to the App.
\nArguments 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.
\nBy 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.
\nThat 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:
\nhttps://github.com/streamlit/streamlit/issues/152
\nAlso note that `unsafe_allow_html` is a temporary measure and may be\nremoved from Streamlit at any time.
\nIf 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 .
\nThis will help us come up with safe APIs that allow you to do what you\nwant.
\n",
+ "default": "False."
+ }
+ ]
+ }
+ }
+}
diff --git a/scripts/build-search-index.js b/scripts/build-search-index.js
index c4d11eabe..022daf4fc 100644
--- a/scripts/build-search-index.js
+++ b/scripts/build-search-index.js
@@ -1,156 +1,174 @@
-const dotenv = require("dotenv")
-const fs = require("fs")
-const path = require("path")
-const utils = require('../lib/utils.cjs')
-const contentDirectory = path.join( process.cwd(), '.next/server/pages' )
-const parser = require( 'node-html-parser' )
-const algoliasearch = require( 'algoliasearch' )
-const { convert } = require('html-to-text');
+const dotenv = require("dotenv");
+const fs = require("fs");
+const path = require("path");
+const utils = require("../lib/utils.cjs");
+const contentDirectory = path.join(process.cwd(), ".next/server/pages");
+const parser = require("node-html-parser");
+const algoliasearch = require("algoliasearch");
+const { convert } = require("html-to-text");
-const SKIP_THESE = ['/menu', '/404', '/500']
+const SKIP_THESE = ["/menu", "/404", "/500"];
function getAllFilesInDirectory(articleDirectory, files) {
- files = files ? files : []
- fs.readdirSync(articleDirectory).forEach(function(file){
- const subpath = path.join(articleDirectory, file)
- if ( fs.lstatSync(subpath).isDirectory() ) {
- getAllFilesInDirectory(subpath, files)
- } else {
- files.push(subpath)
- }
- })
- return files;
+ files = files ? files : [];
+ fs.readdirSync(articleDirectory).forEach(function (file) {
+ const subpath = path.join(articleDirectory, file);
+ if (fs.lstatSync(subpath).isDirectory()) {
+ getAllFilesInDirectory(subpath, files);
+ } else {
+ files.push(subpath);
+ }
+ });
+ return files;
}
-(async function() {
-
- dotenv.config()
-
- console.log("Updating search index through Alogolia...");
-
- // Let's check that we have a .next folder and then parse through the HTML files.
- const pages = []
- const data = {}
- const to_index = []
- let menu
-
- files = getAllFilesInDirectory(contentDirectory)
-
- for ( const index in files ) {
- if (files[index].endsWith('.html')) {
- pages.push(files[index])
- }
- if (files[index].endsWith('.json')) {
- const url = files[index].split(contentDirectory)[1].split('.json')[0]
- data[url] = files[index]
- }
- }
+(async function () {
+ dotenv.config();
- console.log(`... found ${pages.length} pages to index.`);
-
- for ( const index in pages ) {
- let icon
- let category
- let breadCrumbs
- // Parse each HTML file and get the content we need
- const contents = fs.readFileSync(pages[index], 'utf8')
- const url = pages[index].split(contentDirectory)[1].split('.html')[0]
-
- if (url in data) {
- meta = JSON.parse(fs.readFileSync(data[url], 'utf8'))
- if ('menu' in meta.pageProps) {
- menu = meta.pageProps.menu
- breadCrumbs = utils.breadcrumbsForSlug(menu, url)
- if (breadCrumbs.length > 0) {
- category = breadCrumbs[0].name
- icon = (breadCrumbs[0].icon) ? breadCrumbs[0].icon : 'text_snippet'
- }
- }
- }
+ console.log("Updating search index through Alogolia...");
- if (SKIP_THESE.includes(url)) {
- console.warn(`!!! Skipping ${url} because you told me to.`)
- continue
- }
-
- const root = parser.parse(contents)
- const doc_title = root.querySelector('title')
-
- // Clean up some tags we don't want, like:
- // *