| 22 | |
| 23 | |
| 24 | def find_table(readme): |
| 25 | with open(readme, "r") as f: |
| 26 | raw_lines = f.readlines() |
| 27 | lines = list(map(str.strip, raw_lines)) |
| 28 | table_start = lines.index("", lines.index(".. csv-table::")) + 1 |
| 29 | table_end = lines.index("", table_start) |
| 30 | header = lines[table_start - 3][len(":header: "):] |
| 31 | table = [header] + lines[table_start:table_end] |
| 32 | table = pd.read_csv(io.StringIO("\n".join(table))) |
| 33 | |
| 34 | return {'table': table, 'table_start': table_start} |
| 35 | |
| 36 | |
| 37 | def merge_tables(current_table, new_table): |