election_day.formats.imports.election.wabstic_majorz

Attributes

WABSTIC_MAJORZ_HEADERS_WM_WAHL

WABSTIC_MAJORZ_HEADERS_WMSTATIC_GEMEINDEN

WABSTIC_MAJORZ_HEADERS_WM_GEMEINDEN

WABSTIC_MAJORZ_HEADERS_WM_KANDIDATEN

WABSTIC_MAJORZ_HEADERS_WM_KANDIDATENGDE

Functions

get_entity_id(→ int)

import_election_wabstic_majorz(...)

Tries to import the given CSV files from a WabstiCExport.

Module Contents

election_day.formats.imports.election.wabstic_majorz.WABSTIC_MAJORZ_HEADERS_WM_WAHL = ('sortgeschaeft', 'absolutesmehr', 'anzpendentgde')[source]
election_day.formats.imports.election.wabstic_majorz.WABSTIC_MAJORZ_HEADERS_WMSTATIC_GEMEINDEN = ('sortwahlkreis', 'sortgeschaeft', 'bfsnrgemeinde', 'stimmberechtigte')[source]
election_day.formats.imports.election.wabstic_majorz.WABSTIC_MAJORZ_HEADERS_WM_GEMEINDEN = ('bfsnrgemeinde', 'stimmberechtigte', 'sperrung', 'stmabgegeben', 'stmleer', 'stmungueltig',...[source]
election_day.formats.imports.election.wabstic_majorz.WABSTIC_MAJORZ_HEADERS_WM_KANDIDATEN = ('sortgeschaeft', 'knr', 'nachname', 'vorname', 'gewaehlt', 'partei')[source]
election_day.formats.imports.election.wabstic_majorz.WABSTIC_MAJORZ_HEADERS_WM_KANDIDATENGDE = ('sortgeschaeft', 'bfsnrgemeinde', 'knr', 'stimmen')[source]
election_day.formats.imports.election.wabstic_majorz.get_entity_id(line: onegov.core.csv.DefaultRow) int[source]
election_day.formats.imports.election.wabstic_majorz.import_election_wabstic_majorz(election: onegov.election_day.models.Election, principal: Canton | Municipality, number: str, district: str, file_wm_wahl: IO[bytes], mimetype_wm_wahl: str, file_wmstatic_gemeinden: IO[bytes], mimetype_wmstatic_gemeinden: str, file_wm_gemeinden: IO[bytes], mimetype_wm_gemeinden: str, file_wm_kandidaten: IO[bytes], mimetype_wm_kandidaten: str, file_wm_kandidatengde: IO[bytes], mimetype_wm_kandidatengde: str) list[onegov.election_day.formats.imports.common.FileImportError][source]

Tries to import the given CSV files from a WabstiCExport.

This function is typically called automatically every few minutes during an election day - we use bulk inserts to speed up the import.

Returns:

A list containing errors.