<commit_before># helios-server-mixnet standalone scripts

## mix.py
Requires a Python 2 virtual environment.

    ./mix.py ballots.json shuffle.json proof.json

Takes as input a JSON file containing a list of ballots (as shown in each mixnet's homepage when time to shuffle), and outputs a JSON file containing the shuffled ballots, and a JSON file containing the proof of shuffle.

## verify.py
Requires a Python 2 virtual environment.

    ./verify.py https://helios.example.com/helios/elections/12345678-90ab-cdef-1234-567890abcdef

Downloads the data for a Helios mixnet election and verifies the shuffles and decryption.

## count/*_to_gamma.py
Requires **Python 3**.

    ./csv_to_gamma.py candidates.csv ballots.csv

Takes as input a list of candidates (one per line) and a list of CSV ballots (one ballot per line, candidate names separated by commas), and outputs a result array able to be piped into the count scripts.

    ./blt_to_gamma.py ballots.blt

Takes as input an [OpenSTV blt file](https://stackoverflow.com/questions/2233695/how-do-i-generate-blt-files-for-openstv-elections-using-c), and outputs a result array able to be piped into the count scripts.

## count/wright_stv.py
Requires **Python 3**.

    ./wright_stv.py election.json result.json 2

Takes as input a JSON file containing the [raw data for an election](https://helios.example.com/helios/elections/12345678-90ab-cdef-1234-567890abcdef), the [raw result](https://helios.example.com/helios/elections/12345678-90ab-cdef-1234-567890abcdef/result) and the number of seats to be filled, and calculates the winners under [Wright STV](http://www.aph.gov.au/Parliamentary_Business/Committees/House_of_Representatives_Committees?url=/em/elect07/subs/sub051.1.pdf).<commit_msg>Update documentation for blt files<commit_after># helios-server-mixnet standalone scripts

## mix.py
Requires a Python 2 virtual environment.

    ./mix.py ballots.json shuffle.json proof.json

Takes as input a JSON file containing a list of ballots (as shown in each mixnet's homepage when time to shuffle), and outputs a JSON file containing the shuffled ballots, and a JSON file containing the proof of shuffle.

## verify.py
Requires a Python 2 virtual environment.

    ./verify.py https://helios.example.com/helios/elections/12345678-90ab-cdef-1234-567890abcdef

Downloads the data for a Helios mixnet election and verifies the shuffles and decryption.

## count/*_to_blt.py
Requires **Python 3**.

    ./gamma_to_blt.py election.json result.json 2

Takes as input a JSON file containing the [raw data for an election](https://helios.example.com/helios/elections/12345678-90ab-cdef-1234-567890abcdef), the [raw result](https://helios.example.com/helios/elections/12345678-90ab-cdef-1234-567890abcdef/result) and the number of seats to be filled, and outputs an [OpenSTV blt file](https://stackoverflow.com/questions/2233695/how-do-i-generate-blt-files-for-openstv-elections-using-c) able to be piped into the count scripts.

## count/wright_stv.py
Requires **Python 3**.

    ./wright_stv.py election.blt

Takes as input a JSON file containing an [OpenSTV blt file](https://stackoverflow.com/questions/2233695/how-do-i-generate-blt-files-for-openstv-elections-using-c), and calculates the winners under [Wright STV](http://www.aph.gov.au/Parliamentary_Business/Committees/House_of_Representatives_Committees?url=/em/elect07/subs/sub051.1.pdf).
{'fraction_non_alphanumeric': 0.09791237871214349, 'fraction_numerical': 0.047927080270508675, 'mean_word_length': 4.478260869565218, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 9, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6233893', 'n_tokens_mistral': 1222, 'n_tokens_neox': 1066, 'n_words': 333}