📄 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
pandasDataFrames - Saves output as
.xlsxExcel files usingopenpyxl - 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.
Metadata
Release files for pdfsp 0.1.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pdfsp-0.1.14.tar.gz | 7.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pdfsp-0.1.14-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.0 kB
Release files / pdfsp-0.1.14.tar.gz
| Download URL | pdfsp-0.1.14.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e1e32164c0b3661e7401f6d78f3f843b45b182a907a5ab17995abbccc2b32efa
|
|
BLAKE2b-256 checksum How to use checksums |
127d0b1a996853e92708dd36feca053d44c11eb3a95a825fdea3a44f5bc1513e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.3
|
Release files / pdfsp-0.1.14-py3-none-any.whl
| Download URL | pdfsp-0.1.14-py3-none-any.whl |
|---|---|
| Size | 12.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6b14c38ba1b7d2c871d15f3f64084bef391362b1173f4453a158bb167887f6cd
|
|
BLAKE2b-256 checksum How to use checksums |
e2840a747e86b36f1604ba8d14db58113a2824bcb6d289aa82222f32d048f63e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.3
|