超簡単PythonでWebアプリケーション作成(Streamlit 利用)&デプロイ(Streamlit Cloud利用)
PythonでStreamlitを利用して超簡単にWebアプリケーション作成&Streamlit Cloudへデプロイ
1. GitHubアカウント作成
2. Streamlit Cloudアカウント作成(GitHubアカウント利用)
3. GitHubにリポジトリ作成
4. ツールインストール
$ pip install streamlit yfinance
5. ファイル作成
app.py
import streamlit as st
import yfinance as yf
st.write("""
# My first app
Hello *world!*
""")
df = yf.download("AAPL", start="2010-11-01", end="2020-11-01")
st.line_chart(df)
6. ローカル実行
$ streamlit run app.py
7. 作成ファイルをGitHubリポジトリにアップロード
$ git init
$ git add .
$ git commit -m "first commit"
$ git branch -M main
$ git remote add origin https://github.com/<User>/streamlit-python.git
$ git push -u origin main
8. Streamlit CloudにWebアプリケーションをデプロイ
GitHubリポジトリを選択してデプロイ
以上、超簡単!
9. 参考
この記事が気に入ったらサポートをしてみませんか?