https://github.com/redbrick/good_stv
A good single transferable vote utility.
https://github.com/redbrick/good_stv
Last synced: over 1 year ago
JSON representation
A good single transferable vote utility.
- Host: GitHub
- URL: https://github.com/redbrick/good_stv
- Owner: redbrick
- License: gpl-3.0
- Created: 2017-11-06T19:39:24.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-06-14T16:08:07.000Z (about 3 years ago)
- Last Synced: 2024-04-14T02:29:31.179Z (over 2 years ago)
- Language: Rust
- Size: 232 KB
- Stars: 4
- Watchers: 9
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE-OF-CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# good_stv
A tool for evaluating elections using
[Single Transferable Vote](https://en.wikipedia.org/wiki/Single_transferable_vote).
[](https://travis-ci.org/redbrick/good_stv)
## Usage
good_stv expects to receive CSV-formatted data, either on stdin or a file. The
only required argument is a positive integer representing the number of seats to
fill in the election. Example invocations are:
```sh
$ good_stv -f test.csv 3
```
```sh
$ good_stv 3 < test.csv
```
### CSV format
The input data is expected to be in the following format:
One (1) header line, with a list of candidates to be elected, in any order. This
is followed by any number of body lines, each containing a list of candidates,
in order of preference from highest to lowest, left to right, representing a
single vote. Any candidates listed in the body who are not also in the header
will be ignored. Each vote does not need to include every candidate, although
votes listing zero (0) candidates will be ignored.
#### Example
```csv
alice,bob,charlie
alice,bob
bob,charlie,alice
bob
```
### Web App
**Still under development**
To run the web app you first need to build it with yarn.
```shell
yarn
yarn build
```
Then run `cargo run -- --server` to start the server on `localhost:8000`
## License
```text
good_stv - a good single transferable vote utility.
Copyright (C) 2017 Terry Bolt
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
```