How juliosaulo/como-meus-vizinhos-votam works
This repository builds and serves a geographic inference product: a person looks up an address, the system estimates a nearby voting region, and the site presents its election results. The main data path covers official voting locations, election totals, spatial attribution, street indexing, and publication. The site also supports historical comparisons and live 2026 results from ballot files. Edges follow the README workflow and shown imports/calls; some pipeline details and unsampled modules are represented only where the README documents them.
Main entry points: app.js Website app · 40_build_dados_publicados.py Published data builder · validacoes.py Pipeline validations · 31_atribuir_endereco_regiao.py Address attribution
Components 28
Data pipeline
- Official locations
pipeline/10_locais_oficiais.py - Region dimension
pipeline/11_montar_dim_regiao.py - Vote processing
pipeline/21_processar_votacao.py - Regional votes
pipeline/22_votos_por_regiao.py - Spatial grid
pipeline/malha.py - Address attribution
pipeline/31_atribuir_endereco_regiao.py - Street index
pipeline/32_montar_indice_ruas.py - Published data builder
pipeline/40_build_dados_publicados.py
Data quality
- Pipeline validations
qualidade/validacoes.py - Published-data checks
qualidade/validar_publicado.py
Address lookup
- Reference lookup
consulta_regiao.py
Election site
- Website app
site/js/app.js - Published-data loader
site/js/dados.js - Address resolver
site/js/consulta.js - Voting-place map
site/js/mapa.js - Result formatting
site/js/formato.js - President results
site/js/abas/presidente.js - Territory comparison
site/js/abas/comparativo.js - Election evolution
site/js/abas/evolucao.js - Deputy results
site/js/abas/deputado.js
Live 2026
- Live result collection
coleta_2026/ao_vivo.py - Ballot parsing
coleta_2026/bu.py - Ballot conversion
coleta_2026/converter.py - Live browser results
site/js/ao_vivo.js
Other components
- Address seeker
- TSE election data
- CNEFE addresses
- TSE ballot service
Connections 33
- TSE election data → Official locations: supplies locations
README.md - TSE election data → Vote processing: supplies vote totals
README.md - CNEFE addresses → Address attribution: supplies addresses
README.md - Official locations → Region dimension: groups locations
README.md - Vote processing → Regional votes: aggregates votes
README.md - Region dimension → Address attribution: provides voting regions
README.md - Spatial grid → Address attribution: builds neighbor index
pipeline/31_atribuir_endereco_regiao.py - Address attribution → Street index: supports street index
README.md - Region dimension → Published data builder: provides region data
pipeline/40_build_dados_publicados.py - Regional votes → Published data builder: provides regional votes
pipeline/40_build_dados_publicados.py - Street index → Published data builder: provides street index
pipeline/40_build_dados_publicados.py - Pipeline validations → Region dimension: validates output
pipeline/11_montar_dim_regiao.py - Pipeline validations → Vote processing: validates output
pipeline/21_processar_votacao.py - Pipeline validations → Address attribution: validates output
pipeline/31_atribuir_endereco_regiao.py - Pipeline validations → Street index: validates output
pipeline/32_montar_indice_ruas.py - Pipeline validations → Published data builder: validates output
pipeline/40_build_dados_publicados.py - Published data builder → Published-data checks: checks published files
qualidade/validar_publicado.py - Published data builder → Published-data loader: publishes static data
README.md - Address seeker → Website app: enters address
README.md - Website app → Address resolver: resolves address
site/js/app.js - Website app → Published-data loader: loads datasets
site/js/app.js - Website app → Voting-place map: renders location
site/js/app.js - Website app → Result formatting: formats results
site/js/app.js - Website app → President results: renders tab
site/js/app.js - Website app → Territory comparison: renders tab
site/js/app.js - Website app → Election evolution: renders tab
site/js/app.js - Website app → Deputy results: renders tab
site/js/app.js - Website app → Live browser results: requests live results
site/js/app.js - Live result collection → TSE ballot service: fetches ballots
coleta_2026/ao_vivo.py - TSE ballot service → Live result collection: returns ballot files
coleta_2026/ao_vivo.py - Ballot parsing → Ballot conversion: parses ballot data
coleta_2026/converter.py - Ballot conversion → Regional votes: produces pipeline input
coleta_2026/converter.py - Live browser results → TSE ballot service: fetches ballots
site/js/ao_vivo.js