CCockrum commited on
Commit
ceb643e
·
verified ·
1 Parent(s): fad7d76

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -15
app.py CHANGED
@@ -92,21 +92,22 @@ def stock_research(symbol, eps=5.0, growth=0.1, book=500000000):
92
  recommendation = "Sell"
93
 
94
  report = (
95
- f"Company Overview:\n"
96
- f"Name: {info['Name']}\n"
97
- f"Industry: {info['Industry']}\n"
98
- f"Sector: {info['Sector']}\n"
99
- f"Market Cap: ${info['Market Cap']:,.2f}\n\n"
100
- f"Financial Metrics:\n"
101
- f"P/E Ratio: {ratios['P/E Ratio']}\n"
102
- f"P/S Ratio: {ratios['P/S Ratio']}\n"
103
- f"P/B Ratio: {ratios['P/B Ratio']}\n"
104
- f"PEG Ratio: {ratios['PEG Ratio']}\n"
105
- f"Dividend Yield: {ratios['Dividend Yield']}%\n"
106
- f"Debt/Equity Ratio: {ratios['Debt/Equity Ratio']}\n"
107
- f"Return on Equity: {ratios['Return on Equity (%)']}%\n"
108
- f"Free Cash Flow: ${ratios['Free Cash Flow ($)']:,.2f}\n"
109
- f"Beta (Volatility): {ratios['Beta (Volatility)']}\n"
 
110
  )
111
 
112
  summary_prompt = f"Summarize this financial report clearly and briefly:\n\n{report}"
 
92
  recommendation = "Sell"
93
 
94
  report = (
95
+ f"Company Overview:\n"
96
+ f"Name: {info.get('Name', 'N/A')}\n"
97
+ f"Industry: {info.get('Industry', 'N/A')}\n"
98
+ f"Sector: {info.get('Sector', 'N/A')}\n"
99
+ f"Market Cap: ${info.get('Market Cap', 0):,.2f}\n\n"
100
+ f"Financial Metrics:\n"
101
+ f"P/E Ratio: {ratios.get('P/E Ratio', 'N/A')}\n"
102
+ f"P/S Ratio: {ratios.get('P/S Ratio', 'N/A')}\n"
103
+ f"P/B Ratio: {ratios.get('P/B Ratio', 'N/A')}\n"
104
+ f"PEG Ratio: {ratios.get('PEG Ratio', 'N/A')}\n"
105
+ f"Dividend Yield: {ratios.get('Dividend Yield', 'N/A')}%\n"
106
+ f"Debt/Equity Ratio: {ratios.get('Debt/Equity Ratio', 'N/A')}\n"
107
+ f"Return on Equity: {ratios.get('Return on Equity (%)', 'N/A')}%\n"
108
+ f"Free Cash Flow: ${ratios.get('Free Cash Flow ($)', 0):,.2f}\n"
109
+ f"Beta (Volatility): {ratios.get('Beta (Volatility)', 'N/A')}\n"
110
+
111
  )
112
 
113
  summary_prompt = f"Summarize this financial report clearly and briefly:\n\n{report}"