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.
Inside Link
Check out our community forum and post a question
Ordered List - Plain
- Create a new Python file named first_app.py, then open it with your IDE or text editor.
- Next, import Streamlit.
Ordered List - Tutorial
- 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:
Unordered List
- 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
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
Arrow Links
Note Block
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)
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)
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
Caption can go within the frame if necessary
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.cacache_datache
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_data)")
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
Featured update
News entry
Forum PSA
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!
View fourmInline callout
Tutorials include our Get Started guide and a few step-by-step examples to building different types of apps in Streamlit.
Tutorials include our Get Started guide and a few step-by-step examples to building different types of apps in Streamlit.