Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants