Skip to main content

resultadosonpe

A terminal user interface (TUI) application that displays live election results from Peru's ONPE (Oficina Nacional de Procesos Electorales).

Built with Textual and plotext for rich, interactive charts right in your terminal.

Features

  • Live election results for Presidential, Senators, and Andean Parliament races
  • Horizontal bar charts showing candidate/party vote percentages
  • Progress header with tallied records count and percentage
  • Auto-refresh every 60 seconds with manual refresh button (r key)
  • Internationalization support (English and Spanish)
  • Connects directly to the official ONPE results API

Installation

Via uvx (recommended)

uvx resultadosonpe

Via uv

uv tool install resultadosonpe
resultadosonpe

From source

git clone https://github.com/jpchauvel/resultadosonpe.git
cd resultadosonpe
uv sync
uv run resultadosonpe

Usage

Launch the application:

resultadosonpe

Keyboard shortcuts

Key Action
r Refresh
q Quit

Language

The UI language follows your system locale. To force Spanish:

LANGUAGE=es resultadosonpe

To force English:

LANGUAGE=en resultadosonpe

Development

Prerequisites

  • Python 3.14+
  • uv

Setup

git clone https://github.com/jpchauvel/resultadosonpe.git
cd resultadosonpe
uv sync --group dev
uv run pre-commit install
uv run pre-commit install --hook-type pre-push

Running tests

uv run pytest

Linting and type checking

uv run ruff check src/ tests/ features/
uv run ruff format --check src/ tests/ features/
uv run mypy src/resultadosonpe/
uv run bandit -r src/resultadosonpe/ -s B101

Architecture

src/resultadosonpe/
  __main__.py      Entry point, locale setup
  app.py           Textual app with auto-refresh and chart layout
  api_client.py    HTTP client for the ONPE results API
  models.py        Data models (ElectoralProcess, Election, etc.)
  transforms.py    Data transformation for chart display
  widgets.py       Custom Textual widgets (ElectionChart, ProgressHeader)
  i18n.py          Gettext-based internationalization
  locales/         Translation files (.po/.mo)

License

MIT

Release files for resultadosonpe 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for resultadosonpe 0.4.0
File Size Uploaded
resultadosonpe-0.4.0.tar.gz 51.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for resultadosonpe 0.4.0
File Interpreter ABI Platform
resultadosonpe-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 64.6 kB

Release files / resultadosonpe-0.4.0.tar.gz

Download URL resultadosonpe-0.4.0.tar.gz
Size 51.5 kB
Tags Source
SHA-256 checksum
How to use checksums
968f49d61355bdf740979d2c29ec18d995528e088c196248f9376a14b526d88e
BLAKE2b-256 checksum
How to use checksums
a79cf77d010a26a92d04be3b32971a1f4dc1d32039ff853faf6c8c66eb943614
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / resultadosonpe-0.4.0-py3-none-any.whl

Download URL resultadosonpe-0.4.0-py3-none-any.whl
Size 13.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b23798a379c4e276f462f2116957454bce316f35f6d46cf4251f0121c5c5e3d
BLAKE2b-256 checksum
How to use checksums
b4f4a80b7cebe27fbb0c461fb38f74c70e502c983a43e6bf24f29fd1600ae853
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page