Spaces:
Sleeping
Sleeping
Bhanu Prasanna
commited on
Delete app.py
Browse files
app.py
DELETED
@@ -1,83 +0,0 @@
|
|
1 |
-
import pandas as pd
|
2 |
-
import numpy as np
|
3 |
-
import yfinance as yf
|
4 |
-
import streamlit as st
|
5 |
-
import plotly.graph_objects as go
|
6 |
-
import datetime
|
7 |
-
|
8 |
-
with open(r"style/style.css") as css:
|
9 |
-
st.markdown(f"<style>{css.read()}</style>", unsafe_allow_html=True)
|
10 |
-
|
11 |
-
st.markdown(
|
12 |
-
"<h1 style='text-align: center;'><u>CapiPort</u></h1>", unsafe_allow_html=True
|
13 |
-
)
|
14 |
-
|
15 |
-
st.markdown(
|
16 |
-
"<h5 style='text-align: center; color: gray;'>Your Portfolio Optimisation Tool</h5>",
|
17 |
-
unsafe_allow_html=True,
|
18 |
-
)
|
19 |
-
st.header(
|
20 |
-
"",
|
21 |
-
divider="rainbow",
|
22 |
-
)
|
23 |
-
|
24 |
-
color = "Quest"
|
25 |
-
st.markdown(
|
26 |
-
"<h1 style='text-align: center;'>🔍 Quest for financial excellence begins with meticulous portfolio optimization</u></h1>",
|
27 |
-
unsafe_allow_html=True,
|
28 |
-
)
|
29 |
-
|
30 |
-
st.header(
|
31 |
-
"",
|
32 |
-
divider="rainbow",
|
33 |
-
)
|
34 |
-
|
35 |
-
list_df = pd.read_csv("Data/Company List.csv")
|
36 |
-
|
37 |
-
company_name = list_df["Name"].to_list()
|
38 |
-
company_symbol = (list_df["Ticker"] + ".NS").to_list()
|
39 |
-
|
40 |
-
company_dict = dict()
|
41 |
-
company_symbol_dict = dict()
|
42 |
-
|
43 |
-
for CSymbol, CName in zip(company_symbol, company_name):
|
44 |
-
company_dict[CName] = CSymbol
|
45 |
-
|
46 |
-
for CSymbol, CName in zip(company_symbol, company_name):
|
47 |
-
company_symbol_dict[CSymbol] = CName
|
48 |
-
|
49 |
-
st.markdown(
|
50 |
-
"""
|
51 |
-
<style>
|
52 |
-
.big-font {
|
53 |
-
font-size:20px;
|
54 |
-
}
|
55 |
-
</style>""",
|
56 |
-
unsafe_allow_html=True,
|
57 |
-
)
|
58 |
-
|
59 |
-
st.markdown('<p class="big-font">Select Multiple Companies</p>', unsafe_allow_html=True)
|
60 |
-
|
61 |
-
com_sel_name = st.multiselect("", company_name, default=None)
|
62 |
-
com_sel_date = []
|
63 |
-
|
64 |
-
for i in com_sel_name:
|
65 |
-
d = st.date_input(
|
66 |
-
f"Select your vacation for next year - {i}",
|
67 |
-
format="YYYY-MM-DD",
|
68 |
-
)
|
69 |
-
com_sel_date.append(d)
|
70 |
-
|
71 |
-
com_sel = [company_dict[i] for i in com_sel_name]
|
72 |
-
|
73 |
-
num_tick = len(com_sel)
|
74 |
-
|
75 |
-
if num_tick > 1:
|
76 |
-
|
77 |
-
com_data = pd.DataFrame()
|
78 |
-
for cname, cdate in zip(com_sel, com_sel_date):
|
79 |
-
stock_data_temp = yf.download(cname, start=cdate, end=pd.Timestamp.now().strftime('%Y-%m-%d'))
|
80 |
-
com_data[cname] = stock_data_temp["Adj Close"]
|
81 |
-
|
82 |
-
|
83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|