H1

Get started

H2

Create your first Streamlit app

H3

Article H3

H4

Article H4

H5

Article H5

H6

Article H6

.large P

The easiest way to learn how to use Streamlit is to try things out yourself. As you read through this guide, test each method.

P

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.

.small P

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.

Ordered List - Plain

  1. Create a new Python file named first_app.py, then open it with your IDE or text editor.
  2. Next, import Streamlit.

Ordered List - Tutorial

  1. The first step is to create a new Python script. Let’s call it uber_pickups.py.
  2. Open uber_pickups.py in your favorite IDE or text editor, then add these lines:

Unordered List

  • Check out our community forum and post a question
  • Quick help from command line with $ streamlit --help
  • Read more documentation! Check out:

Code snippet

import streamlit as st
                        # To make things easier later, we're also importing numpy and pandas for
                        # working with sample data.
myscript.sh
ls -l myscript.sh

Code header

streamlit.text

Quick Link

Article H2

Note Block

push_pin

Note

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.

Note Block (with code embed option)

star

Tip

Did you know you can also pass a URL to streamlit run? This is great when combined with Github Gists. For example:

$ streamlit run
https://raw.githubusercontent.com/streamlit/demo-uber-nyc-pickups/master/streamlit_app.py

Note Block (Important)

priority_high

Important

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.

YouTube Embed

Caption can go here if necessary

Image

Streamlit's email highlighted on their GitHub profile

Caption can go within the frame if necessary

Streamlit's 'your apps' page highlighting the 'Edit secerets' link

Caption can go within the frame if necessary

1, 2 or 3-Up Tiles

Expanded ToC

Comming back to work on this.

Condensed ToC

Comming back to work on this.

Scroll Tracker Page Navigation

Comming back to work on this.

Styled Table

Function signature

streamlit.text(body)

Parameters

body (str)

The string to display

body (str)

The string to display

Function signature

streamlit.markdown(body, unsafe_allow_html=False)

Parameters

body (str)

The string to display

body (str)

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

This also supports:

Code Highlights

import streamlit as st
import pandas as pd
import numpy as np

st.title('Uber pickups in NYC')

DATE_COLUMN = 'date/time'
DATA_URL = ('https://s3-us-west-2.amazonaws.com/'
            'streamlit-demo-data/uber-raw-data-sep14.csv.gz')

@st.cache
def load_data(nrows):
    data = pd.read_csv(DATA_URL, nrows=nrows)
    lowercase = lambda x: str(x).lower()
    data.rename(lowercase, axis='columns', inplace=True)
    data[DATE_COLUMN] = pd.to_datetime(data[DATE_COLUMN])
    return data

data_load_state = st.text('Loading data...')
data = load_data(10000)
data_load_state.text("Done! (using st.cache)")

Show Component Alongside Code

chart_data = pd.DataFrame(
    p.random.randn(20, 3),
    columns=['a', 'b', 'c']
)

st.altair_chart(chart_data)

Was This Page Helpful Widget

Was this page helpful?

editSuggest edits

News entry

Title

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Eleifend a facilisis sagittis, vitae nibh massa in facilisis et. Pretium eget non cursus purus tempus porta sodales.

Title

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Eleifend a facilisis sagittis, vitae nibh massa in facilisis et. Pretium eget non cursus purus tempus porta sodales.

Forum PSA

forum

Still have questions?

Our forums are full of helpful information and Streamlit experts.

Note split

Join the community

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. Please come join us on the community forum. We love to hear your questions, ideas, and help you work through your bugs — stop by today!

Inline callout

school

Tutorials include our Get Started guide and a few step-by-step examples to building different types of apps in Streamlit.

school

Tutorials include our Get Started guide and a few step-by-step examples to building different types of apps in Streamlit.