CLI tool to rank proposals according to Majority Judgment, from an input CSV
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Go to file
Dominique Merle 9c50248215
feat: display the merit profiles as ASCII art
3 years ago
cmd feat: display the merit profiles as ASCII art 3 years ago
example docs: replace dummy example data 3 years ago
formatter feat: display the merit profiles as ASCII art 3 years ago
.gitignore chore(git): ignore windows builds 3 years ago
LICENSE feat: basic cobra boilerplate and usage doc 3 years ago
README.md docs: use global mj instead of local one in examples 3 years ago
go.mod feat: add an option to sort proposals as well 3 years ago
main.go feat: basic cobra boilerplate and usage doc 3 years ago

README.md

Majority Judgment CLI tool

WORK IN PROGRESS Although the core mechanics are here and ranking does work, the features described in this README are not all implemented. We're merely doc-driving this tool.

  • Read from stdin with -
  • Read CSV file
  • --sort
  • --format text
  • --format json
  • --format csv
  • --format yml
  • --format svg
  • --chart

Download

From CI artifacts? Perhaps we'll handcraft a few releases

Meanwhile, grab the source and build it:

git clone https://github.com/MieuxVoter/majority-judgment-cli

Usage

mj example.csv

or use - to read from stdin:

cat example.csv | mj -

You can specify the format:

mj example.csv --format json > results.json
mj example.csv --format csv > results.csv
mj example.csv --format svg > merit.svg

And the kind of chart you want:

mj example.csv --format svg --chart opinion > opinion.svg

Available charts:

  • merit_linear (default)
  • merit_circular
  • opinion

Build

Install golang.

Example for Ubuntu: sudo snap install go --classic

Then go into this project directory and run:

go get
go build -o mj

Build distributables

go build -ldflags "-s -w" -o mj && upx mj

Yields a mj binary of about 2 Mio.

They say we should not strip go builds.

For Windows

GOOS=windows GOARCH=amd64 go build -ldflags "-s -w" -o mj.exe