Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Streamlitで簡単webGUI
Search
さらだ
June 06, 2021
Programming
0
55
Streamlitで簡単webGUI
Dentoo.LT #25
発表資料
さらだ
June 06, 2021
Tweet
Share
Other Decks in Programming
See All in Programming
高速開発のためのコード整理術
sutetotanuki
1
400
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
Oxlint JS plugins
kazupon
1
950
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
700
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
1.1k
CSC307 Lecture 07
javiergs
PRO
0
550
AIエージェント、”どう作るか”で差は出るか? / AI Agents: Does the "How" Make a Difference?
rkaga
4
2k
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
1k
CSC307 Lecture 03
javiergs
PRO
1
490
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
210
CSC307 Lecture 05
javiergs
PRO
0
500
Package Management Learnings from Homebrew
mikemcquaid
0
220
Featured
See All Featured
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
53
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
240
Mind Mapping
helmedeiros
PRO
0
81
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
170
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
75
Balancing Empowerment & Direction
lara
5
890
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1.1k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.2k
WENDY [Excerpt]
tessaabrams
9
36k
A better future with KSS
kneath
240
18k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
450
Transcript
Streamlitで簡単webGUI さらだ Dentoo.LT #25 1
自己紹介 • いわゆるI科のM1 • アイカツ!3rdシーズン視聴中 • 研究室大好き 2
突然ですが これらのロゴを見たことある・知っ てる人いますか? 正解です! 僕が挑戦しては挫折した WEBバックエンドフレームワークたちです 3
なんで挫折したの? • 課題やらで忙しくなった • なんか動かなくなって諦めた • 必要じゃなくなった 4
突然ですが(2) これらのロゴを見たことある・知っ てる人いますか? 正解です! 最も有名なWEBフロントエンドフレームワークたちです 5
フロントエンドもバックエンドも勉 強したくないけど、それっぽい WEBアプリを作りたいよ。。。。 そんなあなたにおススメなのが 6
Streamlitとは? 1. Pythonのライブラリ 2. 美しいWEBアプリケーション 3. 機械学習・データサイエンティスト 7
インストール pip install streamlit 普通にインストールします 8
これから説明すること 1. サンプルの実行 2. 文字列を表示 3. pandasのDataFrameを表示 4. Matplotlibのグラフを表示 5.
ドロップダウンリストの利用 6. チェックリストの利用 7. markdownによる文字列の表示 9
サンプルを実行 streamlit hello を実行して表示されたリンク をクリック! 10
文字列を表示 streamlit run sample00.py # sample00.py import streamlit as st
st.write("電!気!通!信!大!学!🤔🤔🤔") st.write("U!E!C!🖖🖖🖖") 11
12
pandasのDataFrameを表示 streamlit run sample01.py # sample01.py import streamlit as st
import pandas as pd df = pd.DataFrame([["UEC","電気通信大学"], ["MIT", "マサチューセッツ工科大学"]]) st.table(df) 13
14
これから説明すること 1. サンプルの実行 2. 文字列を表示 3. pandasのDataFrameを表示 4. Matplotlibのグラフを表示 5.
ドロップダウンリストの利用 6. チェックリストの利用 7. markdownによる文字列の表示 15
Matplotlibのグラフを表示 streamlit run sample02.py # sample02.py import streamlit as st
import matplotlib.pyplot as plt fig = plt.figure() plt.plot([1,2,3,4],[8,6,7,5]) st.pyplot(fig) 16
17
ドロップダウンリストの利用 streamlit run sample03.py # sample03.py import streamlit as st
option = st.selectbox("select your university", ["UEC", "電気通信大 学", "多摩のMIT"]) st.write(f"You selected: {option}") 18
19
チェックリストの利用 streamlit run sample04.py # sample04.py import streamlit as st
check1 = st.checkbox("選択肢1") check2 = st.checkbox("選択肢2") check3 = st.checkbox("選択肢3") if check1: st.write("you checked 1") if check2: st.write("you checked 2") if check3: st.write("you checked 3") 20
21
markdownによる文字列の表示 streamlit run sample05.py 22 # sample05.py import streamlit as
st ''' # これはH1タグです ###### これはH6タグです *イタリック体* **太字** ~~打ち消し~~ > 引用
23
他 • ダークモードにも標準で対応 • ログイン関連の処理・DBの操作関連の処理は実装されていない 24
まとめ • 表・グラフを簡単に表示できる • ドロップダウンリスト・チェックリストを簡単に利用できる • テキストにmarkdownを利用できる • ダークモードにも対応 •
ログイン関連・DB関連の処理は苦手 25
ご清聴ありがとうございました 今回使用したソースコードは https://github.com/arima0714/Dentoo.LT-25 に挙げてます なんか作りたいけど、道具を使えないせいで何も作れない人 が一人でも減ってほしいです。 26 該当コードへの QRコード