election_day.utils.vote.ballot

Module Contents

Classes

EntityData

dict() -> new empty dictionary

Functions

get_ballot_data_by_entity(→ dict[int, EntityData])

Returns the yeas/nays percentage by entity_id.

get_ballot_data_by_district(→ dict[str, DistrictData])

Returns the yeas/nays percentage grouped and keyed by district.

class election_day.utils.vote.ballot.EntityData[source]

Bases: typing_extensions.TypedDict

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

counted: bool[source]
percentage: typing_extensions.NotRequired[float][source]
election_day.utils.vote.ballot.get_ballot_data_by_entity(ballot: onegov.ballot.models.Ballot) dict[int, EntityData][source]

Returns the yeas/nays percentage by entity_id.

election_day.utils.vote.ballot.get_ballot_data_by_district(ballot: onegov.ballot.models.Ballot) dict[str, DistrictData][source]

Returns the yeas/nays percentage grouped and keyed by district.