def _parseTable(table: PageElement): print('table =======>', table) tb = dict({ "table": table.get('name', ''), "numRows": table.get('numrows', ''), #"remarks": table.get('remarks', '') }) cols = table.findAllNext('column') def _parseCol(col: PageElement): col_dict = { "col_name": col.get('name', 'unknown name'), "col_remarks": col.get('remarks', ''), "autoUpdated": col.get('autoupdated', ''), "nullable": col.get('nullable', ''), } return col_dict columns = list(map(_parseCol, cols)) cols = {"columns": list(columns)} tab = {"tb": tb} return {**tab, **cols}
def _parseCol(col: PageElement): col_dict = { "col_name": col.get('name', 'unknown name'), "col_remarks": col.get('remarks', ''), "autoUpdated": col.get('autoupdated', ''), "nullable": col.get('nullable', ''), } return col_dict
def is_declaration(element: bs4.PageElement) -> bool: return (is_tag(element) and element.name == 'div' and 'memitem' in element.get('class', ()) )
def is_group_header(element: bs4.PageElement) -> bool: return is_tag(element) and 'groupheader' in element.get('class', ())