parsers.ess1

parsers.ess1(cvr_path: str | Path, office: str | None = None) Dict[str, List]

Parser for one format of ES&S CVR files.

Parameters:
  • cvr_path (Union[str, pathlib.Path]) – Directory containing “*allot*.txt” files and “*aster*.txt” files.

  • office (Optional[str]) – Name of election to parse, as written in master lookup file. If only one contest named in file, no need for this argument. This is generally the case when the pair of input file exist in a contest-specific folder. When in doubt check the master lookup file.

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]