election_day.formats.imports.election.ech

Attributes

MajoralElected

election_class

gender

Functions

import_elections_ech(...)

Imports all elections in a given eCH-0252 delivery.

import_information_delivery(→ tuple[datetime.date, ...)

Import an election information delivery.

import_result_delivery(→ None)

Import an election result delivery.

import_majoral_election_result(→ None)

Helper function to import election results specific to majoral

import_proportional_election_result(→ None)

Helper function to import election results specific to proportional

get_candidate(...)

Helper function to retreive a candidate of existing candidates.

get_list(→ onegov.election_day.models.List | None)

Helper function to retreive a list of existing lists.

Module Contents

election_day.formats.imports.election.ech.MajoralElected: TypeAlias = ElectedType.MajoralElection.ElectedCandidate[source]
election_day.formats.imports.election.ech.election_class[source]
election_day.formats.imports.election.ech.gender: dict[xsdata_ech.e_ch_0155_5_0.SexType, onegov.election_day.types.Gender][source]
election_day.formats.imports.election.ech.import_elections_ech(principal: Canton | Municipality, delivery: xsdata_ech.e_ch_0252_2_0.Delivery, session: sqlalchemy.orm.Session, default_locale: str) onegov.election_day.formats.imports.common.ECHImportResultType[source]

Imports all elections in a given eCH-0252 delivery.

Deletes elections on the same day not appearing in the delivery.

Returns:

A tuple consisting of a list with errors, a set with updated elections, and a set with deleted elections.

election_day.formats.imports.election.ech.import_information_delivery(principal: Canton | Municipality, delivery: xsdata_ech.e_ch_0252_2_0.EventElectionInformationDeliveryType, session: sqlalchemy.orm.Session, default_locale: str) tuple[datetime.date, list[onegov.election_day.models.ElectionCompound], list[onegov.election_day.models.Election], set[onegov.election_day.models.ElectionCompound | onegov.election_day.models.Election], set[onegov.election_day.formats.imports.common.FileImportError]][source]

Import an election information delivery.

election_day.formats.imports.election.ech.import_result_delivery(principal: Canton | Municipality, delivery: xsdata_ech.e_ch_0252_2_0.EventElectionResultDeliveryType, polling_day: datetime.date, elections: list[onegov.election_day.models.Election], errors: set[onegov.election_day.formats.imports.common.FileImportError]) None[source]

Import an election result delivery.

election_day.formats.imports.election.ech.import_majoral_election_result(candidates: dict[str, onegov.election_day.models.Candidate], election_result: onegov.election_day.models.ElectionResult, majoral_election: xsdata_ech.e_ch_0252_2_0.ElectionResultType.MajoralElection, errors: set[onegov.election_day.formats.imports.common.FileImportError]) None[source]

Helper function to import election results specific to majoral elections.

election_day.formats.imports.election.ech.import_proportional_election_result(candidates: dict[str, onegov.election_day.models.Candidate], lists: dict[str, onegov.election_day.models.List], election_result: onegov.election_day.models.ElectionResult, proportional_election: xsdata_ech.e_ch_0252_2_0.ElectionResultType.ProportionalElection, errors: set[onegov.election_day.formats.imports.common.FileImportError]) None[source]

Helper function to import election results specific to proportional elections.

election_day.formats.imports.election.ech.get_candidate(candidates: dict[str, onegov.election_day.models.Candidate], candidate_id: str, errors: set[onegov.election_day.formats.imports.common.FileImportError]) onegov.election_day.models.Candidate | None[source]

Helper function to retreive a candidate of existing candidates.

election_day.formats.imports.election.ech.get_list(lists: dict[str, onegov.election_day.models.List], list_id: str, errors: set[onegov.election_day.formats.imports.common.FileImportError]) onegov.election_day.models.List | None[source]

Helper function to retreive a list of existing lists.