Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_pandas(self):
rect_x0_clusters = utils.cluster_list([ r["x0"]
for r in self.pdf.pages[1].rects ], tolerance=3)
v_lines = [ x[0] for x in rect_x0_clusters ]
def parse_page(page):
data = page.extract_table({
"vertical_strategy": "explicit",
"explicit_vertical_lines": v_lines
})
without_spaces = [ fix_row_spaces(row) for row in data ]
return without_spaces
parsed = parse_page(self.pdf.pages[0])
assert(parsed[0] == [
"NoticeDate",
def draw_hlines(self, locations, **kwargs):
for x in utils.to_list(locations):
self.draw_hline(x, **kwargs)
return self