parsers.nyc2021

parsers.nyc2021(cvr_path: str | Path, office: str, other_data_cols: List = ['Precinct']) Dict[str, List]

Parser for NYC 2021 Primary Elections. One election at a time.

Parameters:
  • cvr_path (Union[str, pathlib.Path]) – CVR directory containing “candidate_codes.csv”, “rcv_elections.txt”, and many csv CVR files.

  • office (str) – Name of election listed in “rcv_elections.txt” to parse from CVR.

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]