parsers.dominion5_10

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

Reads ballot data from Dominion V5.10 CVRs for a single contest.

Files expected in cvr_path:
  • ContestManifest.json

  • CandidateManifest.json

  • PrecinctPortionManifest.json

  • (optional) PrecinctManifest.json

  • DistrictManifest.json

  • DistrictTypeManifest.json

  • DistrictPrecinctPortionManifest.json

  • BallotTypeManifest.json

  • CountingGroupManifest.json

  • BallotTypeContestManifest.json

  • TabulatorManifest.json

  • CvrExport*.json (multiple possible)

Parameters:
  • cvr_path (Union[str, pathlib.Path]) – Path where CVR files are located.

  • office (str) – Names which contest’s ballots should be read. Must match a contest name in ContestManifest.json.

Raises:

RuntimeError – If ballotIDs pulled from ImageMask field are not unique. Or if regex used to pull ballotID from ImageMask field malfunctions.

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]