Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -152,8 +152,10 @@ def stock_research(symbol, assumed_eps=5.0, growth_rate=0.1, book_value=50000000
|
|
152 |
dividends = get_dividends(symbol)
|
153 |
dates, prices = get_historical_prices(symbol)
|
154 |
|
155 |
-
if not info
|
156 |
-
return "Error
|
|
|
|
|
157 |
|
158 |
ratios = calculate_ratios(info['Market Cap'], info['Total Revenue'], price, dividends['Dividend Amount'], assumed_eps, growth_rate, book_value)
|
159 |
summary = generate_summary(info, ratios)
|
|
|
152 |
dividends = get_dividends(symbol)
|
153 |
dates, prices = get_historical_prices(symbol)
|
154 |
|
155 |
+
if not info:
|
156 |
+
return "⚠️ Error: Could not fetch company information. Please check your API Key or ticker.", None, None, None, None, None
|
157 |
+
if not price:
|
158 |
+
return "⚠️ Error: Could not fetch current stock price. Please check your API Key or ticker.", None, None, None, None, None
|
159 |
|
160 |
ratios = calculate_ratios(info['Market Cap'], info['Total Revenue'], price, dividends['Dividend Amount'], assumed_eps, growth_rate, book_value)
|
161 |
summary = generate_summary(info, ratios)
|