Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added multi parameter for page level parameters #41

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sverma25
Copy link

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.

@codecov-io
Copy link

codecov-io commented Jul 28, 2019

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%) ⬆️
camelot/io.py 100% <100%> (ø) ⬆️

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.

@sverma25
Copy link
Author

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

@MartinThoma
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants