Skip to content

Update file layout #3

@hancush

Description

@hancush

new layout, who dis?

class MunicipalResultParser(FixedWidthParser):
    """
    Summary Export File Format           Length    Column Position

    Record type                          1         1
    Global contest order                 5         2-6
    Global choice order                  5         7-11
    # Completed precincts                5         12-16
    Votes                                7         17-23
    Contest Total registration           7         24-30
    Contest Total ballots cast           7         31-37
    Contest Name                        70         38-107
    Choice Name                         50         108-157
    Choice Party Name                   50         158-207
    Choice Party Abbreviation            3         208-210
    District Type Name                  50         211-260
    District Type Global Order           5         261-265
    # of Eligible Precincts              5         266-270
    Vote For                             2         271-272

    Source: https://chicagoelections.gov/results/ap/SummaryExportFormat.xls
    """
    record_type = OneIndexedFixedWidthField(1, 1, transform=int)
    contest_code = OneIndexedFixedWidthField(2, 5, transform=int)
    candidate_number = OneIndexedFixedWidthField(7, 5, transform=int)
    precincts_reporting = OneIndexedFixedWidthField(12, 5, transform=int)
    vote_total = OneIndexedFixedWidthField(17, 7, transform=int)
    race_total_registration = OneIndexedFixedWidthField(24, 7, transform=int)
    race_total_ballots_cast = OneIndexedFixedWidthField(31, 7, transform=int)
    race_name = OneIndexedFixedWidthField(38, 70)
    candidate_name = OneIndexedFixedWidthField(108, 50, transform=replace_single_quotes)
    party = OneIndexedFixedWidthField(158, 50)
    party_abbreviation = OneIndexedFixedWidthField(208, 3)
    reporting_unit_name = OneIndexedFixedWidthField(211, 50)
    reporting_unit_code = OneIndexedFixedWidthField(261, 5, transform=int)
    precincts_total = OneIndexedFixedWidthField(266, 5, transform=int)
    vote_for = OneIndexedFixedWidthField(271, 2, transform=int)

Update the summary module and README.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions