Skip to main content

Extracts data from PDF files and saves it to Excel files.

Project description

Pypi Windows Server Pypi Ubuntu Server

PyPI PyPI Downloadst

📄 pdfsp


pdfsp is a Python package that extracts tables from PDF files and saves them to Excel. It also provides a simple Streamlit app for interactive viewing of the extracted data.


🚀 Features

  • Extracts tabular data from PDFs using pdfplumber
  • Converts tables into pandas DataFrames
  • Saves output as .xlsx Excel files using openpyxl
  • Ensures column names are unique to prevent issues
  • Visualizes DataFrames with streamlit

📦 Installation

Make sure you're using Python 3.10 or newer, then install with:

pip install pdfsp -U

python script

# pdf.py
from pdfsp import extract_tables, Options

# Define extraction options
source_folder = "."
output_folder = "output"
combine_tables = True

options = Options(
    source_folder=source_folder,
    output_folder=output_folder,
    combine=combine_tables
)

# Run the table extraction
extract_tables(options)

From console / Terminal / Command Line

# Extract all tables from all PDF files in the current folder and save them to the current folder
pdfsp . .

# Extract and COMBINE large tables (spanning multiple pages) into single files, saved to the current folder
pdfsp . . --combine

# Extract and COMBINE tables, skipping the first row of each table (e.g., header rows)
pdfsp . . --combine --skiprows=1

# Extract all tables from PDF files in 'someFolder' and save them to 'SomeOutFolder'
pdfsp someFolder SomeOutFolder

# Extract all tables from 'some.pdf' and save them to the current folder
pdfsp some.pdf .

# Extract all tables from 'some.pdf' and save them to 'toThisFolder'
pdfsp some.pdf toThisFolder
=== 📊 Extraction Summary Report ===
✅ Successful Files: 3
   - pdfs/report1.pdf → 🗂️ 5 tables extracted
   - pdfs/summary2.pdf → 🗂️ 3 tables extracted
   - pdfs/report2.pdf → 🗂️ 7 tables extracted

❌ Failed Files: 1
   - pdfs/corrupted.pdf

⚠️ Some files failed to process. See details above.

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

pdfsp-0.1.13.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

pdfsp-0.1.13-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file pdfsp-0.1.13.tar.gz.

File metadata

  • Download URL: pdfsp-0.1.13.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.3

File hashes

Hashes for pdfsp-0.1.13.tar.gz
Algorithm Hash digest
SHA256 cd753a66ee0e9306ec854ec0f35ed836d525db8b67835bc6a4da2827d828e008
MD5 02385ddf938614fb472b3383a7af8665
BLAKE2b-256 82bab900793f530fb2eee27fd3870117b4e170d5e6c7ffae6088dc4db5641542

See more details on using hashes here.

File details

Details for the file pdfsp-0.1.13-py3-none-any.whl.

File metadata

  • Download URL: pdfsp-0.1.13-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.3

File hashes

Hashes for pdfsp-0.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 dd2d5bd036425ea0bc8233b92197dd2afe3c220c63678c42aa39dab9544970f6
MD5 1c2b3758db4dbc32cce7e2cd56550da3
BLAKE2b-256 99f9aef64ff496572e080b8e58920e0a41c0823427c42a4fedc0fcdf2b6dba84

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