parsers.choice_pro_plus

parsers.choice_pro_plus(cvr_path: str | Path) Dict[str, List]

Parser for choice pro plus CVR files.

Parameters:

cvr_path (Union[str, pathlib.Path]) – Directory where .chp and .prm files are located.

Raises:

RuntimeError – Raised if more than 1 .chp file present in directory or .chp contains to no references to .prm files.

Returns:

A dictionary of lists containing informtion in the CVR file. Ranks are combined into per-ballot lists and stored with the key ‘ranks’. A ‘weight’ key and list of 1’s is added to the dictionary if no ‘weight’ column exists. All weights are of type decimal.Decimal.

Return type:

Dict[str, List]