kifield/kifield.py
def ungroup_wb(wb):
    """Ungroup lines that have collapsed references."""
    # return wb

    ws = wb.active
    values = tuple(ws.values)

    try:
        header = values[0]
    except IndexError:
        # No header, so don't even try to ungroup the workbook.
        return wb

    ungrouped_wb = pyxl.Workbook()
    ungrouped_ws = ungrouped_wb.active
    ungrouped_ws.append(header)

    for row in values[1:]:
        column_values = row[1:]
        reference = row[0]
        for ref in explode(reference):
            ungrouped_row = ((ref,) + column_values)
            ungrouped_ws.append(ungrouped_row)

    return ungrouped_wb
Ungroup lines that have collapsed references.
Ungroup lines that have collapsed references.
Ungroup lines that have collapsed references .
def ungroup_wb(wb):
    ws = wb.active
    values = tuple(ws.values)
    try:
        header = values[0]
    except IndexError:
        return wb
    ungrouped_wb = pyxl.Workbook()
    ungrouped_ws = ungrouped_wb.active
    ungrouped_ws.append(header)
    for row in values[1:]:
        column_values = row[1:]
        reference = row[0]
        for ref in explode(reference):
            ungrouped_row = ((ref,) + column_values)
            ungrouped_ws.append(ungrouped_row)
    return ungrouped_wb
def ungroup_wb ( wb ) : ws = wb . active values = tuple ( ws . values ) try : header = values [ 0 ] except IndexError : return wb ungrouped_wb = pyxl . Workbook ( ) ungrouped_ws = ungrouped_wb . active ungrouped_ws . append ( header ) for row in values [ 1 : ] : column_values = row [ 1 : ] reference = row [ 0 ] for ref in explode ( reference ) : ungrouped_row = ( ( ref , ) + column_values ) ungrouped_ws . append ( ungrouped_row ) return ungrouped_wb
Ungroup lines that have collapsed references.
Ungroup lines that have collapsed references .
"""Ungroup lines that have collapsed references.""" # return wb # No header, so don't even try to ungroup the workbook.
wb