aboutsummaryrefslogtreecommitdiff
path: root/docs/blt.md
blob: e5a5a513dd03662f7b6af8f6f50055fb98fabadd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
1# BLT file format
2
3OpenTally accepts ballot data in the BLT file format, as described by [Hill, Wichmann & Woodall](https://www.dia.govt.nz/diawebsite.NSF/Files/meekm/%24file/meekm.pdf) for their implementation of Meek STV. The BLT file format is also used by [OpenSTV/OpaVote](https://www.opavote.com/help/overview#blt-file-format), Lundell's [Droop](https://github.com/jklundell/droop/wiki/BltFileFormat) and Otten's [eSTV](https://web.archive.org/web/20020606014623/http://estv.otten.co.uk/) (where it is known as a DAT data transfer file).
4
5The file format is as follows:
6
7```
84 2
9-2
103 1 3 4 0
114 1 3 2 0
122 4 1=3 0
131 2 0
142 2=4=3 1 0
151 3 4 2 0
160
17"Adam"
18"Basil"
19"Charlotte"
20"Donald"
21"Title"
22```
23
24The first line (`4 2`) indicates that there are 4 candidates for 2 vacancies.
25
26The second line (`-2`), which is optional, indicates that the 2nd candidate (Basil) has withdrawn. Multiple withdrawn candidates may be specified on this line, e.g. `-2 -3 -4`.
27
28The third line (second, if there are no withdrawn candidates) begins the ballot data. `3 1 3 4 0` indicates that there were 3 ballots which voted, in order of preference, for the 1st candidate (Adam), then the 3rd candidate (Charlotte), then the 4th candidate (Donald). An `=` indicates that multiple candidates were ranked at the same preference. A `0` optionally indicates the end of the list of preferences.
29
30The end of the list of ballots must be indicated with a single `0`.
31
32The next lines give the names of the candidates, up to the number of candidates specified on the first line (in this case, 4). Each candidate's name, unless a single word, must be surrounded by quotation marks.
33
34The final line gives the name of the election, which, unless a single word, must be surrounded by quotation marks.
35
36Newlines are optional, but if not provided, the `0` at the end of each ballot's preferences is mandatory.
Contact (issues, pull requests, etc.) at git@yingtongli.me. Generated by cgit.