-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
28 lines (24 loc) Β· 1.07 KB
/
main.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
import streamlit as st
import yfinance as yf
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go
import time
from datetime import date
from src.fundamental_score import calculate_fundamental_score
from src.scores import calculate_stock_score
from src.get_data_for_scoring_yfinance import get_data
st.sidebar.title("Navigation")
menu_option = st.sidebar.selectbox("Select a section", ['Stock Score'])
if menu_option == 'Stock Score':
st.title("Stock Score")
query = st.text_input('Enter Stock Symbol')
fundamental_details = calculate_fundamental_score(ticker=query)
st.write(f'Fundamental Details of Stock: {query}')
st.write(fundamental_details)
metrics = get_data(stock_symbol=query+'.NS')
score = calculate_stock_score(metrics=metrics)
text = f"Overall score of {query} is: {round(score, 2)}"
st.header(f'{text}')
st.write(f' NOTE: A score greater than or equal to 0.5 indicates a favorable buying opportunity π')
st.write(f' NOTE: A score less than 0.5 indicates a favorable selling opportunity π')