def workbook_changes(filename):
    """Changes spreadsheet format width, freezes first row, and sets
    filtering reference"""
    sheet_name = 'Sheet1'
    freeze_row = 'A2'  # freezes the first row of the document

    control_id_width = 14
    control_name_width = 69
    mapping_type_width = 18
    technique_id_width = 18
    technique_name_width = 58

    column_widths = [
        control_id_width,
        control_name_width,
        mapping_type_width,
        technique_id_width,
        technique_name_width,
    ]

    workbook = openpyxl.load_workbook(filename)
    worksheet = workbook[sheet_name]
    worksheet.freeze_panes = worksheet[freeze_row]

    # establishes filtering references in document
    auto_filter_section = f'A1:E{len(list(worksheet.rows))}'
    worksheet.auto_filter.ref = auto_filter_section

    for i, column_width in enumerate(column_widths):
        worksheet.column_dimensions[openpyxl.utils.get_column_letter(i + 1)].width = column_width

    workbook.save(filename)
Changes spreadsheet format width, freezes first row, and sets
    filtering reference
src/list_mappings.py