camelot icon indicating copy to clipboard operation
camelot copied to clipboard

Added multi parameter for page level parameters

Open sverma25 opened this issue 6 years ago • 3 comments

Can be used for setting different parameters for different pages in a document. For example, if wanting to supply table_region for a document, multi can be used to submit different regions for different areas. Common parameters that are to be applied for all pages can still be used.

Multi is used a dictionary to supply additional parameters (Page: Parameters (in dict)). Added parameters override the global arguments for that page

For example,

filename = os.path.join(testdir, "multi_params.pdf")
tables = camelot.read_pdf(filename, pages="all",  
    multi={'2': {"table_regions": ["120, 210, 400, 90"]}}, 
    split_text=True)

In this example, page 1 will use split_text as its parameters, and page 2 will use table regions AND split text as its parameters.

sverma25 avatar Jul 28 '19 15:07 sverma25

Codecov Report

Merging #41 into master will increase coverage by 0.05%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #41      +/-   ##
==========================================
+ Coverage   87.69%   87.74%   +0.05%     
==========================================
  Files          13       13              
  Lines        1511     1518       +7     
  Branches      349      350       +1     
==========================================
+ Hits         1325     1332       +7     
  Misses        129      129              
  Partials       57       57
Impacted Files Coverage Δ
camelot/handlers.py 91.01% <100%> (+0.76%) :arrow_up:
camelot/io.py 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7ecfcad...de75c05. Read the comment docs.

codecov-io avatar Jul 28 '19 15:07 codecov-io

@vinayak-mehta Added the multi feature as per your request from camelot to camelot-dev.

sverma25 avatar Jul 30 '19 21:07 sverma25

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?

MartinThoma avatar Feb 25 '24 11:02 MartinThoma