Skip to main content

A package for extracting images, texts and tables from pdfs

Project description

PDF Text, Tables & Image Extractor

A robust Python-based utility designed to extract text, tables, and images from PDF documents. This tool supports both local file systems and Amazon S3, utilizing multi-threading to speed up the extraction process.

🚀 Features

  • Hybrid Storage Support: Seamlessly process PDFs from local paths or S3 buckets (s3://...).
  • Comprehensive Extraction:
    • Text: Full-page text extraction.
    • Tables: Structured table data.
    • Images: High-fidelity image extraction.
  • Multi-threaded Performance: Extracts text and images in parallel to significantly reduce processing time.
  • Cloud Ready: Built-in methods to save results directly back to S3 as JSON, Markdown and PNG files.
  • PDF type Detection Can detect if a pdf is a scanned pdf with no text overlay

🛠 Installation

1. Install using pip

pip install pdf_text_image_xtract

Basic Example Usage

from pdf_text_image_xtract import PDFTextImageExtractor

# Initialize the extractor with a local path
extractor = PDFTextImageExtractor("documents/report.pdf")

# Process the PDF (runs text and image extraction in parallel)
extractor.process()

# Save results to local disk
extractor.save_text_data_to_json("output/data.json")
extractor.save_images_to_disk("output/extracted_images")

Cloud Example (AWS S3)

from pdf_text_image_xtract import PDFTextImageExtractor

# Initialize with an S3 path
s3_path = "s3://my-bucket/input/document.pdf"
extractor = PDFTextImageExtractor(s3_path)

# Extract data
extractor.process()

# Upload results directly back to S3
extractor.save_text_data_to_json_s3(
    bucket_name="my-bucket",
    object_key="results/text_data.json",
)

extractor.save_images_to_s3(
    bucket_name="my-bucket",
    folder="results/images",
)

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

pdf_text_image_xtract-0.2.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

pdf_text_image_xtract-0.2.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file pdf_text_image_xtract-0.2.0.tar.gz.

File metadata

  • Download URL: pdf_text_image_xtract-0.2.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for pdf_text_image_xtract-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e131136cebb56560222ff616562f4d4d7f7367270a1174fdc164aca65ad4cf27
MD5 05b6f3bfda0a4a19c4b3d579cf90237c
BLAKE2b-256 6ee92d2382fbb77aab7637ee821e15becd485d1a667f3a21ebeed3bdc18ece95

See more details on using hashes here.

File details

Details for the file pdf_text_image_xtract-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pdf_text_image_xtract-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8805cab3550406bc8ece53fb4fe2f8bde86196c5d460e3dc722153fae42d3208
MD5 f74636cfa9db3e2b2900401632eff0c7
BLAKE2b-256 f0d21eeee0eafeb8082e5c4472e9c7ab5f2066936410c6c4367f073e796996d6

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