Giter Club home page Giter Club logo

Comments (5)

jsvine avatar jsvine commented on May 19, 2024

So glad to hear it! And that's a great question. Currently, pdfplumber doesn't provide any special methods for handling column-spanning rows. But it's a really interesting problem to try to solve. For now, the recommended approach is just to write custom logic, as you suggest. If you run into any difficulties with that, I'd be happy to take a look at the code.

from pdfplumber.

Kirkman avatar Kirkman commented on May 19, 2024

Curious if this has changed in the two years since I first asked the question.

I still have a lot of PDFs where a header row might have text spanning multiple columns, which seems to defeat table extraction.

Here's an example, and the resulting tablefinder debug:
Example PDF
Parsed table image

from pdfplumber.

jsfenfen avatar jsfenfen commented on May 19, 2024

@Kirkman I believe the best approach is still to write your own logic--there's so many examples of weird tables that writing a general approach gets super complicated. To my mind it's useful to write your own parser, as you can build in logical tests that detect when it is going wrong, which is the sorta feedback that's harder to convey in an automated extraction, but is often required in dealing with weird formats.

from pdfplumber.

Kirkman avatar Kirkman commented on May 19, 2024

Another thought. In this specific case, is there a way I can adjust the table parser settings so that it identifies the column-spanning header rows as separate, 1-col tables? There is a full empty line of white space between those rows and the actual tables.

from pdfplumber.

jsvine avatar jsvine commented on May 19, 2024

Hi @Kirkman, I'm catching up on a few old issues and came back across this one. I realize you probably have moved on from this particular challenge, but for the sake of responding:

I can't think of a simple, library-generalizable approach that would provide the functionality sought. I think the best approach for tables like these (which, in some respects, depend on human spatial reasoning skills rather than explicit delineations β€”Β and are more akin to custom-structured lists than proper tables) is to write a bit of custom code. For instance, you could use page.crop(...) to divide the page into each candidate's section, and then parse each individually.

from pdfplumber.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.