MCPcopy Index your code
hub / github.com/CrafterKolyan/tiny-python-docker-image / find_table

Function find_table

util/update-readme-table.py:24–34  ·  view source on GitHub ↗
(readme)

Source from the content-addressed store, hash-verified

22
23
24def 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
37def merge_tables(current_table, new_table):

Callers 1

update_tableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected