Spaces:
Runtime error
Runtime error
thisisashwinraj
commited on
Commit
•
2716dbb
1
Parent(s):
8151d39
Add application file
Browse files- Procfile +1 -0
- app.py +35 -0
- msft.csv +3 -0
- requirements.txt +4 -0
- setup.sh +8 -0
Procfile
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
web: sh setup.sh && streamlit run app.py
|
app.py
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#Import required Libraries
|
2 |
+
import streamlit as st
|
3 |
+
import pickle
|
4 |
+
import pandas as pd
|
5 |
+
import webbrowser
|
6 |
+
|
7 |
+
hide_menu_style = """
|
8 |
+
<style>
|
9 |
+
#MainMenu {visibility: hidden;}
|
10 |
+
footer {visibility: hidden;}
|
11 |
+
</style>
|
12 |
+
"""
|
13 |
+
st.markdown(hide_menu_style, unsafe_allow_html=True)
|
14 |
+
|
15 |
+
Stock = pd.read_csv('msft.csv')
|
16 |
+
|
17 |
+
#Frontend Design for StreamLit WebApp Sidebar
|
18 |
+
st.sidebar.subheader(" ")
|
19 |
+
|
20 |
+
st.sidebar.subheader("Charts From:")
|
21 |
+
st.sidebar.text("National Stock Exchange")
|
22 |
+
|
23 |
+
st.sidebar.subheader("Developed By")
|
24 |
+
st.sidebar.text("Ashwin Raj, ASE at TCS")
|
25 |
+
|
26 |
+
st.title('NSE Charts')
|
27 |
+
|
28 |
+
|
29 |
+
selected_chart = st.selectbox('Select Stock', Stock['Name'].values)
|
30 |
+
|
31 |
+
#Output Recommendations with Posters
|
32 |
+
if st.button('Show Chart'):
|
33 |
+
url=Stock.loc[Stock['Name'] == selected_chart, 'Link'].item()
|
34 |
+
|
35 |
+
webbrowser.open_new_tab(url)
|
msft.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
index,Link,Name
|
2 |
+
0,https://in.investing.com/equities/axis-bank-chart,Axis Bank
|
3 |
+
1,https://in.investing.com/equities/hdfc-bank-chart,HDFC Bank
|
requirements.txt
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
streamlit
|
2 |
+
requests
|
3 |
+
pandas
|
4 |
+
webbrowser
|
setup.sh
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
mkdir -p ~/.streamlit/
|
2 |
+
echo "\
|
3 |
+
[server]\n\
|
4 |
+
headless = true\n\
|
5 |
+
port = $PORT\n\
|
6 |
+
enableCORS = false\n\
|
7 |
+
\n\
|
8 |
+
" > ~/.streamlit/config.toml
|