fdutils/html.py
def parse_html_table_row_headers(table, split_section_func=None, keep_attributes=False):
    """ parses a table where the headers are on the rows
    
    Args:
        table (lxml ETree):
        split_section_func: 
        keep_attributes: 

    Returns:

    """
    sections = ordered_dict()

    section_name = ''

    for row in _get_tbody_rows(table):

        labels, data = _get_row_label_cells_data(row)

        if labels:
            # expecting only one columns
            labels = labels[0]
            data = data[0] if data else {}

            if split_section_func is not None:
                _section_name = split_section_func(labels, data, sections)

                if _section_name:
                    section_name = _section_name
                    continue

            elif section_name not in sections:
                sections[section_name] = {}

            sections[section_name][labels['txt']] = data

    if not keep_attributes:
        for section, section_dict in sections.items():
            for label, data in section_dict.items():
                section_dict[label] = data.get('txt', '')

    return sections if section_name else sections['']
 parses a table where the headers are on the rows
    
    Args:
        table (lxml ETree):
        split_section_func: 
        keep_attributes: 

    Returns:

    
parses a table where the headers are on the rows
parses a table where the headers are on the rows
def parse_html_table_row_headers(table, split_section_func=None, keep_attributes=False):
    sections = ordered_dict()
    section_name = ''
    for row in _get_tbody_rows(table):
        labels, data = _get_row_label_cells_data(row)
        if labels:
            labels = labels[0]
            data = data[0] if data else {}
            if split_section_func is not None:
                _section_name = split_section_func(labels, data, sections)
                if _section_name:
                    section_name = _section_name
                    continue
            elif section_name not in sections:
                sections[section_name] = {}
            sections[section_name][labels['txt']] = data
    if not keep_attributes:
        for section, section_dict in sections.items():
            for label, data in section_dict.items():
                section_dict[label] = data.get('txt', '')
    return sections if section_name else sections['']
def parse_html_table_row_headers ( table , split_section_func = None , keep_attributes = False ) : sections = ordered_dict ( ) section_name = '' for row in _get_tbody_rows ( table ) : labels , data = _get_row_label_cells_data ( row ) if labels : labels = labels [ 0 ] data = data [ 0 ] if data else { } if split_section_func is not None : _section_name = split_section_func ( labels , data , sections ) if _section_name : section_name = _section_name continue elif section_name not in sections : sections [ section_name ] = { } sections [ section_name ] [ labels [ 'txt' ] ] = data if not keep_attributes : for section , section_dict in sections . items ( ) : for label , data in section_dict . items ( ) : section_dict [ label ] = data . get ( 'txt' , '' ) return sections if section_name else sections [ '' ]
parses a table where the headers are on the rows
parses a table where the headers are on the rows
""" parses a table where the headers are on the rows
    
    Args:
        table (lxml ETree):
        split_section_func: 
        keep_attributes: 

    Returns:

    """ # expecting only one columns
None
table
None
split_section_func
None
keep_attributes
None