def get_table_and_tdiv( standard: BeautifulSoup) -> Tuple[List[TableDictType], Tag]: all_tables = standard.find_all('div', class_='table') html_table = pl.find_tdiv_by_id(all_tables, TABLE_ID) list_table = attribute_table_to_list(html_table) table_dict_list = table_to_dict(list_table, COLUMN_TITLES) return (table_dict_list, html_table)
def get_attribute_table(standard: BeautifulSoup) -> List[TableDictType]: attr_dict_list: List[TableDictType] = [] all_tables = standard.find_all('div', class_='table') for table_id in ATTR_TABLE_IDS: html_table = pl.find_tdiv_by_id(all_tables, table_id) list_table = attribute_table_to_list(html_table) table_dict_list = table_to_dict(list_table, COLUMN_TITLES) attr_dict_list.extend(table_dict_list) return attr_dict_list
def ciod_table_to_dict(table): return table_to_dict(table, COLUMN_TITLES)
def get_conf_profile_table(standard: BeautifulSoup) -> List[TableDictType]: all_tables = standard.find_all('div', class_='table') html_table = pl.find_tdiv_by_id(all_tables, TABLE_ID) list_table = attribute_table_to_list(html_table) return table_to_dict(list_table, COLUMN_TITLES, omit_empty=True)
def macro_table_to_dict(table: TableListType) -> List[TableDictType]: return table_to_dict(table, COLUMN_TITLES)
def module_table_to_dict(table): has_type_column = len(table[0]) > 3 column_titles = COLUMN_TITLES_WITH_TYPE if has_type_column else COLUMN_TITLES_NO_TYPE return table_to_dict(table, column_titles)
def get_attribute_table(standard): all_tables = standard.find_all('div', class_='table') html_table = pl.find_tdiv_by_id(all_tables, ATTR_TABLE_ID) list_table = attribute_table_to_list(html_table) return table_to_dict(list_table, COLUMN_TITLES)
def ciod_table_to_dict(table: StringifiedTableListType) -> List[TableDictType]: # Table F.3-1 (the only table in section F) has no "Information Entity" column, so we check for the href in the second column # http://dicom.nema.org/dicom/2013/output/chtml/part03/sect_F.3.html#table_F.3-1 sect_f_table = 'href' in table[0][1] column_titles = COLUMN_TITLES_NO_IE if sect_f_table else COLUMN_TITLES_WITH_IE return table_to_dict(table, column_titles)
def module_table_to_dict( table: StringifiedTableListType) -> List[TableDictType]: has_type_column = len(table[0]) > 3 column_titles = COLUMN_TITLES_WITH_TYPE if has_type_column else COLUMN_TITLES_NO_TYPE return table_to_dict(table, column_titles)