atlanhq / camelot

Camelot: PDF Table Extraction for Humans
https://camelot-py.readthedocs.io
Other
3.61k stars 349 forks source link

[FEATURE SUGGESTION] Allow for table_areas to find empty tables without erroring out #416

Open ryanarifin134 opened 4 years ago

ryanarifin134 commented 4 years ago

Hello! To parse my PDF with a particularly variable layout, I have to set up my table areas such that some table areas might result in no tables found. When this happens, you get the error seen in this Stack Overflow post here.

My current solution (not perfect, workaround at best) is to separate the pdf_read table area parse that may result in an empty table into its own call, and error handle it with a try_catch block. However, I think it would be reasonable to not error out if a particular table_area has no tables (maybe return None object?).