2 # Parse markdown table into tuple of lists
6 from bs4 import BeautifulSoup
11 with open(file, "r", encoding="utf-8") as input_file:
12 return markdown.markdown(input_file.read(), extensions=['tables'])
17 return inp.get_text().rstrip()
25 soup = BeautifulSoup(html, 'html.parser')
28 for x in soup.find_all("tr"):
29 outp.append([clean_text(y) for y in x.find_all("td")])
31 return ([clean_text(x) for x in soup.find_all("th")],
35 return parse_html(md2html(file))
37 if __name__ == "__main__":
38 print(main(sys.argv[1]))