Package elections :: Module blt
[frames] | no frames]

Module blt

source code

This module contains functions for reading and writing .blt files.

Functions
Election
read_blt(path)
Parse a .blt file or use a cached version and return an Election instance.
source code
 
write_blt(path, election)
Write a "simplified" .blt file from the election.
source code
Variables
  __package__ = 'elections'
Function Details

read_blt(path)

source code 

Parse a .blt file or use a cached version and return an Election instance.

If the file is 'foo/bar.blt', check for the existence of 'foo/bar.pickle'. If it exists and it is newer than the .blt, use that. Otherwise, parse the .blt and update the .pickle.

Parameters:
  • path (string) - Path to the .blt.
Returns: Election
An Election representing the ballots at path.

write_blt(path, election)

source code 

Write a "simplified" .blt file from the election.

Parameters:
  • path (string) - The path to the .blt file to write.
  • election (Election) - The election to write out.