This repository was archived by the owner on Jul 7, 2026. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathapp.py
More file actions
112 lines (98 loc) · 3.43 KB
/
Copy pathapp.py
File metadata and controls
112 lines (98 loc) · 3.43 KB
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import streamlit as st
import yfinance as yf
import pandas as pd
# Configuração da página
st.set_page_config(page_title="O Informante - Renda Real", layout="wide")
# Estilo CSS para tentar manter a pegada elegante
st.markdown("""
<style>
.forbes-card {
background-color: white;
padding: 2rem;
border-radius: 10px;
border: 1px solid #e0e0e0;
margin-bottom: 2rem;
}
.big-font {
font-size: 50px !important;
font-weight: 700;
color: #1a1a1a;
}
.currency {
font-size: 25px;
font-weight: 700;
vertical-align: super;
}
.income-tag {
color: #008a00;
font-weight: bold;
font-size: 1.2rem;
}
</style>
""", unsafe_allow_html=True)
# 1. Dados dos Bilionários (Mesma lógica do servidor)
DADOS_BILIONARIOS = [
{
"nome": "Joesley Batista",
"foto": "https://raw.githubusercontent.com/uol/joesley-batista.jpg", # Use URLs para facilitar o deploy
"ativos": [
{"ticker": "PICS", "acoes": 53365200, "yield": 0.03},
{"ticker": "JBS", "acoes": 268038349, "yield": 0.045}
]
},
{
"nome": "Wesley Batista",
"foto": "https://raw.githubusercontent.com/uol/wesley-batista.jpg",
"ativos": [
{"ticker": "PICS", "acoes": 53365200, "yield": 0.03},
{"ticker": "JBS", "acoes": 268038349, "yield": 0.045}
]
},
{
"nome": "Fabio Cury",
"foto": "https://exemplo.com/fabiocury.jpg",
"ativos": [
{"ticker": "CURY3.SA", "acoes": 94546195, "yield": 0.08}
]
},
{
"nome": "Ronaldo Cezar Coelho",
"foto": "https://exemplo.com/ronaldo.jpg",
"ativos": [
{"ticker": "ENGI11.SA", "acoes": 41938027, "yield": 0.05}
]
}
]
def formatar_brl(valor):
if valor >= 1e9: return f"{valor/1e9:.2f}B"
return f"{valor/1e6:.1f}M"
# 2. Interface do Streamlit
st.title("💰 O Informante: Relatório de Dividendos")
st.subheader("Renda estimada anual dos principais acionistas")
try:
cotacao_dolar = float(yf.Ticker("USDBRL=X").fast_info['lastPrice'])
except:
cotacao_dolar = 5.15
# Criando os cards
for b in DADOS_BILIONARIOS:
renda_anual = 0.0
for ativo in b["ativos"]:
t = yf.Ticker(ativo["ticker"])
preco = float(t.fast_info['lastPrice'])
if ".SA" not in ativo["ticker"]:
preco *= cotacao_dolar
renda_anual += (preco * ativo["acoes"] * ativo["yield"])
renda_mensal = renda_anual / 12
# Layout do Card
with st.container():
col1, col2 = st.columns([2, 1])
with col1:
st.markdown(f"### {b['nome']}")
st.markdown(f'<span class="currency">R$</span> <span class="big-font">{formatar_brl(renda_anual)}</span>', unsafe_allow_html=True)
st.markdown(f'<p class="income-tag">💵 R$ {formatar_brl(renda_mensal)} est./mês</p>', unsafe_allow_html=True)
st.write("---")
st.caption("FONTE: Dados baseados em Dividend Yield médio e participações declaradas.")
with col2:
# Se você tiver as fotos locais, pode usar o caminho do arquivo
st.image(b["foto"], width=200)
st.sidebar.info(f"Cotação Atual do Dólar: R$ {cotacao_dolar:.2d}")