https://github.com/cheatsheet-lang/streamlit
Cheatsheet for getting started with streamlit framework
https://github.com/cheatsheet-lang/streamlit
cheatsheet hacktoberfest hacktoberfest2020 streamlit
Last synced: 2 months ago
JSON representation
Cheatsheet for getting started with streamlit framework
- Host: GitHub
- URL: https://github.com/cheatsheet-lang/streamlit
- Owner: Cheatsheet-lang
- License: mit
- Created: 2020-06-30T13:55:49.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-10-16T05:58:51.000Z (over 4 years ago)
- Last Synced: 2025-02-22T13:55:08.852Z (over 1 year ago)
- Topics: cheatsheet, hacktoberfest, hacktoberfest2020, streamlit
- Language: Python
- Homepage:
- Size: 11.7 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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.
```shell
$ sudo pip3 install -r requirements.txt
```
```shell
$ streamlit run app.py
```
## Getting Started
```python3
# The well known alias
import streamlit as st
```
### altair_chart
```python3
# c is the altair chart object
st.altair_chart(c, use_container_width=True)
```
### area_chart
```python3
# chart_data is a pd.DataFrame object
st.area_chart(chart_data)
```
### audio
```python3
# audio_bytes is a BytesIO object
st.audio(audio_bytes, format='audio/ogg')
```
### checkbox
```python3
# data is a pd.DataFrame object
show_data = st.checkbox('Show Raw Data')
if show_data:
st.write(data)
```
### selectbox
```python3
option = st.selectbox('Which Language do you know?', ('C', 'Python', 'Java'))
st.write('You Know:', option)
```
### text
```python3
# To display text in it
st.text("This is simply a text")
```
### latex
```python3
# Render latex code on the dashboard
st.latex(r'''
E = MC^2
''')
```
### markdown
```python3
# Display markdown code
st.markdown("I have rendered **markdown code** in this")
```
### title
```python3
# Display the title(it is usually in bold and caps)
st.title('Display Title')
```
### header
```python3
# Header of any section(much less bold than title)
st.header('Section Header')
```
### subheader
```python3
# This is a subheader
st.subheader('My Subheader')
```