Spaces:
Sleeping
Sleeping
lucasvascrocha
commited on
Commit
•
260c664
1
Parent(s):
4565b50
create app
Browse files
app.py
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# ----------------------------------LIBS -------------------------------------------------------------
|
2 |
+
import streamlit as st
|
3 |
+
st.set_page_config( # Alternate names: setup_page, page, layout
|
4 |
+
layout="wide", # Can be "centered" or "wide". In the future also "dashboard", etc.
|
5 |
+
initial_sidebar_state="auto", # Can be "auto", "expanded", "collapsed"
|
6 |
+
page_title=None, # String or None. Strings get appended with "• Streamlit".
|
7 |
+
page_icon=None, # String, anything supported by st.image, or None.
|
8 |
+
)
|
9 |
+
|
10 |
+
import matplotlib
|
11 |
+
matplotlib.use('Agg')
|
12 |
+
|
13 |
+
from streamlit_option_menu import option_menu
|
14 |
+
|
15 |
+
import warnings
|
16 |
+
warnings.filterwarnings('ignore')
|
17 |
+
|
18 |
+
import datetime as dt
|
19 |
+
dia = dt.datetime.today().strftime(format='20%y-%m-%d')
|
20 |
+
|
21 |
+
import style as style
|
22 |
+
import home as home
|
23 |
+
import login as login
|
24 |
+
import pag1 as pag1
|
25 |
+
import pag2 as pag2
|
26 |
+
import pag3 as pag3
|
27 |
+
import pag4 as pag4
|
28 |
+
import pag5 as pag5
|
29 |
+
|
30 |
+
|
31 |
+
# ----------------------------------DEFS -------------------------------------------------------------
|
32 |
+
|
33 |
+
#carrega os arquivos css
|
34 |
+
def local_css(file_name):
|
35 |
+
with open(file_name) as f:
|
36 |
+
st.markdown(f'<style>{f.read()}</style>', unsafe_allow_html=True)
|
37 |
+
|
38 |
+
def main():
|
39 |
+
|
40 |
+
#css comum para todas páginas (menu)
|
41 |
+
#local_css("style_0.css")
|
42 |
+
|
43 |
+
#esconder botão de menu e marca dágua no rodapé
|
44 |
+
#style.hidden_menu_and_footer()
|
45 |
+
|
46 |
+
#cabeçalho detalhe superior da página
|
47 |
+
#style.headerstyle()
|
48 |
+
|
49 |
+
# ----------------------------------MENU -------------------------------------------------------------
|
50 |
+
|
51 |
+
with st.sidebar:
|
52 |
+
style.sidebarwidth()
|
53 |
+
n_sprites = option_menu('Menu',["Home","Login","Análise técnica", "Comparar ações", "Análise fundamentalista", "Rastrear ações", "Previsão de lucro"],
|
54 |
+
icons=['house','person','bar-chart', 'book', 'bullseye', 'binoculars','cash-coin'],
|
55 |
+
default_index=0, menu_icon="app-indicator", #orientation='horizontal',
|
56 |
+
styles={
|
57 |
+
"container": {"padding": "2!important", "background-color": "#ffffff" }, # ,"background-size": "cover","margin": "0px"},
|
58 |
+
"nav-link": {"font-size": "12px", "text-align": "left", "--hover-color": "#4a7198","font-weight": "bold"}, #,"position": "relative","display": "inline"},
|
59 |
+
"nav-link-selected": {"background-color": "#4a7198"},
|
60 |
+
})
|
61 |
+
|
62 |
+
# ----------------------------------PAGES -------------------------------------------------------------
|
63 |
+
if n_sprites == "Home":
|
64 |
+
#local_css("style_1.css")
|
65 |
+
home.initial_page()
|
66 |
+
|
67 |
+
if n_sprites == "Login":
|
68 |
+
#local_css("style_login.css")
|
69 |
+
login.login_section()
|
70 |
+
|
71 |
+
if n_sprites == "Análise técnica":
|
72 |
+
#local_css("style_1.css")
|
73 |
+
pag1.analise_tecnica_fundamentalista()
|
74 |
+
|
75 |
+
if n_sprites == "Comparar ações":
|
76 |
+
#local_css("style_2.css")
|
77 |
+
pag2.comparacao_ativos()
|
78 |
+
|
79 |
+
if n_sprites == "Análise fundamentalista":
|
80 |
+
#local_css("style_3.css")
|
81 |
+
pag3.descobrir_ativos()
|
82 |
+
|
83 |
+
if n_sprites == "Rastrear ações":
|
84 |
+
#local_css("style_4.css")
|
85 |
+
pag4.rastreador()
|
86 |
+
|
87 |
+
if n_sprites == "Previsão de lucro":
|
88 |
+
#local_css("style_5.css")
|
89 |
+
pag5.analise_carteira()
|
90 |
+
|
91 |
+
if __name__ == '__main__':
|
92 |
+
main()
|
93 |
+
|