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:
- Drop to a shell prompt, and change to a directory for a local copy of
abiftool.pyand supporting tests and libraries. - Clone the repo:
git clone https://github.com/electorama/abiftool.git
cd abiftool
- Install the dependencies
pip install -r requirements.txt
- 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
Metadata
Release files for abiftool 0.34.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 | |
|---|---|---|---|---|
| abiftool-0.34.0.tar.gz | 338.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| abiftool-0.34.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 710.7 kB
Release files / abiftool-0.34.0.tar.gz
| Download URL | abiftool-0.34.0.tar.gz |
|---|---|
| Size | 338.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
82d923f37a7f722cca851ffa563560500271895486a0d62869592b2caa415168
|
|
BLAKE2b-256 checksum How to use checksums |
0ad1e560b69a017a886eab4d3e2b3e02f706f49a14ed2ff1d153c2b056dc7fc2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / abiftool-0.34.0-py3-none-any.whl
| Download URL | abiftool-0.34.0-py3-none-any.whl |
|---|---|
| Size | 371.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ee666309f859027ce3732df6aa0e09f4ca41b89c7452a401a7259895d7acecbb
|
|
BLAKE2b-256 checksum How to use checksums |
2896ef21aa82ca0e41045be0dd1c74c44747c93a57699cf056d7acf6eb56cf4e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Security for abiftool 0.34.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.