Skip to main content

abiftool parses, converts and analyzes ABIF (Aggregated Ballot Information Format) files.

Project description

abiftool.py

ABIF conversion utility

A script (abiftool.py) which converts between ABIF and other commonly-used electoral expression formats.

Homepage: https://electorama.com/abiftool

Getting started

To try abiftool.py, perform the following steps:

  1. Drop to a shell prompt, and change to a directory for a local copy of abiftool.py and supporting tests and libraries.
  2. Clone the repo:
git clone https://github.com/electorama/abiftool.git
cd abiftool
  1. Install the dependencies
pip install -r requirements.txt
  1. Run an example command (see below)

Examples

Burlington 2009

The following command runs with test data checked into this repository:

./abiftool.py -t text testdata/burl2009/burl2009.abif

The expected output is a table with the pairwise output from the election described in burl2009.abif:

+------------------+----------+------+--------+-------+---------+----------+
+    Loser ->      + Montroll | Kiss | Wright | Smith | Simpson | Write-in |
+ v Winner         +          |      |        |       |         |          |
+==================+==========+======+========+=======+=========+==========+
+ Montroll (5-0-0) + None     | 4067 | 4597   | 4573  | 6267    | 6658     |
+------------------+----------+------+--------+-------+---------+----------+
+ Kiss (4-1-0)     + 3477     | None | 4314   | 3946  | 5517    | 6149     |
+------------------+----------+------+--------+-------+---------+----------+
+ Wright (3-2-0)   + 3668     | 4064 | None   | 3975  | 5274    | 6063     |
+------------------+----------+------+--------+-------+---------+----------+
+ Smith (2-3-0)    + 2998     | 3577 | 3793   | None  | 5573    | 6057     |
+------------------+----------+------+--------+-------+---------+----------+
+ Simpson (1-4-0)  + 591      | 845  | 1309   | 721   | None    | 3338     |
+------------------+----------+------+--------+-------+---------+----------+
+ Write-in (0-5-0) + 104      | 116  | 163    | 117   | 165     | None     |
+------------------+----------+------+--------+-------+---------+----------+

The table above expresses the same results that can be found in the "Pairwise results" table in the article:

https://electowiki.org/wiki/2009_Burlington_mayoral_election#Pairwise_results

Licensing

abiftool.py is currently licensed under the GNU General Public License version 3 (GPLv3). As of this writing (in February 2024), the primary author can probably be convinced to switch to an MIT, BSD, or Apache license of some sort. Visit electorama/abiftool#1 to discuss this topic.

More info...

More about the formats supported, history of the project, and future plans for abiftool can be found on the homepage for this project: https://electorama.com/abiftool

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

abiftool-0.34.0rc1.tar.gz (289.5 kB view details)

Uploaded Source

Built Distribution

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

abiftool-0.34.0rc1-py3-none-any.whl (328.9 kB view details)

Uploaded Python 3

File details

Details for the file abiftool-0.34.0rc1.tar.gz.

File metadata

  • Download URL: abiftool-0.34.0rc1.tar.gz
  • Upload date:
  • Size: 289.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for abiftool-0.34.0rc1.tar.gz
Algorithm Hash digest
SHA256 e13189e2d9cdef34aa6211e55b4fe8ccc5f4dc33fe488f92339048f437e9459f
MD5 34c0d0175417f43f2339cfc69a6b2a03
BLAKE2b-256 f45398608a1c0be2b36c2d87f366c76e6eb846b91bc59355ce8ebffa40ef06a3

See more details on using hashes here.

File details

Details for the file abiftool-0.34.0rc1-py3-none-any.whl.

File metadata

  • Download URL: abiftool-0.34.0rc1-py3-none-any.whl
  • Upload date:
  • Size: 328.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for abiftool-0.34.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 22b29cffeceab05eeac453e20f4cf2f269870b4dc1289ef3bde42780d0325261
MD5 95cb2c193740ec4c6323c59324c75d0b
BLAKE2b-256 058ef0c7aceef0e5b75046cf36ba599dc7b44c8c3fd83af28ed1259a340a9dff

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