Skip to content

Latest commit

 

History

History
103 lines (74 loc) · 1.56 KB

README.md

File metadata and controls

103 lines (74 loc) · 1.56 KB

Streamlit Cheatsheet

Streamlit is a Web Framework which is build for Data Scientist to readily convert their projects/analysis into a web application.

Installation

To install streamlit run the following command at the prompt, after cloning this repo.

$ sudo pip3 install -r requirements.txt
$ streamlit run app.py

Getting Started

# The well known alias

import streamlit as st

altair_chart

# c is the altair chart object

st.altair_chart(c, use_container_width=True)

area_chart

# chart_data is a pd.DataFrame object

st.area_chart(chart_data)

audio

# audio_bytes is a BytesIO object

st.audio(audio_bytes, format='audio/ogg')

checkbox

# data is a pd.DataFrame object

show_data = st.checkbox('Show Raw Data')

if show_data:
    st.write(data)

selectbox

option = st.selectbox('Which Language do you know?', ('C', 'Python', 'Java'))

st.write('You Know:', option)

text

# To display text in it

st.text("This is simply a text")

latex

# Render latex code on the dashboard

st.latex(r'''
E = MC^2
''')

markdown

# Display markdown code

st.markdown("I have rendered **markdown code** in this")

title

# Display the title(it is usually in bold and caps)

st.title('Display Title')

header

# Header of any section(much less bold than title)

st.header('Section Header')

subheader

# This is a subheader

st.subheader('My Subheader')