Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -107,6 +107,7 @@ download_button_FinViz = pn.widgets.FileDownload(
|
|
| 107 |
button_type='primary',
|
| 108 |
label='Download FinViz'
|
| 109 |
)
|
|
|
|
| 110 |
png_pane = pn.pane.GIF('https://tuozi.vip/shqu/wordpress/wp-content/themes/CorePress/static/img/loading.gif', width=200) #, height=150)
|
| 111 |
def get_DF(DF,ticker,SmartScore,GFValuepercent, FinVizTargetpercent, Sector,MarketCap):
|
| 112 |
if ticker and ticker!="ALL":
|
|
@@ -116,7 +117,17 @@ def get_DF(DF,ticker,SmartScore,GFValuepercent, FinVizTargetpercent, Sector,Mark
|
|
| 116 |
else:
|
| 117 |
return pn.widgets.Tabulator( DF.query("SmartScore>=@SmartScore[0] & SmartScore <= @SmartScore[1] & GFValuepercent>=@GFValuepercent & FinVizTargetpercent>@FinVizTargetpercent & Sector in @Sector & MarketCap>@MarketCap"), height=800, widths=200, show_index=False)
|
| 118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
pn.extension('tabulator')
|
| 120 |
bound_plot = pn.bind(get_DF, DF=DFmerge_tipranks_gurufocus,ticker=ticker,SmartScore=SmartScore,GFValuepercent=GFValuepercent, FinVizTargetpercent=FinVizTargetpercent, Sector=Sector ,MarketCap=MarketCap)
|
| 121 |
|
| 122 |
-
pn.Column(pn.Row(pn.Column(ticker,SmartScore,GFValuepercent, FinVizTargetpercent, MarketCap, Sector, download_button_GuruFocus,download_button_FinViz ,png_pane),bound_plot)).servable(title="Fair Value Ranking - Merged Gurufocus & Tipranks & FinViz & MorningStars")
|
|
|
|
| 107 |
button_type='primary',
|
| 108 |
label='Download FinViz'
|
| 109 |
)
|
| 110 |
+
|
| 111 |
png_pane = pn.pane.GIF('https://tuozi.vip/shqu/wordpress/wp-content/themes/CorePress/static/img/loading.gif', width=200) #, height=150)
|
| 112 |
def get_DF(DF,ticker,SmartScore,GFValuepercent, FinVizTargetpercent, Sector,MarketCap):
|
| 113 |
if ticker and ticker!="ALL":
|
|
|
|
| 117 |
else:
|
| 118 |
return pn.widgets.Tabulator( DF.query("SmartScore>=@SmartScore[0] & SmartScore <= @SmartScore[1] & GFValuepercent>=@GFValuepercent & FinVizTargetpercent>@FinVizTargetpercent & Sector in @Sector & MarketCap>@MarketCap"), height=800, widths=200, show_index=False)
|
| 119 |
|
| 120 |
+
def get_DF_filter(DF,ticker,SmartScore,GFValuepercent, FinVizTargetpercent, Sector,MarketCap):
|
| 121 |
+
return DF.query("SmartScore>=@SmartScore[0] & SmartScore <= @SmartScore[1] & GFValuepercent>=@GFValuepercent & FinVizTargetpercent>@FinVizTargetpercent & Sector in @Sector & MarketCap>@MarketCap")
|
| 122 |
+
|
| 123 |
+
download_button_Filter = pn.widgets.FileDownload(
|
| 124 |
+
filename=f'Filter_{current_datetime}.csv',
|
| 125 |
+
callback=pn.bind(get_csv,pn.bind(get_DF_filter, DF=DFmerge_tipranks_gurufocus,ticker=ticker,SmartScore=SmartScore,GFValuepercent=GFValuepercent, FinVizTargetpercent=FinVizTargetpercent, Sector=Sector ,MarketCap=MarketCap) ),
|
| 126 |
+
button_type='danger',
|
| 127 |
+
label='Download your Filter'
|
| 128 |
+
)
|
| 129 |
+
|
| 130 |
pn.extension('tabulator')
|
| 131 |
bound_plot = pn.bind(get_DF, DF=DFmerge_tipranks_gurufocus,ticker=ticker,SmartScore=SmartScore,GFValuepercent=GFValuepercent, FinVizTargetpercent=FinVizTargetpercent, Sector=Sector ,MarketCap=MarketCap)
|
| 132 |
|
| 133 |
+
pn.Column(pn.Row(pn.Column(ticker,SmartScore,GFValuepercent, FinVizTargetpercent, MarketCap, Sector, download_button_GuruFocus,download_button_FinViz ,download_button_FinViz, png_pane),bound_plot)).servable(title="Fair Value Ranking - Merged Gurufocus & Tipranks & FinViz & MorningStars")
|