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

Sort TableList by order of tables in PDF #277

Closed
symroe opened this issue Feb 15, 2019 · 1 comment · Fixed by #283
Closed

Sort TableList by order of tables in PDF #277

symroe opened this issue Feb 15, 2019 · 1 comment · Fixed by #283

Comments

@symroe
Copy link
Contributor

symroe commented Feb 15, 2019

I would expect the TableList returned by read_pdf to return a list of tables in the order defined in the PDF (by page, then table on that page).

I think this requires a few things:

  1. Create a __lt__ method on Table that looks like:
def __lt__(self, other):
    return self.page < other.page and self.order < other.order
  1. Create an __iter__ method on TableList

  2. return sorted(tables) in read_pdf

I'd be happy to make these changes, but wonder if there are reasons against doing this, before making a PR.

@vinayak-mehta
Copy link
Contributor

I'd be happy to make these changes, but wonder if there are reasons against doing this, before making a PR.

There aren't any reasons against doing this, it just wasn't a priority. You can go ahead and open a PR! Do check out the contributor's guide before opening one.

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

Successfully merging a pull request may close this issue.

2 participants