eleicoes-pt
Resultados eleitorais portugueses desde 1975, em acesso aberto.
Dados pré-processados a partir das fontes oficiais do MAI (Ministério da Administração Interna), disponíveis para download directo sem necessidade de parsear XLSX ou tratar formatos históricos.
Instalação
pip install eleicoes-pt
Utilização
from eleicoes_pt import fetch, list_available
# Ver o que está disponível
print(list_available())
# {
# 'AR': [1975, 1976, 1979, 1980, 1983, 1985, 1987, 1991, 1995, ...],
# 'CM': [1982, 1985, 1989, ...],
# ...
# }
# Obter resultados
resultados = fetch("AR", 2024)
resultados = fetch("CM", 2021)
resultados = fetch("PR", 2011)
Os dados são devolvidos como lista de dicts. Ficheiros descarregados ficam disponíveis offline se passar cache_dir:
from pathlib import Path
resultados = fetch("AR", 2024, cache_dir=Path("~/.cache/eleicoes-pt").expanduser())
Tipos de eleição
| Código | Eleição |
|---|---|
AR |
Assembleia da República |
CM |
Câmaras Municipais |
AM |
Assembleias Municipais |
AF |
Assembleias de Freguesia |
PR |
Presidente da República |
PE |
Parlamento Europeu |
ALRAM |
Assembleia Legislativa da Região Autónoma da Madeira |
ALRAA |
Assembleia Legislativa da Região Autónoma dos Açores |
Modo de auditoria
Para verificar a integridade dos dados publicados face ao ficheiro original do MAI:
pip install eleicoes-pt[audit]
from eleicoes_pt import audit
audit("AR", 2024)
Fonte dos dados
Todos os dados provêm do MAI — Ministério da Administração Interna, disponíveis em sg.mai.gov.pt. Os ficheiros originais (XLSX) são processados uma vez e publicados neste repositório como release de dados para facilitar o acesso.
Licença
MIT © Open Lousada
Metadata
Release files for eleicoes-pt 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| eleicoes_pt-0.1.0.tar.gz | 127.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| eleicoes_pt-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 132.0 kB
Release files / eleicoes_pt-0.1.0.tar.gz
| Download URL | eleicoes_pt-0.1.0.tar.gz |
|---|---|
| Size | 127.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4fb822e3932ea7592a44f85f64a374d2487f70dfef1a322b8ecef3966bba2a68
|
|
BLAKE2b-256 checksum How to use checksums |
da05b400bac03b0f26b22722c77a1ca5c402b6128401547aac7231e7618d419c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / eleicoes_pt-0.1.0-py3-none-any.whl
| Download URL | eleicoes_pt-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4ab0fefadcc26006d87f66e1689de93eca59df521a2d4c9b1b5b39c1077a0d79
|
|
BLAKE2b-256 checksum How to use checksums |
5a006a9fb8cf1f7ae5bb68366830d66f3f3f9572db43d66c96d2c21dcbbbc78e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for eleicoes-pt 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.