Live data from Hacker News

A Python Library to extract tabular data from PDFs

blog.socialcops.com

1–10 of 102 posts

Re: A Python Library to extract tabular data from PDFs

#4
Cool! That's a good intro too.

Many people don't realise the general weird disconnect in PDFs between real content and what you see on the screen that makes it hard to recover source data. In extreme cases you have subset fonts with glyphs ordered completely differently from how they are in the original and no mapping back to the character they represent. Then the graphics stream is instructions to draw glyphs at coordinates. As you can imagine it's quite a battle to get back to something "raw" (assuming you even had fonts to start with).

Re: A Python Library to extract tabular data from PDFs

#7
post #3

I hope this is good at extracting register maps from datasheets. That would save a lot of tedious driver work.

Hi berti! I wrote the library and the blog post. Can you point me to some PDFs which have these register maps?

Try these: Page 233 http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-8351-M...

Page 45 https://ae-bst.resource.bosch.com/media/_tech/media/datashee...

Is the library able to handle cells that span multiple columns?

Re: A Python Library to extract tabular data from PDFs

#10
post #7

Earlier quoted context omitted.

Hi berti! I wrote the library and the blog post. Can you point me to some PDFs which have these register maps?

Try these: Page 233 http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-8351-M... Page 45 https://ae-bst.resource.bosch.com/media/_tech/media/datashee... Is the library able to handle cells that span multiple columns?

I assumed that you're talking about page 33 in the first PDF, since it has only 225 pages. I extracted Figure 6-23 from it and the table on page 45 in the second PDF. Here's a gist: https://gist.github.com/vinayak-mehta/cf30a5560f1b8ab4c0b25e...

Yes, Camelot takes care of cells spanning multiple columns! You can check out the Advanced Usage section for explanation on the keyword arguments I used in the gist! https://camelot-py.readthedocs.io/en/master/user/advanced.ht...

Post reply on HN