benjamin5607 commited on
Commit
5206114
Β·
verified Β·
1 Parent(s): 1e5dc37

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -0
app.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import yfinance as yf
3
+
4
+ st.set_page_config(page_title="Pocket Quant", page_icon="πŸ“ˆ")
5
+ st.title("πŸ€– AI 투자 μžλ¬Έκ°€ (Docker ver)")
6
+
7
+ ticker = st.text_input("μ’…λͺ© μ½”λ“œ (예: TSLA, 005930.KS)", "TSLA")
8
+
9
+ if st.button("뢄석 μ‹€ν–‰"):
10
+ try:
11
+ stock = yf.Ticker(ticker)
12
+ hist = stock.history(period="1mo")
13
+
14
+ if not hist.empty:
15
+ current = hist['Close'].iloc[-1]
16
+ st.metric("ν˜„μž¬ μ£Όκ°€", f"{current:,.0f}")
17
+ st.line_chart(hist['Close'])
18
+ else:
19
+ st.error("데이터 μ—†μŒ! 티컀 확인 λ°”λžŒ.")
20
+ except Exception as e:
21
+ st.error(f"μ—λŸ¬: {e}")