File size: 3,324 Bytes
260c664
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d7a8e5e
0ab87ed
260c664
 
 
 
 
 
 
 
 
 
 
a6b7beb
260c664
 
d7a8e5e
260c664
 
d7a8e5e
260c664
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a6b7beb
260c664
 
 
a6b7beb
260c664
 
 
a6b7beb
260c664
 
 
a6b7beb
260c664
 
 
a6b7beb
260c664
 
 
a6b7beb
260c664
 
 
a6b7beb
260c664
 
 
 
 
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
 # ----------------------------------LIBS -------------------------------------------------------------   
import streamlit as st
st.set_page_config(  # Alternate names: setup_page, page, layout
	layout="wide",  # Can be "centered" or "wide". In the future also "dashboard", etc.
	initial_sidebar_state="auto",  # Can be "auto", "expanded", "collapsed"
	page_title=None,  # String or None. Strings get appended with "• Streamlit". 
	page_icon=None,  # String, anything supported by st.image, or None.
)

import matplotlib
matplotlib.use('Agg')

from streamlit_option_menu import option_menu

import warnings
warnings.filterwarnings('ignore')
 
import datetime as dt 
dia = dt.datetime.today().strftime(format='20%y-%m-%d')

import style as style
import home as home
import login as login
import pag1 as pag1
import pag2 as pag2
import pag3 as pag3
import pag4 as pag4
import pag5 as pag5

CURRENT_THEME = "Dark"


 # ----------------------------------DEFS -------------------------------------------------------------   

#carrega os arquivos css
def local_css(file_name):
    with open(file_name) as f:
        st.markdown(f'<style>{f.read()}</style>', unsafe_allow_html=True)

def main():

    #css comum para todas páginas (menu)
    local_css("style_0.css")  

    #esconder botão de menu e marca dágua no rodapé
    style.hidden_menu_and_footer()

    #cabeçalho detalhe superior da página 
    style.headerstyle()

 # ----------------------------------MENU -------------------------------------------------------------   

    with st.sidebar:
        style.sidebarwidth()    
        n_sprites = option_menu('Menu',["Home","Login","Análise técnica", "Comparar ações", "Análise fundamentalista", "Rastrear ações", "Previsão de lucro"],
                            icons=['house','person','bar-chart', 'book', 'bullseye', 'binoculars','cash-coin'],
                            default_index=0, menu_icon="app-indicator",   #orientation='horizontal',
                            styles={
            "container": {"padding": "2!important", "background-color": "#ffffff" }, # ,"background-size": "cover","margin": "0px"},
            "nav-link": {"font-size": "12px", "text-align": "left", "--hover-color": "#4a7198","font-weight": "bold"}, #,"position": "relative","display": "inline"},
            "nav-link-selected": {"background-color": "#4a7198"},
             }) 

 # ----------------------------------PAGES -------------------------------------------------------------     
    if n_sprites == "Home":
        local_css("style_1.css")      
        home.initial_page()
    
    if n_sprites == "Login":
        local_css("style_login.css")      
        login.login_section()

    if n_sprites == "Análise técnica":
        local_css("style_1.css")      
        pag1.analise_tecnica_fundamentalista()

    if n_sprites == "Comparar ações":
        local_css("style_2.css")   
        pag2.comparacao_ativos()

    if n_sprites == "Análise fundamentalista":
        local_css("style_3.css")   
        pag3.descobrir_ativos()

    if n_sprites == "Rastrear ações":
        local_css("style_4.css")   
        pag4.rastreador()     

    if n_sprites == "Previsão de lucro":
        local_css("style_5.css")  
        pag5.analise_carteira()
        
if __name__ == '__main__':
    main()