rwepa / teaching-streamlit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RWEPA | Python - streamlit

在 Python 環境中, Streamlit 模組提供資料分析的網頁服務框架,內建常用的網頁操作控制項,配合 pnadas 資料分析模組,matplotlib 等視覺化模組,可以快速建立互動式網頁服務與企業級儀表板,其功能與 R 語言的 shiny 套件相似。

streamlit: A faster way to build and share data apps

Cloud 佈署成果

https://rwepahello.streamlit.app/

佈署時, 須在 app.py 目錄中新增 requirements.txt, 該檔案記錄 app.py 所使用的模組名稱, 參考範例 [https://github.com/rwepa/teaching-streamlit/blob/main/hello_streamlit/requirements.txt]

Community Cloud(包括免費版本)

https://streamlit.io/cloud

Conda 安裝方法

conda install -c conda-forge streamlit

範例1: hello_streamlit

YouTube: https://youtu.be/FW-dl-flLvk

hello_streamlit 執行方式

考慮建立 D:\streamlitdata\hello_streamlit\app.py

命令提示字元輸入以下內容:

d:

cd streamlitdata\hello_streamlit

streamlit run app.py

image

執行成果

執行後將自動開啟瀏覽器或於瀏覽器輸入 http://localhost:8501/

image

Python程式碼

https://github.com/rwepa/teaching-streamlit/tree/main/hello_streamlit

參考資料

  1. Streamlit 官網: https://streamlit.io/
  2. shiny for Python (Python 使用 shiny 模組教學): http://rwepa.blogspot.com/2022/10/shiny-for-python.html
  3. shiny package 網路應用: http://rwepa.blogspot.com/2013/01/shiny-package.html

About


Languages

Language:Python 100.0%