election_day.utils.parties.parties

Functions

get_party_results(→ tuple[list[str], dict[str, Any]])

Returns the aggregated party results as list.

get_party_results_deltas(→ tuple[bool, dict[str, ...)

Returns the aggregated party results with the differences to the

get_party_results_data(→ onegov.core.types.JSONObject_ro)

Retuns the data used for the diagrams showing the party results.

get_party_results_horizontal_data(...)

Retuns the data used for the horitzonal bar diagram showing the party

get_party_results_vertical_data(...)

Retuns the data used for the grouped bar diagram showing the party

get_party_results_seat_allocation(→ list[list[Any]])

Returns the aggregated party results for the seat allocation table.

get_parties_panachage_data(...)

" Get the panachage data as JSON. Used to for the panachage sankey

Module Contents

election_day.utils.parties.parties.get_party_results(item: Election | ElectionCompound | ElectionCompoundPart, json_serializable: bool = False) tuple[list[str], dict[str, Any]][source]

Returns the aggregated party results as list.

election_day.utils.parties.parties.get_party_results_deltas(item: Election | ElectionCompound | ElectionCompoundPart, years: Sequence[str], parties: dict[str, Any]) tuple[bool, dict[str, list[list[str]]]][source]

Returns the aggregated party results with the differences to the last elections.

election_day.utils.parties.parties.get_party_results_data(item: Election | ElectionCompound | ElectionCompoundPart, horizontal: bool) onegov.core.types.JSONObject_ro[source]

Retuns the data used for the diagrams showing the party results.

election_day.utils.parties.parties.get_party_results_horizontal_data(item: Election | ElectionCompound | ElectionCompoundPart) onegov.core.types.JSONObject_ro[source]

Retuns the data used for the horitzonal bar diagram showing the party results.

election_day.utils.parties.parties.get_party_results_vertical_data(item: Election | ElectionCompound | ElectionCompoundPart) onegov.core.types.JSONObject_ro[source]

Retuns the data used for the grouped bar diagram showing the party results.

election_day.utils.parties.parties.get_party_results_seat_allocation(years: Sequence[str], parties: dict[str, Any]) list[list[Any]][source]

Returns the aggregated party results for the seat allocation table.

election_day.utils.parties.parties.get_parties_panachage_data(item: Election | ElectionCompound | ElectionCompoundPart, request: ElectionDayRequest | None = None) onegov.core.types.JSONObject_ro[source]

“ Get the panachage data as JSON. Used to for the panachage sankey chart.