Skip to main content

A CLI tool to parse and convert Opavote .blt ranked choice voter files.

Project description

fresh_blt

A modern CLI tool for parsing and analyzing Opavote BLT (Ballot Language Template) files used in ranked choice voting elections.

Installation

For how to install uv and Python, see installation.md.

Install the package using uv:

uv install .

CLI Usage

The fresh_blt CLI provides several commands for working with BLT files:

Basic Information

Display basic information about a BLT file:

fresh_blt info path/to/election.blt

This shows election title, number of candidates, positions, total ballots, and vote counts.

Candidate Information

Display candidate information with filtering options:

# Show all candidates
fresh_blt candidates path/to/election.blt

# Show only withdrawn candidates
fresh_blt candidates path/to/election.blt --withdrawn-only

# Show only active candidates
fresh_blt candidates path/to/election.blt --active-only

Ballot Information

Display ballot information with various options:

# Show first 10 ballots with first preferences
fresh_blt ballots path/to/election.blt

# Show more ballots
fresh_blt ballots path/to/election.blt --limit 50

# Show detailed rankings for each ballot
fresh_blt ballots path/to/election.blt --show-rankings

Statistical Analysis

Display comprehensive statistical analysis:

fresh_blt stats path/to/election.blt

This provides:

  • Candidate counts (total, active, withdrawn)
  • Ballot and vote statistics
  • First preference analysis with percentages

Data Export

Export BLT data to JSON or CSV formats:

# Export to JSON
fresh_blt export path/to/election.blt -o election_data.json -f json
fresh_blt export path/to/election.blt --output election_data.json --format json

# Export to CSV (creates separate files for candidates and ballots)
fresh_blt export path/to/election.blt -o election_data.csv -f csv
fresh_blt export path/to/election.blt --output election_data.csv --format csv

Validation

Validate BLT file structure and data integrity:

fresh_blt validate path/to/election.blt

This checks for:

  • Valid file structure
  • Correct candidate references in ballots
  • Data consistency

Command Reference

Command Description Options
info Display basic election information None
candidates Show candidate details --withdrawn-only, --active-only
ballots Display ballot information --limit, --show-rankings
stats Show election statistics None
export Export data to JSON/CSV -o/--output, -f/--format
validate Validate file structure None

Examples

# Quick overview of an election
fresh_blt info election.blt

# Analyze candidate performance
fresh_blt stats election.blt

# Extract data for further analysis (using short options)
fresh_blt export election.blt -o analysis.json -f json

# Extract data using long options
fresh_blt export election.blt --output analysis.json --format json

# Check file integrity
fresh_blt validate election.blt

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fresh_blt-0.2.0.tar.gz (61.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fresh_blt-0.2.0-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file fresh_blt-0.2.0.tar.gz.

File metadata

  • Download URL: fresh_blt-0.2.0.tar.gz
  • Upload date:
  • Size: 61.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.9

File hashes

Hashes for fresh_blt-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6ee4d8585ee6b9bc585082cab9660063c4bafd2b3ba4ab7c61a6750d865d6fc6
MD5 b773c76d3e38479601031dfd274bd848
BLAKE2b-256 cfe713b5cd9aff5998973b6e7352f62f7feaeedf0de3f047aa23e1f1e4eb39a9

See more details on using hashes here.

File details

Details for the file fresh_blt-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: fresh_blt-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 17.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.9

File hashes

Hashes for fresh_blt-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ccb48bc7f24b70b90c38ec7bcd425e2b466a92893d8e521d381dd97ee46aaa5
MD5 8c64e1fa1304a26ab3ae2d89465f0466
BLAKE2b-256 b2cdfe9c3114e9f1a22f9c5e7a885f01ccbbd3ed06d2d10b44f1535b143177ea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page