Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,6 +13,12 @@ from tensorflow.keras.layers import LSTM
|
|
| 13 |
import yfinance as yf
|
| 14 |
from statsmodels.tsa.seasonal import seasonal_decompose
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
def get_ans(inp):
|
| 17 |
plt.close()
|
| 18 |
tickers = yf.Tickers(inp)
|
|
@@ -166,10 +172,6 @@ def get_info(inp):
|
|
| 166 |
return long_info, curr_rat, quick_rat, short_rat, debt_eq, volume, market_cap, curr_price, rev_per
|
| 167 |
|
| 168 |
with gr.Blocks() as demo:
|
| 169 |
-
|
| 170 |
-
demo.load(get_ans, inputs="GOOG", outputs= [mp,mp1,mp2,mp3, Max_all, Min_all,Max_year, Min_year, Max_rec, Min_rec, Next_day, Next_plot, Next_plot_all, Next_plot_year], _js=on_load)
|
| 171 |
-
demo.load(get_info, inputs="GOOG", outputs=[info1, ratio1, ratio2, ratio3, ratio4, vol, mar_cap, curr_price, rev_per], _js=on_load)
|
| 172 |
-
demo.load(get_seo, inputs="GOOG", outputs=[trend_g, Seaso, resid], _js=on_load)
|
| 173 |
|
| 174 |
with gr.Row().style(equal_height=True):
|
| 175 |
with gr.Column():
|
|
@@ -178,7 +180,7 @@ with gr.Blocks() as demo:
|
|
| 178 |
gr.Markdown("<center>To get the ticker of the company, click <a href = 'https://finance.yahoo.com/lookup/'>here.</a></center>")
|
| 179 |
with gr.Row():
|
| 180 |
with gr.Column():
|
| 181 |
-
Name_of_the_company =
|
| 182 |
btn = gr.Button("ANALYSE")
|
| 183 |
gr.Markdown("<center><h2>Analysis<h2></center>")
|
| 184 |
gr.Markdown("<center><h3>Inportant Information</h3></center>")
|
|
@@ -230,6 +232,10 @@ with gr.Blocks() as demo:
|
|
| 230 |
Next_plot_all = gr.LinePlot(visible=False)
|
| 231 |
Next_plot_year = gr.LinePlot(visible=False)
|
| 232 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 233 |
btn.click(get_ans, inputs=Name_of_the_company, outputs= [mp,mp1,mp2,mp3, Max_all, Min_all,Max_year, Min_year, Max_rec, Min_rec, Next_day, Next_plot, Next_plot_all, Next_plot_year])
|
| 234 |
btn.click(get_info, inputs=Name_of_the_company, outputs=[info1, ratio1, ratio2, ratio3, ratio4, vol, mar_cap, curr_price, rev_per])
|
| 235 |
btn.click(get_seo, inputs=Name_of_the_company, outputs=[trend_g, Seaso, resid])
|
|
|
|
| 13 |
import yfinance as yf
|
| 14 |
from statsmodels.tsa.seasonal import seasonal_decompose
|
| 15 |
|
| 16 |
+
on_load="""
|
| 17 |
+
async()=>{
|
| 18 |
+
console.log("HELLO");
|
| 19 |
+
}
|
| 20 |
+
"""
|
| 21 |
+
|
| 22 |
def get_ans(inp):
|
| 23 |
plt.close()
|
| 24 |
tickers = yf.Tickers(inp)
|
|
|
|
| 172 |
return long_info, curr_rat, quick_rat, short_rat, debt_eq, volume, market_cap, curr_price, rev_per
|
| 173 |
|
| 174 |
with gr.Blocks() as demo:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 175 |
|
| 176 |
with gr.Row().style(equal_height=True):
|
| 177 |
with gr.Column():
|
|
|
|
| 180 |
gr.Markdown("<center>To get the ticker of the company, click <a href = 'https://finance.yahoo.com/lookup/'>here.</a></center>")
|
| 181 |
with gr.Row():
|
| 182 |
with gr.Column():
|
| 183 |
+
Name_of_the_company = "GOOG"
|
| 184 |
btn = gr.Button("ANALYSE")
|
| 185 |
gr.Markdown("<center><h2>Analysis<h2></center>")
|
| 186 |
gr.Markdown("<center><h3>Inportant Information</h3></center>")
|
|
|
|
| 232 |
Next_plot_all = gr.LinePlot(visible=False)
|
| 233 |
Next_plot_year = gr.LinePlot(visible=False)
|
| 234 |
|
| 235 |
+
demo.load(get_ans, Name_of_the_company=Name_of_the_company, outputs= [mp,mp1,mp2,mp3, Max_all, Min_all,Max_year, Min_year, Max_rec, Min_rec, Next_day, Next_plot, Next_plot_all, Next_plot_year], _js=on_load)
|
| 236 |
+
demo.load(get_info, inputs=Name_of_the_company, outputs=[info1, ratio1, ratio2, ratio3, ratio4, vol, mar_cap, curr_price, rev_per], _js=on_load)
|
| 237 |
+
demo.load(get_seo, inputs=Name_of_the_company, outputs=[trend_g, Seaso, resid], _js=on_load)
|
| 238 |
+
|
| 239 |
btn.click(get_ans, inputs=Name_of_the_company, outputs= [mp,mp1,mp2,mp3, Max_all, Min_all,Max_year, Min_year, Max_rec, Min_rec, Next_day, Next_plot, Next_plot_all, Next_plot_year])
|
| 240 |
btn.click(get_info, inputs=Name_of_the_company, outputs=[info1, ratio1, ratio2, ratio3, ratio4, vol, mar_cap, curr_price, rev_per])
|
| 241 |
btn.click(get_seo, inputs=Name_of_the_company, outputs=[trend_g, Seaso, resid])
|