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

Various fixes #154

Merged
merged 7 commits into from
Oct 7, 2024
Merged

Various fixes #154

merged 7 commits into from
Oct 7, 2024

Conversation

bosd
Copy link
Collaborator

@bosd bosd commented Oct 5, 2024

Cherry-picks from: https://github.com/foarsitter/camelot/pull/72

Below is documentation on each of the changes

  1. core.py:

*Table.to_excel method bug-fix: With the installed version of pandas in pypdf_table_extraction, the pd.ExcelWriter object no longer has a write method. I've updated this method accordingly to write the file in the recommended manner.

  • Linting changes: In my personal usage, I found the type hinting of the original camelot package left a lot to be desired. My personal use case made the Table and TableList objects most important, so I've added type hinting to these methods that enable type checkers and linters to provide useful hints when using these objects or functions that return them. For example, I used to get linting errors about iterating through a TableList, whereas now I don't! The linter is also able to tell that the objects within the iterable are Tables. Just a small QOL change that went a long way in my use-case, and likely will for others.
  1. lattice.py:
  • Ensuring indices has elements: This is a small but mighty change! We found errors consistently at this line. After returning from lattice.get_table_index, there is no check for whether the indices list has any elements. This slight modification does the indices reduction if the indices list has no elements.

@bosd bosd added bug Something isn't working style Style labels Oct 5, 2024
@bosd bosd marked this pull request as ready for review October 7, 2024 21:03
@bosd bosd merged commit 40fa8df into py-pdf:main Oct 7, 2024
12 checks passed
@bosd bosd deleted the Various-fixes branch October 7, 2024 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working style Style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants