Skip to main content

No project description provided

Project description

Parsee PDF Reader

This PDF reader was designed to overcome the common problems when trying to extract tables from PDFs.

We started initially with a focus on financial/numeric tables, so this is what this PDF reader works best for.

This is an early release, so we will be still making major changes.

Installation

Recommended install with poetry: https://python-poetry.org/docs/

poetry add parsee-pdf-reader

Alternatively:

pip install parsee-pdf-reader

In order to use the OCR capabilities you also have to install tesseract: Install Google Tesseract OCR (additional info how to install the engine on Linux, Mac OSX and Windows). You must be able to invoke the tesseract command as 'tesseract'. Note: in our testing we always used tesseract 5+, as that proved to be the most reliable. So for Linux you might have to build from source to get tesseract 5.

In order to run the PDF to image functionality you need to install poppler, e.g. on MacOSX:

brew install poppler

Extracting Tables and Paragraphs

Extracting tables and paragraphs of text can be done in one line:

from pdf_reader import get_elements_from_pdf
elements = get_elements_from_pdf("FILE_PATH")

If you are processing a PDF that needs OCR but no elements or just very few are being returned, you can force OCR like this (replace the paths):

elements = get_elements_from_pdf("FILE_PATH", force_ocr=True)

If you want to visualise the output from the extraction, you can run the following (replace the paths):

from pdf_reader import visualise_pdf_output
visualise_pdf_output("FILE_PATH", "OUTPUT_PATH")

This will save an image of each page with the detected tables and text marked in red.

Methodology

Combines pdfminer, pypdf and tesseract and augments them with the introduction of table elements, which are treated separately from the rest of the text. As a result, the output contains basically two types of elements: tables and text paragraphs. We believe this separation is important as otherwise the tabular information is not extracted very precisely and concepts such as columns and rows are usually lost.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

parsee_pdf_reader-0.1.8.1.tar.gz (25.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

parsee_pdf_reader-0.1.8.1-py3-none-any.whl (27.7 kB view details)

Uploaded Python 3

File details

Details for the file parsee_pdf_reader-0.1.8.1.tar.gz.

File metadata

  • Download URL: parsee_pdf_reader-0.1.8.1.tar.gz
  • Upload date:
  • Size: 25.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.0 CPython/3.13.3 Darwin/24.6.0

File hashes

Hashes for parsee_pdf_reader-0.1.8.1.tar.gz
Algorithm Hash digest
SHA256 f3c7c1706da9ca77399f0788160973e874f3f1f71d71ec2c453bf999ba92b4ae
MD5 f1047ab147edf4782c2e4d96cdabaa0c
BLAKE2b-256 801a861717fbb354bf34b1edf8e34033fd2d9e2dc80b57a959906147095c2603

See more details on using hashes here.

File details

Details for the file parsee_pdf_reader-0.1.8.1-py3-none-any.whl.

File metadata

File hashes

Hashes for parsee_pdf_reader-0.1.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ea1f60d2f883710927b4b97a5ed8a3d717cfc1ba0ddd5b55ceecebaf47beec00
MD5 80ff527e0b6feaf4aba7c5e46f19afbe
BLAKE2b-256 05e6bbaadccba6ff1f82c73c7caf654ca9a5dfd639e8c649c31f3e4649ce3415

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page