This repository was archived by the owner on Mar 22, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathdriver.py
49 lines (42 loc) · 2.8 KB
/
driver.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import gradio as gr
import sys
# The following sys.path.append() calls are for internal modules in the respective directories under the project root
# - For Windows developers, if any issues, simply set the absolute path.
# e.g. sys.path.append("C:\\Users\\<uservname>\\PycharmProjects\\Fin-Maestro\Valuations")
# - For Linux developers, no issues should be encountered.
sys.path.append("Valuations")
sys.path.append("SWOT")
sys.path.append("SignalsGenerator")
from valuation_determiner import *
from swot_generator import *
from positional_signals import *
def execute_driver():
with gr.Blocks(title="Fin-Maestro",css="#heading{background-color:#32a8a8}") as merged_entity:
gr.Label(elem_id="heading",value="Fin-Maestro",label="Title")
with gr.Tab("Valuation Determiner"):
ticker = gr.Textbox(label="Stock Symbol",placeholder="Enter stock symbol instead of full name. Example: BSE.NS for NSE listed stock or SAHYADRI.BO for BSE listed stock.")
text_button_val = gr.Button("Fetch Valuation",elem_id="fetch_valuation")
vap_bv = gr.Number(label="Valuation as per book value")
vap_sales = gr.Number(label="Valuation as per sales")
vap_graham=gr.Number(label="Valuationas per Graham")
vap_earnings = gr.Number(label="Valuation as per earnings")
ltp = gr.Number(label="Last Traded Price")
fair_value=gr.Number(label="Average fair value")
status = gr.Textbox(label="Status")
with gr.Tab("Signal Generator"):
text_input = gr.Textbox(label="Stock Symbol",placeholder="Enter stock symbol instead of full name. Example: BSE.NS for NSE listed stock or SAHYADRI.BO for BSE listed stock.")
no_of_signals=gr.Slider(label="Number of Signals",value=10)
text_button_sig = gr.Button("Generate Signals",elem_id="generate_sigals")
plot_output=gr.Plot(label="forecast")
with gr.Tab("SWOT Analyzer"):
ticker_name = gr.Textbox(label="Stock Symbol",placeholder="Enter stock symbol instead of full name. Example: BSE.NS for NSE listed stock or SAHYADRI.BO for BSE listed stock.")
text_button_swot = gr.Button("View SWOT",elem_id="swot")
strength=gr.Textbox(label="Strength")
weakness=gr.Textbox(label="Weakness")
opportunity=gr.Textbox(label="Opportunity")
threat=gr.Textbox(label="Threat")
text_button_val.click(valuation_determiner_gradio, inputs=[ticker], outputs=[vap_bv,vap_sales,vap_graham,vap_earnings,ltp,fair_value,status])
text_button_sig.click(signals_generator, inputs=[text_input,no_of_signals], outputs=plot_output)
text_button_swot.click(swot_producer_gradio, inputs=[ticker_name], outputs=[strength,weakness,opportunity,threat])
merged_entity.launch()
execute_driver()