election_day.formats.imports.ech

Module Contents

Functions

import_ech(...)

Tries to import the given eCH XML file.

election_day.formats.imports.ech.import_ech(principal: Canton | Municipality, file: IO[bytes], session: sqlalchemy.orm.Session, default_locale: str) onegov.election_day.formats.imports.common.ECHImportResultType[source]

Tries to import the given eCH XML file.

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

Returns:

A tuple consisting of a list with errors and a set with updated votes.