camelot-dev / camelot

A Python library to extract tabular data from PDFs
https://camelot-py.readthedocs.io
MIT License
2.81k stars 449 forks source link

[MRG] Refactor method `Table.set_edges` for readability #371

Open tomprogrammer opened 1 year ago

tomprogrammer commented 1 year ago

From all close points stored in i, j or k only the first one was used therefore the new function find_close_point only returns the first match if any.

Similar code is hoisted out of loops and branches and the while loops are more clearly expressed with for loops.

This is an alternative approach to #328, that leads to even better structured code in my opinion.

MartinThoma commented 4 months ago

Hey!

As camelot is dead, we try to build a maintained fork at pypdf_table_extraction.

Do you want to open the PR against that branch so that we can merge your improvement?