r2b2.election

Election module handles data associated with an Election or collection of Contests.

Module Contents

class r2b2.election.Election(name: str, total_ballots: int, contests: Dict[str, r2b2.contest.Contest])[source]

Election information extracted from reported results.

A class to encompass all data from an entire election. The election’s key data structue is a list of Contest objects which hold the relevant data from each contest within the election.

Variables
  • name (str) – Election name.

  • total_ballots (int) – Total ballots cast in entire election.

  • contests (Dict[str, Contest]) – dict of contests within the election with names as keys.

__repr__(self)[source]

Return repr(self).

__str__(self)[source]

Return str(self).