Exemplo n.º 1
0
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}
Exemplo n.º 2
0
 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
Exemplo n.º 3
0
def is_declaration(element: bs4.PageElement) -> bool:
    return (is_tag(element)
        and element.name == 'div' and 'memitem' in element.get('class', ())
    )
Exemplo n.º 4
0
def is_group_header(element: bs4.PageElement) -> bool:
    return is_tag(element) and 'groupheader' in element.get('class', ())